1 \section{\class{wxSpinButton
}}\label{wxspinbutton
}
3 A wxSpinButton has two small up and down (or left and right) arrow buttons. It
4 is often used next to a text control for increment and decrementing a value.
5 Portable programs should try to use
\helpref{wxSpinCtrl
}{wxspinctrl
} instead
6 as wxSpinButton is not implemented for all platforms (Win32 and GTK only
9 \wxheading{Derived from
}
11 \helpref{wxControl
}{wxcontrol
}\\
12 \helpref{wxWindow
}{wxwindow
}\\
13 \helpref{wxEvtHandler
}{wxevthandler
}\\
14 \helpref{wxObject
}{wxobject
}
18 \helpref{wxSpinCtrl
}{wxspinctrl
}
20 \wxheading{Include files
}
24 \wxheading{Window styles
}
27 \begin{twocollist
}\itemsep=
0pt
28 \twocolitem{\windowstyle{wxSP
\_HORIZONTAL}}{Specifies a horizontal spin button (note that this style is not supported in wxGTK).
}
29 \twocolitem{\windowstyle{wxSP
\_VERTICAL}}{Specifies a vertical spin button.
}
30 \twocolitem{\windowstyle{wxSP
\_ARROW\_KEYS}}{The user can use arrow keys.
}
31 \twocolitem{\windowstyle{wxSP
\_WRAP}}{The value wraps at the minimum and maximum.
}
34 See also
\helpref{window styles overview
}{windowstyles
}.
36 \wxheading{Event handling
}
38 To process input from a spin button, use one of these event handler macros to
39 direct input to member functions that take a
40 \helpref{wxSpinEvent
}{wxspinevent
} argument:
44 \twocolitem{{\bf EVT
\_SPIN(id, func)
}}{Generated whenever an arros is pressed.
}
45 \twocolitem{{\bf EVT
\_SPIN\_UP(id, func)
}}{Generated when left/up arrow is pressed.
}
46 \twocolitem{{\bf EVT
\_SPIN\_DOWN(id, func)
}}{Generated when right/down arrow is pressed.
}
51 \helpref{Event handling overview
}{eventhandlingoverview
}
53 \latexignore{\rtfignore{\wxheading{Members
}}}
55 \membersection{wxSpinButton::wxSpinButton
}\label{wxspinbuttonconstr
}
57 \func{}{wxSpinButton
}{\void}
61 \func{}{wxSpinButton
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
62 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
63 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
64 \param{const wxString\&
}{name = ``spinButton"
}}
66 Constructor, creating and showing a spin button.
68 \wxheading{Parameters
}
70 \docparam{parent
}{Parent window. Must not be NULL.
}
72 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
74 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
76 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
78 \docparam{style
}{Window style. See
\helpref{wxSpinButton
}{wxspinbutton
}.
}
80 \docparam{validator
}{Window validator.
}
82 \docparam{name
}{Window name.
}
86 \helpref{wxSpinButton::Create
}{wxspinbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
88 \membersection{wxSpinButton::
\destruct{wxSpinButton
}}
90 \func{void
}{\destruct{wxSpinButton
}}{\void}
92 Destructor, destroying the spin button.
94 \membersection{wxSpinButton::Create
}\label{wxspinbuttoncreate
}
96 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
97 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
98 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
99 \param{const wxString\&
}{name = ``spinButton"
}}
101 Scrollbar creation function called by the spin button constructor.
102 See
\helpref{wxSpinButton::wxSpinButton
}{wxspinbuttonconstr
} for details.
104 \membersection{wxSpinButton::GetMax
}\label{wxspinbuttongetmax
}
106 \constfunc{int
}{GetMax
}{\void}
108 Returns the maximum permissible value.
112 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
114 \membersection{wxSpinButton::GetMin
}\label{wxspinbuttongetmin
}
116 \constfunc{int
}{GetMin
}{\void}
118 Returns the minimum permissible value.
122 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
124 \membersection{wxSpinButton::GetValue
}\label{wxspinbuttongetvalue
}
126 \constfunc{int
}{GetValue
}{\void}
128 Returns the current spin button value.
132 \helpref{wxSpinButton::SetValue
}{wxspinbuttonsetvalue
}
134 \membersection{wxSpinButton::SetRange
}\label{wxspinbuttonsetrange
}
136 \func{void
}{SetRange
}{\param{int
}{ min
},
\param{int
}{ max
}}
138 Sets the range of the spin button.
140 \wxheading{Parameters
}
142 \docparam{min
}{The minimum value for the spin button.
}
144 \docparam{max
}{The maximum value for the spin button.
}
148 \helpref{wxSpinButton::GetMin
}{wxspinbuttongetmin
},
\helpref{wxSpinButton::GetMax
}{wxspinbuttongetmax
}
150 \membersection{wxSpinButton::SetValue
}\label{wxspinbuttonsetvalue
}
152 \func{void
}{SetValue
}{\param{int
}{ value
}}
154 Sets the value of the spin button.
156 \wxheading{Parameters
}
158 \docparam{value
}{The value for the spin button.
}
162 \helpref{wxSpinButton::GetValue
}{wxspinbuttongetvalue
}