wx.SpinButton

Inheritance diagram for 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.

See also

wx.SpinCtrl

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


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Properties Summary

Class API

Methods

__init__(parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.SP_HORIZONTAL, name="spinButton")

Constructor, creating and showing a spin button.

Parameters:


Returns:

wx.SpinButton


GetMax()

Returns the maximum permissible value.


Returns:

int

See also

SetRange


GetMin()

Returns the minimum permissible value.


Returns:

int

See also

SetRange


GetValue()

Returns the current spin button value.


Returns:

int

See also

SetValue


IsVertical()
No docstrings available for this method.

SetMax(maxVal)

Parameters:

  • maxVal (int)

SetMin(minVal)

Parameters:

  • minVal (int)

SetRange(minVal, maxVal)

Sets the range of the spin button.

Parameters:

  • minVal (int)
  • maxVal (int)

See also

GetMin, GetMax


SetValue(val)

Sets the value of the spin button.

Parameters:

  • val (int)

See also

GetValue


Properties

Max
See GetMax and SetMax
Min
See GetMin and SetMin
Value
See GetValue and SetValue