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 {\bf NB:
} the range supported by this control (and wxSpinCtrl) depends on the
10 platform but is at least
{\tt SHRT
\_MIN} to
{\tt SHRT
\_MAX}.
12 \wxheading{Derived from
}
14 \helpref{wxControl
}{wxcontrol
}\\
15 \helpref{wxWindow
}{wxwindow
}\\
16 \helpref{wxEvtHandler
}{wxevthandler
}\\
17 \helpref{wxObject
}{wxobject
}
21 \helpref{wxSpinCtrl
}{wxspinctrl
}
23 \wxheading{Include files
}
27 \wxheading{Window styles
}
30 \begin{twocollist
}\itemsep=
0pt
31 \twocolitem{\windowstyle{wxSP
\_HORIZONTAL}}{Specifies a horizontal spin button (note that this style is not supported in wxGTK).
}
32 \twocolitem{\windowstyle{wxSP
\_VERTICAL}}{Specifies a vertical spin button.
}
33 \twocolitem{\windowstyle{wxSP
\_ARROW\_KEYS}}{The user can use arrow keys.
}
34 \twocolitem{\windowstyle{wxSP
\_WRAP}}{The value wraps at the minimum and maximum.
}
37 See also
\helpref{window styles overview
}{windowstyles
}.
39 \wxheading{Event handling
}
41 To process input from a spin button, use one of these event handler macros to
42 direct input to member functions that take a
43 \helpref{wxSpinEvent
}{wxspinevent
} argument:
47 \twocolitem{{\bf EVT
\_SPIN(id, func)
}}{Generated whenever an arros is pressed.
}
48 \twocolitem{{\bf EVT
\_SPIN\_UP(id, func)
}}{Generated when left/up arrow is pressed.
}
49 \twocolitem{{\bf EVT
\_SPIN\_DOWN(id, func)
}}{Generated when right/down arrow is pressed.
}
54 \helpref{Event handling overview
}{eventhandlingoverview
}
56 \latexignore{\rtfignore{\wxheading{Members
}}}
58 \membersection{wxSpinButton::wxSpinButton
}\label{wxspinbuttonconstr
}
60 \func{}{wxSpinButton
}{\void}
64 \func{}{wxSpinButton
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
65 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
66 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
67 \param{const wxString\&
}{name = ``spinButton"
}}
69 Constructor, creating and showing a spin button.
71 \wxheading{Parameters
}
73 \docparam{parent
}{Parent window. Must not be NULL.
}
75 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
77 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
79 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
81 \docparam{style
}{Window style. See
\helpref{wxSpinButton
}{wxspinbutton
}.
}
83 \docparam{validator
}{Window validator.
}
85 \docparam{name
}{Window name.
}
89 \helpref{wxSpinButton::Create
}{wxspinbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
91 \membersection{wxSpinButton::
\destruct{wxSpinButton
}}
93 \func{void
}{\destruct{wxSpinButton
}}{\void}
95 Destructor, destroying the spin button.
97 \membersection{wxSpinButton::Create
}\label{wxspinbuttoncreate
}
99 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
100 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
101 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
102 \param{const wxString\&
}{name = ``spinButton"
}}
104 Scrollbar creation function called by the spin button constructor.
105 See
\helpref{wxSpinButton::wxSpinButton
}{wxspinbuttonconstr
} for details.
107 \membersection{wxSpinButton::GetMax
}\label{wxspinbuttongetmax
}
109 \constfunc{int
}{GetMax
}{\void}
111 Returns the maximum permissible value.
115 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
117 \membersection{wxSpinButton::GetMin
}\label{wxspinbuttongetmin
}
119 \constfunc{int
}{GetMin
}{\void}
121 Returns the minimum permissible value.
125 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
127 \membersection{wxSpinButton::GetValue
}\label{wxspinbuttongetvalue
}
129 \constfunc{int
}{GetValue
}{\void}
131 Returns the current spin button value.
135 \helpref{wxSpinButton::SetValue
}{wxspinbuttonsetvalue
}
137 \membersection{wxSpinButton::SetRange
}\label{wxspinbuttonsetrange
}
139 \func{void
}{SetRange
}{\param{int
}{ min
},
\param{int
}{ max
}}
141 Sets the range of the spin button.
143 \wxheading{Parameters
}
145 \docparam{min
}{The minimum value for the spin button.
}
147 \docparam{max
}{The maximum value for the spin button.
}
151 \helpref{wxSpinButton::GetMin
}{wxspinbuttongetmin
},
\helpref{wxSpinButton::GetMax
}{wxspinbuttongetmax
}
153 \membersection{wxSpinButton::SetValue
}\label{wxspinbuttonsetvalue
}
155 \func{void
}{SetValue
}{\param{int
}{ value
}}
157 Sets the value of the spin button.
159 \wxheading{Parameters
}
161 \docparam{value
}{The value for the spin button.
}
165 \helpref{wxSpinButton::GetValue
}{wxspinbuttongetvalue
}