************* wx.SpinButton ************* Inheritance diagram for `wx.SpinButton`: | .. inheritance-diagram:: wx.SpinButton | Description =========== A `wx.SpinButton` has two small up and down (or left and right) arrow buttons. It is often used next to a text control for increment and decrementing a value. Portable programs should try to use `wx.SpinCtrl `_ instead as `wx.SpinButton` is not implemented for all platforms but `wx.SpinCtrl` is as it degenerates to a simple `wx.TextCtrl `_ on such platforms. .. note:: the range supported by this control (and `wx.SpinCtrl`) depends on the platform but is at least ``-0x8000`` to ``0x7fff``. Under GTK and Win32 with sufficiently new version of ``comctrl32.dll`` (at least 4.71 is required, 5.80 is recommended) the full 32 bit range is supported. .. seealso:: `wx.SpinCtrl `_ Derived From ^^^^^^^^^^^^^ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Window Styles ^^^^^^^^^^^^^ ================================================== ================================================== Window Style Description ================================================== ================================================== ``wx.SP_HORIZONTAL`` Specifies a horizontal spin button (note that this style is not supported in wxGTK). ``wx.SP_VERTICAL`` Specifies a vertical spin button. ``wx.SP_ARROW_KEYS`` The user can use arrow keys to change the value. ``wx.SP_WRAP`` The value wraps at the minimum and maximum. ================================================== ================================================== Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_SPIN(id, func) Generated whenever an arrow is pressed. wx.EVT_SPIN_UP(id, func) Generated when left/up arrow is pressed. wx.EVT_SPIN_DOWN(id, func) Generated when right/down arrow is pressed. ================================================== ================================================== .. note:: Note that if you handle both ``SPIN`` and ``UP`` or ``DOWN`` events, you will be notified about each of them twice: first the ``UP`` / ``DOWN`` event will be received and then, if it wasn't vetoed, the ``SPIN`` event will be sent | Control Appearance ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/spinbutton.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/spinbutton.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/spinbutton.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetMax <#GetMax>`_ * `GetMin <#GetMin>`_ * `GetValue <#GetValue>`_ * `IsVertical <#IsVertical>`_ * `SetMax <#SetMax>`_ * `SetMin <#SetMin>`_ * `SetRange <#SetRange>`_ * `SetValue <#SetValue>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Max <#Max>`_ * `Min <#Min>`_ * `Value <#Value>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.SP_HORIZONTAL, name="spinButton") Constructor, creating and showing a spin button. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `name` (string) | **Returns:** `wx.SpinButton `_ -------- .. method:: GetMax() Returns the maximum permissible value. | **Returns:** `int` .. seealso:: `SetRange <#SetRange>`_ -------- .. method:: GetMin() Returns the minimum permissible value. | **Returns:** `int` .. seealso:: `SetRange <#SetRange>`_ -------- .. method:: GetValue() Returns the current spin button value. | **Returns:** `int` .. seealso:: `SetValue <#SetValue>`_ -------- .. method:: IsVertical() `No docstrings available for this method.` -------- .. method:: SetMax(maxVal) | **Parameters:** * `maxVal` (int) -------- .. method:: SetMin(minVal) | **Parameters:** * `minVal` (int) -------- .. method:: SetRange(minVal, maxVal) Sets the range of the spin button. **Parameters:** * `minVal` (int) * `maxVal` (int) .. seealso:: `GetMin <#GetMin>`_, `GetMax <#GetMax>`_ -------- .. method:: SetValue(val) Sets the value of the spin button. **Parameters:** * `val` (int) .. seealso:: `GetValue <#GetValue>`_ -------- Properties ^^^^^^^^^^ .. attribute:: Max See `GetMax <#GetMax>`_ and `SetMax <#SetMax>`_ .. attribute:: Min See `GetMin <#GetMin>`_ and `SetMin <#SetMin>`_ .. attribute:: Value See `GetValue <#GetValue>`_ and `SetValue <#SetValue>`_