1 \section{\class{wxSpinButton
}}\label{wxspinbutton
}
3 A wxSpinButton has two small up and down (or left and right) arrow buttons. It is often
4 used next to a text control for increment and decrementing a value.
6 \wxheading{Derived from
}
8 \helpref{wxControl
}{wxcontrol
}\\
9 \helpref{wxWindow
}{wxwindow
}\\
10 \helpref{wxEvtHandler
}{wxevthandler
}\\
11 \helpref{wxObject
}{wxobject
}
13 \wxheading{Include files
}
17 \wxheading{Window styles
}
20 \begin{twocollist
}\itemsep=
0pt
21 \twocolitem{\windowstyle{wxSP
\_HORIZONTAL}}{Specifies a horizontal spin button.
}
22 \twocolitem{\windowstyle{wxSP
\_VERTICAL}}{Specifies a vertical spin button.
}
23 \twocolitem{\windowstyle{wxSP
\_ARROW\_KEYS}}{The user can use arrow keys.
}
24 \twocolitem{\windowstyle{wxSP
\_WRAP}}{The value wraps at the minimum and maximum.
}
27 See also
\helpref{window styles overview
}{windowstyles
}.
29 \wxheading{Event handling
}
31 To process input from a spin button, use one of these event handler macros to direct input to member
32 functions that take a
\helpref{wxScrollEvent
}{wxscrollevent
} argument:
36 \twocolitem{{\bf EVT
\_SPIN(id, func)
}}{Catch all scroll commands.
}
37 \twocolitem{{\bf EVT
\_SPIN\_UP(id, func)
}}{Catch up (or left) commands. Win32 only.
}
38 \twocolitem{{\bf EVT
\_SPIN\_DOWN(id, func)
}}{Catch down (or right) commands. Win32 only.
}
39 \twocolitem{{\bf EVT
\_COMMAND\_TOP(id, func)
}}{Catch a command to put the scroll thumb at the maximum position.
}
40 \twocolitem{{\bf EVT
\_COMMAND\_SCROLL(id, func)
}}{Catch all scroll commands.
}
41 \twocolitem{{\bf EVT
\_COMMAND\_TOP(id, func)
}}{Catch a command to put the scroll thumb at the maximum position.
}
42 \twocolitem{{\bf EVT
\_COMMAND\_BOTTOM(id, func)
}}{Catch a command to put the scroll thumb at the maximum position.
}
43 \twocolitem{{\bf EVT
\_COMMAND\_LINEUP(id, func)
}}{Catch a line up command.
}
44 \twocolitem{{\bf EVT
\_COMMAND\_LINEDOWN(id, func)
}}{Catch a line down command.
}
45 \twocolitem{{\bf EVT
\_COMMAND\_PAGEUP(id, func)
}}{Catch a page up command.
}
46 \twocolitem{{\bf EVT
\_COMMAND\_PAGEDOWN(id, func)
}}{Catch a page down command.
}
47 \twocolitem{{\bf EVT
\_COMMAND\_THUMBTRACK(id, func)
}}{Catch a thumbtrack command (continuous movement of the scroll thumb).
}
52 \helpref{Event handling overview
}{eventhandlingoverview
}
54 \latexignore{\rtfignore{\wxheading{Members
}}}
56 \membersection{wxSpinButton::wxSpinButton
}\label{wxspinbuttonconstr
}
58 \func{}{wxSpinButton
}{\void}
62 \func{}{wxSpinButton
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
63 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
64 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
65 \param{const wxString\&
}{name = ``spinButton"
}}
67 Constructor, creating and showing a spin button.
69 \wxheading{Parameters
}
71 \docparam{parent
}{Parent window. Must not be NULL.
}
73 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
75 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
77 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
79 \docparam{style
}{Window style. See
\helpref{wxSpinButton
}{wxspinbutton
}.
}
81 \docparam{validator
}{Window validator.
}
83 \docparam{name
}{Window name.
}
87 \helpref{wxSpinButton::Create
}{wxspinbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
89 \membersection{wxSpinButton::
\destruct{wxSpinButton
}}
91 \func{void
}{\destruct{wxSpinButton
}}{\void}
93 Destructor, destroying the spin button.
95 \membersection{wxSpinButton::Create
}\label{wxspinbuttoncreate
}
97 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
98 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
99 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
100 \param{const wxString\&
}{name = ``spinButton"
}}
102 Scrollbar creation function called by the spin button constructor.
103 See
\helpref{wxSpinButton::wxSpinButton
}{wxspinbuttonconstr
} for details.
105 \membersection{wxSpinButton::GetMax
}\label{wxspinbuttongetmax
}
107 \constfunc{int
}{GetMax
}{\void}
109 Returns the maximum permissable value.
113 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
115 \membersection{wxSpinButton::GetMin
}\label{wxspinbuttongetmin
}
117 \constfunc{int
}{GetMin
}{\void}
119 Returns the minimum permissable value.
123 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
125 \membersection{wxSpinButton::GetValue
}\label{wxspinbuttongetvalue
}
127 \constfunc{int
}{GetValue
}{\void}
129 Returns the current spin button value.
133 \helpref{wxSpinButton::SetValue
}{wxspinbuttonsetvalue
}
135 \membersection{wxSpinButton::SetRange
}\label{wxspinbuttonsetrange
}
137 \func{void
}{SetRange
}{\param{int
}{ min
},
\param{int
}{ max
}}
139 Sets the range of the spin button.
141 \wxheading{Parameters
}
143 \docparam{min
}{The minimum value for the spin button.
}
145 \docparam{max
}{The maximum value for the spin button.
}
149 \helpref{wxSpinButton::GetMin
}{wxspinbuttongetmin
},
\helpref{wxSpinButton::GetMax
}{wxspinbuttongetmax
}
151 \membersection{wxSpinButton::SetValue
}\label{wxspinbuttonsetvalue
}
153 \func{void
}{SetValue
}{\param{int
}{ value
}}
155 Sets the value of the spin button.
157 \wxheading{Parameters
}
159 \docparam{value
}{The value for the spin button.
}
163 \helpref{wxSpinButton::GetValue
}{wxspinbuttongetvalue
}