A gauge is a horizontal or vertical bar which shows a quantity (often time).
wx.Gauge supports two working modes: determinate and indeterminate progress.
The first is the usual working mode (see SetValue
and SetRange
) while the second can be used when the program is doing some processing but you don’t know how much progress is being done. In this case, you can periodically call the Pulse
function to make the progress bar switch to indeterminate mode (graphically it’s usually a set of blocks which move or bounce in the bar control).
wx.Gauge supports dynamic switch between these two work modes.
There are no user commands for the gauge.
^^
This class supports the following styles:
wx.GA_HORIZONTAL
: Creates a horizontal gauge.
wx.GA_VERTICAL
: Creates a vertical gauge.
wx.GA_SMOOTH
: Creates smooth progress bar with one pixel wide update step (not supported by all platforms).
wx.GA_TEXT
: Display the current value in percents in the gauge itself. This style is only supported in Qt and ignored under the other platforms. This flag is only available in wxWidgets 3.1.0 and later.
wx.GA_PROGRESS
: Reflect the value of gauge in the application taskbar button under Windows 7 and later and the dock icon under macOS, ignored under the other platforms. This flag is only available in wxWidgets 3.1.0 and later. ^^
Default constructor. |
|
Creates the gauge for two-step construction. |
|
Returns the maximum position of the gauge. |
|
Returns the current position of the gauge. |
|
Returns |
|
Switch the gauge to indeterminate mode (if required) and makes the gauge move a bit to indicate the user that some progress has been made. |
|
Sets the range (maximum value) of the gauge. |
|
Sets the position of the gauge. |
wx.
Gauge
(Control)¶Possible constructors:
Gauge()
Gauge(parent, id=ID_ANY, range=100, pos=DefaultPosition,
size=DefaultSize, style=GA_HORIZONTAL, validator=DefaultValidator,
name=GaugeNameStr)
A gauge is a horizontal or vertical bar which shows a quantity (often time).
__init__
(self, *args, **kw)¶__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, range=100, pos=DefaultPosition, size=DefaultSize, style=GA_HORIZONTAL, validator=DefaultValidator, name=GaugeNameStr)
Constructor, creating and showing a gauge.
parent (wx.Window) – Window parent.
id (wx.WindowID) – Window identifier.
range (int) – Integer range (maximum value) of the gauge. See SetRange
for more details about the meaning of this value when using the gauge in indeterminate mode.
pos (wx.Point) – Window position.
size (wx.Size) – Window size.
style (long) – Gauge style.
validator (wx.Validator) – Window validator.
name (string) – Window name.
Create
(self, parent, id=ID_ANY, range=100, pos=DefaultPosition, size=DefaultSize, style=GA_HORIZONTAL, validator=DefaultValidator, name=GaugeNameStr)¶Creates the gauge for two-step construction.
See wx.Gauge for further details.
parent (wx.Window) –
id (wx.WindowID) –
range (int) –
pos (wx.Point) –
size (wx.Size) –
style (long) –
validator (wx.Validator) –
name (string) –
bool
GetClassDefaultAttributes
(variant=WINDOW_VARIANT_NORMAL)¶variant (WindowVariant) –
IsVertical
(self)¶Returns True
if the gauge is vertical (has GA_VERTICAL
style) and False
otherwise.
bool
Pulse
(self)¶Switch the gauge to indeterminate mode (if required) and makes the gauge move a bit to indicate the user that some progress has been made.
SetRange
(self, range)¶Sets the range (maximum value) of the gauge.
This function makes the gauge switch to determinate mode, if it’s not already.
When the gauge is in indeterminate mode, under wxMSW the gauge repeatedly goes from zero to range and back; under other ports when in indeterminate mode, the range setting is ignored.
range (int) –
See also
SetValue
(self, pos)¶Sets the position of the gauge.
The pos must be between 0 and the gauge range as returned by GetRange
, inclusive.
This function makes the gauge switch to determinate mode, if it was in indeterminate mode before.
pos (int) – Position for the gauge level.
See also