]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/spinbutt.tex
removed small as otherwise the code was apparently unreadable in HTML docs
[wxWidgets.git] / docs / latex / wx / spinbutt.tex
CommitLineData
a660d684
KB
1\section{\class{wxSpinButton}}\label{wxspinbutton}
2
f6bcfd97
BP
3A wxSpinButton has two small up and down (or left and right) arrow buttons. It
4is often used next to a text control for increment and decrementing a value.
5Portable programs should try to use \helpref{wxSpinCtrl}{wxspinctrl} instead
6as wxSpinButton is not implemented for all platforms (Win32 and GTK only
7currently).
a660d684 8
3ca6a5f0
BP
9{\bf NB:} the range supported by this control (and wxSpinCtrl) depends on the
10platform but is at least {\tt SHRT\_MIN} to {\tt SHRT\_MAX}.
11
a660d684
KB
12\wxheading{Derived from}
13
14\helpref{wxControl}{wxcontrol}\\
15\helpref{wxWindow}{wxwindow}\\
16\helpref{wxEvtHandler}{wxevthandler}\\
17\helpref{wxObject}{wxobject}
18
f6bcfd97
BP
19\wxheading{See also}
20
21\helpref{wxSpinCtrl}{wxspinctrl}
22
954b8ae6
JS
23\wxheading{Include files}
24
25<wx/spinbutt.h>
26
a660d684
KB
27\wxheading{Window styles}
28
29\twocolwidtha{5cm}
30\begin{twocollist}\itemsep=0pt
f6bcfd97 31\twocolitem{\windowstyle{wxSP\_HORIZONTAL}}{Specifies a horizontal spin button (note that this style is not supported in wxGTK).}
a660d684
KB
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.}
35\end{twocollist}
36
37See also \helpref{window styles overview}{windowstyles}.
38
a660d684
KB
39\wxheading{Event handling}
40
f6bcfd97
BP
41To process input from a spin button, use one of these event handler macros to
42direct input to member functions that take a
43\helpref{wxSpinEvent}{wxspinevent} argument:
a660d684
KB
44
45\twocolwidtha{7cm}
46\begin{twocollist}
f6bcfd97
BP
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.}
a660d684
KB
50\end{twocollist}%
51
52\wxheading{See also}
53
54\helpref{Event handling overview}{eventhandlingoverview}
55
56\latexignore{\rtfignore{\wxheading{Members}}}
57
58\membersection{wxSpinButton::wxSpinButton}\label{wxspinbuttonconstr}
59
60\func{}{wxSpinButton}{\void}
61
62Default constructor.
63
eaaa6a06 64\func{}{wxSpinButton}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp
a660d684 65\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 66\param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
a660d684
KB
67\param{const wxString\& }{name = ``spinButton"}}
68
69Constructor, creating and showing a spin button.
70
71\wxheading{Parameters}
72
73\docparam{parent}{Parent window. Must not be NULL.}
74
75\docparam{id}{Window identifier. A value of -1 indicates a default value.}
76
77\docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
78
79\docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
80
81\docparam{style}{Window style. See \helpref{wxSpinButton}{wxspinbutton}.}
82
83\docparam{validator}{Window validator.}
84
85\docparam{name}{Window name.}
86
87\wxheading{See also}
88
89\helpref{wxSpinButton::Create}{wxspinbuttoncreate}, \helpref{wxValidator}{wxvalidator}
90
91\membersection{wxSpinButton::\destruct{wxSpinButton}}
92
93\func{void}{\destruct{wxSpinButton}}{\void}
94
95Destructor, destroying the spin button.
96
97\membersection{wxSpinButton::Create}\label{wxspinbuttoncreate}
98
eaaa6a06 99\func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp
a660d684 100\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 101\param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
a660d684
KB
102\param{const wxString\& }{name = ``spinButton"}}
103
104Scrollbar creation function called by the spin button constructor.
105See \helpref{wxSpinButton::wxSpinButton}{wxspinbuttonconstr} for details.
106
107\membersection{wxSpinButton::GetMax}\label{wxspinbuttongetmax}
108
109\constfunc{int}{GetMax}{\void}
110
f6bcfd97 111Returns the maximum permissible value.
a660d684
KB
112
113\wxheading{See also}
114
115\helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange}
116
117\membersection{wxSpinButton::GetMin}\label{wxspinbuttongetmin}
118
119\constfunc{int}{GetMin}{\void}
120
f6bcfd97 121Returns the minimum permissible value.
a660d684
KB
122
123\wxheading{See also}
124
125\helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange}
126
127\membersection{wxSpinButton::GetValue}\label{wxspinbuttongetvalue}
128
129\constfunc{int}{GetValue}{\void}
130
131Returns the current spin button value.
132
133\wxheading{See also}
134
135\helpref{wxSpinButton::SetValue}{wxspinbuttonsetvalue}
136
137\membersection{wxSpinButton::SetRange}\label{wxspinbuttonsetrange}
138
eaaa6a06 139\func{void}{SetRange}{\param{int}{ min}, \param{int}{ max}}
a660d684
KB
140
141Sets the range of the spin button.
142
143\wxheading{Parameters}
144
145\docparam{min}{The minimum value for the spin button.}
146
147\docparam{max}{The maximum value for the spin button.}
148
149\wxheading{See also}
150
151\helpref{wxSpinButton::GetMin}{wxspinbuttongetmin}, \helpref{wxSpinButton::GetMax}{wxspinbuttongetmax}
152
153\membersection{wxSpinButton::SetValue}\label{wxspinbuttonsetvalue}
154
eaaa6a06 155\func{void}{SetValue}{\param{int}{ value}}
a660d684
KB
156
157Sets the value of the spin button.
158
159\wxheading{Parameters}
160
161\docparam{value}{The value for the spin button.}
162
163\wxheading{See also}
164
165\helpref{wxSpinButton::GetValue}{wxspinbuttongetvalue}
166