******** wx.Gauge ******** Inheritance diagram for `wx.Gauge`: | .. inheritance-diagram:: wx.Gauge | Description =========== 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 <#SetValue>`_ and `SetRange <#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 <#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. .. seealso:: `wx.Slider `_, `wx.ScrollBar `_ Derived From ^^^^^^^^^^^^^ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Window Styles ^^^^^^^^^^^^^ ================================================== ================================================== Window Style Description ================================================== ================================================== ``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). ================================================== ================================================== | Control Appearance ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/gauge.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/gauge.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/gauge.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetBezelFace <#GetBezelFace>`_ * `GetRange <#GetRange>`_ * `GetShadowWidth <#GetShadowWidth>`_ * `GetValue <#GetValue>`_ * `IsVertical <#IsVertical>`_ * `Pulse <#Pulse>`_ * `SetBezelFace <#SetBezelFace>`_ * `SetRange <#SetRange>`_ * `SetShadowWidth <#SetShadowWidth>`_ * `SetValue <#SetValue>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `BezelFace <#BezelFace>`_ * `Range <#Range>`_ * `ShadowWidth <#ShadowWidth>`_ * `Value <#Value>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, range=100, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.GA_HORIZONTAL, validator=wx.DefaultValidator, name=wx.GaugeNameStr) Default constructor. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `range` (int) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `validator` (`wx.Validator `_) * `name` (string) | **Returns:** `wx.Gauge `_ -------- .. method:: GetBezelFace() Returns the width of the 3D bezel face. | **Returns:** `int` .. note:: This method is not implemented (returns 0) for most platforms. .. seealso:: `SetBezelFace <#SetBezelFace>`_ -------- .. method:: GetRange() Returns the maximum position of the gauge. | **Returns:** `int` .. seealso: `SetRange <#SetRange>`_ -------- .. method:: GetShadowWidth() Returns the 3D shadow margin width. | **Returns:** `int` .. note:: This method is not implemented (returns 0) for most platforms. .. seealso:: `SetShadowWidth <#SetShadowWidth>`_ -------- .. method:: GetValue() Returns the current position of the gauge. | **Returns:** `int` .. seealso:: `SetValue <#SetValue>`_ -------- .. method:: IsVertical() Returns ``True`` if the gauge is vertical (has ``wx.GA_VERTICAL`` style) and ``False`` otherwise. | **Returns:** `bool` -------- .. method:: Pulse() 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. .. note:: Note that after calling this function the value returned by `GetValue <#GetValue>`_ is undefined and thus you need to explicitely call `SetValue <#SetValue>`_ if you want to restore the determinate mode. -------- .. method:: SetBezelFace(width) Sets the 3D bezel face width. **Parameters:** * `width` (int) .. note:: This method is not implemented (returns 0) for most platforms. .. seealso:: `GetBezelFace <#GetBezelFace>`_ -------- .. method:: SetRange(range) Sets the range (maximum value) of the gauge. This function makes the gauge switch to determinate mode, if it's not already. **Parameters:** * `range` (int) .. seealso:: `GetRange <#GetRange>`_ -------- .. method:: SetShadowWidth(width) Sets the 3D shadow width. **Parameters:** * `width` (int) .. note:: This method is not implemented (returns 0) for most platforms. -------- .. method:: SetValue(pos) Sets the position of the gauge. This function makes the gauge switch to determinate mode, if it's not already. **Parameters:** * `pos` (int): Position for the gauge level. .. seealso:: `GetValue <#GetValue>`_ -------- Properties ^^^^^^^^^^ .. attribute:: BezelFace See `GetBezelFace <#GetBezelFace>`_ and `SetBezelFace <#SetBezelFace>`_ .. attribute:: Range See `GetRange <#GetRange>`_ and `SetRange <#SetRange>`_ .. attribute:: ShadowWidth See `GetShadowWidth <#GetShadowWidth>`_ and `SetShadowWidth <#SetShadowWidth>`_ .. attribute:: Value See `GetValue <#GetValue>`_ and `SetValue <#SetValue>`_