back to gui
wxSpinButton
generated from ../src/mod_gui/control/spinbtn.cpp
A wxSpinButton 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 wxSpinButton instead as
wxSpinButton is not implemented for all platforms but wxSpinButton is as it
degenerates to a simple wxTextCtrl on such platforms.
Constants
styles
| Name |
Description |
| ARROW_KEYS |
|
| WRAP |
|
| HORIZONTAL |
|
| VERTICAL |
|
Constructor
wxSpinButton
wxSpinButton()
wxSpinButton(parent,
id,
pos = wxDefaultPosition,
size = wxDefaultSize,
style = wxSpinButton.ARROW_KEYS)
| Name |
Type |
Default |
Description |
| parent |
wxWindow |
|
Parent window. Must not be NULL.
|
| id |
Integer |
|
Window identifier. A value of -1 indicates a default value.
|
| pos |
wxPoint |
wxDefaultPosition |
Window position.
|
| size |
wxSize |
wxDefaultSize |
Window size.
|
| style |
Integer |
wxSpinButton.ARROW_KEYS |
Window style.
|
Create a wxSpinButton
Properties
| Name |
Type |
Description |
max  |
Integer |
Gets maximal allowable value.
|
min  |
Integer |
Gets minimal allowable value.
|
| value |
String |
The value of the spin control.
|
Methods
create
create(parent,
id,
pos = wxDefaultPosition,
size = wxDefaultSize,
style = wxSpinButton.HORIZONTAL) : Boolean
| Name |
Type |
Default |
Description |
| parent |
wxWindow |
|
Parent window. Must not be NULL.
|
| id |
Integer |
|
Window identifier. A value of -1 indicates a default value.
|
| pos |
wxPoint |
wxDefaultPosition |
Window position.
|
| size |
wxSize |
wxDefaultSize |
Window size.
|
| style |
Integer |
wxSpinButton.HORIZONTAL |
Window style.
|
Create a wxSpinButton
setRange
setRange(Min,
Max)
| Name |
Type |
Default |
Description |
| Min |
Integer |
|
|
| Max |
Integer |
|
|
Sets range of allowable values.
Events
| onSpin |
Generated whenever an arrow is pressed. A wxSpinEvent is passed
as argument.
|
| onSpinUp |
Generated when left/up arrow is pressed. A wxSpinEvent is passed
as argument.
|
| onSpinDown |
Generated when right/down arrow is pressed. A wxSpinEvent is passed
as argument.
|