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{Window styles
}
16 \begin{twocollist
}\itemsep=
0pt
17 \twocolitem{\windowstyle{wxSP
\_HORIZONTAL}}{Specifies a horizontal spin button.
}
18 \twocolitem{\windowstyle{wxSP
\_VERTICAL}}{Specifies a vertical spin button.
}
19 \twocolitem{\windowstyle{wxSP
\_ARROW\_KEYS}}{The user can use arrow keys.
}
20 \twocolitem{\windowstyle{wxSP
\_WRAP}}{The value wraps at the minimum and maximum.
}
23 See also
\helpref{window styles overview
}{windowstyles
}.
25 \wxheading{Event handling
}
27 To process input from a spin button, use one of these event handler macros to direct input to member
28 functions that take a
\helpref{wxScrollEvent
}{wxscrollevent
} argument:
32 \twocolitem{{\bf EVT
\_SPIN(id, func)
}}{Catch all scroll commands.
}
33 \twocolitem{{\bf EVT
\_SPIN\_UP(id, func)
}}{Catch up (or left) commands.
}
34 \twocolitem{{\bf EVT
\_SPIN\_DOWN(id, func)
}}{Catch down (or right) commands.
}
35 \twocolitem{{\bf EVT
\_COMMAND\_TOP(id, func)
}}{Catch a command to put the scroll thumb at the maximum position.
}
36 \twocolitem{{\bf EVT
\_COMMAND\_SCROLL(id, func)
}}{Catch all scroll commands.
}
37 \twocolitem{{\bf EVT
\_COMMAND\_TOP(id, func)
}}{Catch a command to put the scroll thumb at the maximum position.
}
38 \twocolitem{{\bf EVT
\_COMMAND\_BOTTOM(id, func)
}}{Catch a command to put the scroll thumb at the maximum position.
}
39 \twocolitem{{\bf EVT
\_COMMAND\_LINEUP(id, func)
}}{Catch a line up command.
}
40 \twocolitem{{\bf EVT
\_COMMAND\_LINEDOWN(id, func)
}}{Catch a line down command.
}
41 \twocolitem{{\bf EVT
\_COMMAND\_PAGEUP(id, func)
}}{Catch a page up command.
}
42 \twocolitem{{\bf EVT
\_COMMAND\_PAGEDOWN(id, func)
}}{Catch a page down command.
}
43 \twocolitem{{\bf EVT
\_COMMAND\_THUMBTRACK(id, func)
}}{Catch a thumbtrack command (continuous movement of the scroll thumb).
}
48 \helpref{Event handling overview
}{eventhandlingoverview
}
50 \latexignore{\rtfignore{\wxheading{Members
}}}
52 \membersection{wxSpinButton::wxSpinButton
}\label{wxspinbuttonconstr
}
54 \func{}{wxSpinButton
}{\void}
58 \func{}{wxSpinButton
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
59 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
60 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
61 \param{const wxString\&
}{name = ``spinButton"
}}
63 Constructor, creating and showing a spin button.
65 \wxheading{Parameters
}
67 \docparam{parent
}{Parent window. Must not be NULL.
}
69 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
71 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
73 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
75 \docparam{style
}{Window style. See
\helpref{wxSpinButton
}{wxspinbutton
}.
}
77 \docparam{validator
}{Window validator.
}
79 \docparam{name
}{Window name.
}
83 \helpref{wxSpinButton::Create
}{wxspinbuttoncreate
},
\helpref{wxValidator
}{wxvalidator
}
85 \membersection{wxSpinButton::
\destruct{wxSpinButton
}}
87 \func{void
}{\destruct{wxSpinButton
}}{\void}
89 Destructor, destroying the spin button.
91 \membersection{wxSpinButton::Create
}\label{wxspinbuttoncreate
}
93 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\rtfsp
94 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
95 \param{long
}{ style = wxSP
\_HORIZONTAL},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
96 \param{const wxString\&
}{name = ``spinButton"
}}
98 Scrollbar creation function called by the spin button constructor.
99 See
\helpref{wxSpinButton::wxSpinButton
}{wxspinbuttonconstr
} for details.
101 \membersection{wxSpinButton::GetMax
}\label{wxspinbuttongetmax
}
103 \constfunc{int
}{GetMax
}{\void}
105 Returns the maximum permissable value.
109 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
111 \membersection{wxSpinButton::GetMin
}\label{wxspinbuttongetmin
}
113 \constfunc{int
}{GetMin
}{\void}
115 Returns the minimum permissable value.
119 \helpref{wxSpinButton::SetRange
}{wxspinbuttonsetrange
}
121 \membersection{wxSpinButton::GetValue
}\label{wxspinbuttongetvalue
}
123 \constfunc{int
}{GetValue
}{\void}
125 Returns the current spin button value.
129 \helpref{wxSpinButton::SetValue
}{wxspinbuttonsetvalue
}
131 \membersection{wxSpinButton::SetRange
}\label{wxspinbuttonsetrange
}
133 \func{void
}{SetRange
}{\param{int
}{ min
},
\param{int
}{ max
}}
135 Sets the range of the spin button.
137 \wxheading{Parameters
}
139 \docparam{min
}{The minimum value for the spin button.
}
141 \docparam{max
}{The maximum value for the spin button.
}
145 \helpref{wxSpinButton::GetMin
}{wxspinbuttongetmin
},
\helpref{wxSpinButton::GetMax
}{wxspinbuttongetmax
}
147 \membersection{wxSpinButton::SetValue
}\label{wxspinbuttonsetvalue
}
149 \func{void
}{SetValue
}{\param{int
}{ value
}}
151 Sets the value of the spin button.
153 \wxheading{Parameters
}
155 \docparam{value
}{The value for the spin button.
}
159 \helpref{wxSpinButton::GetValue
}{wxspinbuttongetvalue
}