.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.Gauge:

==========================================================================================================================================
|phoenix_title|  **wx.Gauge**
==========================================================================================================================================

A gauge is a horizontal or vertical bar which shows a quantity (often time).          

:ref:`wx.Gauge`  supports two working modes: determinate and indeterminate progress. 

The first is the usual working mode (see :meth:`~wx.Gauge.SetValue`  and :meth:`~wx.Gauge.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 :meth:`~wx.Gauge.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). 

:ref:`wx.Gauge`  supports dynamic switch between these two work modes. 

There are no user commands for the gauge. 





.. _Gauge-styles:

|styles| Window Styles
================================

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).  








         



.. seealso:: :ref:`wx.Slider`, :ref:`wx.ScrollBar`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>Gauge</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.Gauge_inheritance.png" alt="Inheritance diagram of Gauge" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Control.html" title="wx.Control" alt="" coords="60,237,148,267"/> <area shape="rect" id="node6" href="wx.Gauge.html" title="wx.Gauge" alt="" coords="62,315,145,344"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window" alt="" coords="59,160,148,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,87,35"/> <area shape="rect" id="node5" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="48,83,159,112"/> <area shape="rect" id="node4" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="112,5,213,35"/> </map> 
   </p>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.gauge.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/wx.gauge.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.gauge.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.Gauge.__init__`                                                       Default constructor.
:meth:`~wx.Gauge.Create`                                                         Creates the gauge for two-step construction.
:meth:`~wx.Gauge.GetBezelFace`                                                   Returns the width of the 3D bezel face.
:meth:`~wx.Gauge.GetRange`                                                       Returns the maximum position of the gauge.
:meth:`~wx.Gauge.GetShadowWidth`                                                 Returns the 3D shadow margin width.
:meth:`~wx.Gauge.GetValue`                                                       Returns the current position of the gauge.
:meth:`~wx.Gauge.IsVertical`                                                     Returns ``True`` if the gauge is vertical (has  ``GA_VERTICAL``   style) and ``False`` otherwise.
:meth:`~wx.Gauge.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.
:meth:`~wx.Gauge.SetBezelFace`                                                   Sets the 3D bezel face width.
:meth:`~wx.Gauge.SetRange`                                                       Sets the range (maximum value) of the gauge.
:meth:`~wx.Gauge.SetShadowWidth`                                                 Sets the 3D shadow width.
:meth:`~wx.Gauge.SetValue`                                                       Sets the position of the gauge.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.Gauge.BezelFace`                                                      See :meth:`~wx.Gauge.GetBezelFace` and :meth:`~wx.Gauge.SetBezelFace`
:attr:`~wx.Gauge.Range`                                                          See :meth:`~wx.Gauge.GetRange` and :meth:`~wx.Gauge.SetRange`
:attr:`~wx.Gauge.ShadowWidth`                                                    See :meth:`~wx.Gauge.GetShadowWidth` and :meth:`~wx.Gauge.SetShadowWidth`
:attr:`~wx.Gauge.Value`                                                          See :meth:`~wx.Gauge.GetValue` and :meth:`~wx.Gauge.SetValue`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: 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).



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      **~~~**

      
      **__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.                  
      
      
      
      
      :param `parent`: Window parent.   
      :type `parent`: wx.Window
      :param `id`: Window identifier.   
      :type `id`: wx.WindowID
      :param `range`: Integer range (maximum value) of the gauge. See :meth:`SetRange`   for more details about the meaning of this value when using the gauge in indeterminate mode.   
      :type `range`: int
      :param `pos`: Window position.   
      :type `pos`: wx.Point
      :param `size`: Window size.   
      :type `size`: wx.Size
      :param `style`: Gauge style.   
      :type `style`: long
      :param `validator`: Window validator.   
      :type `validator`: wx.Validator
      :param `name`: Window name.  
      :type `name`: string
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
                        
      
      
      
      .. seealso:: :meth:`Create`     
      
      
      
      
      
      
      
      **~~~**






   .. method:: 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 :ref:`wx.Gauge`  for further details.                  


      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `range`: 
      :type `range`: int
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `style`: 
      :type `style`: long
      :param `validator`: 
      :type `validator`: wx.Validator
      :param `name`: 
      :type `name`: string




      :rtype: `bool`








   .. method:: GetBezelFace(self)

      Returns the width of the 3D bezel face.                  

                

      :rtype: `int`







      .. note:: 

         This method is not implemented (returns 0) for most platforms.  







      .. seealso:: :meth:`SetBezelFace`     








   .. method:: GetRange(self)

      Returns the maximum position of the gauge.                  

                

      :rtype: `int`







      .. seealso:: :meth:`SetRange`     








   .. method:: GetShadowWidth(self)

      Returns the 3D shadow margin width.                  

                

      :rtype: `int`







      .. note:: 

         This method is not implemented (returns 0) for most platforms.  







      .. seealso:: :meth:`SetShadowWidth`     








   .. method:: GetValue(self)

      Returns the current position of the gauge.                  

                

      :rtype: `int`







      .. seealso:: :meth:`SetValue`     








   .. method:: IsVertical(self)

      Returns ``True`` if the gauge is vertical (has  ``GA_VERTICAL``   style) and ``False`` otherwise.                   

      :rtype: `bool`








   .. method:: 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.                  

                 



      .. note:: 

         After calling this function the value returned by :meth:`GetValue`   is undefined and thus you need to explicitly call :meth:`SetValue`   if you want to restore the determinate mode.   








   .. method:: SetBezelFace(self, width)

      Sets the 3D bezel face width.                  

                


      :param `width`: 
      :type `width`: int






      .. note:: 

         This method is not implemented (doesn't do anything) for most platforms.  







      .. seealso:: :meth:`GetBezelFace`     








   .. method:: 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. 

                


      :param `range`: 
      :type `range`: int






      .. seealso:: :meth:`GetRange`     








   .. method:: SetShadowWidth(self, width)

      Sets the 3D shadow width.                  

                


      :param `width`: 
      :type `width`: int






      .. note:: 

         This method is not implemented (doesn't do anything) for most platforms.   








   .. method:: SetValue(self, pos)

      Sets the position of the gauge.                  

      The `pos`  must be between 0 and the gauge range as returned by :meth:`GetRange` , inclusive. 

      This function makes the gauge switch to determinate mode, if it was in indeterminate mode before. 




      :param `pos`: Position for the gauge level.  
      :type `pos`: int




                  



      .. seealso:: :meth:`GetValue`     








   .. attribute:: BezelFace

      See :meth:`~wx.Gauge.GetBezelFace` and :meth:`~wx.Gauge.SetBezelFace`


   .. attribute:: Range

      See :meth:`~wx.Gauge.GetRange` and :meth:`~wx.Gauge.SetRange`


   .. attribute:: ShadowWidth

      See :meth:`~wx.Gauge.GetShadowWidth` and :meth:`~wx.Gauge.SetShadowWidth`


   .. attribute:: Value

      See :meth:`~wx.Gauge.GetValue` and :meth:`~wx.Gauge.SetValue`

