]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{\class{wxSpinButton}}\label{wxspinbutton} |
2 | ||
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. | |
5 | ||
6 | \wxheading{Derived from} | |
7 | ||
8 | \helpref{wxControl}{wxcontrol}\\ | |
9 | \helpref{wxWindow}{wxwindow}\\ | |
10 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
11 | \helpref{wxObject}{wxobject} | |
12 | ||
13 | \wxheading{Window styles} | |
14 | ||
15 | \twocolwidtha{5cm} | |
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.} | |
21 | \end{twocollist} | |
22 | ||
23 | See also \helpref{window styles overview}{windowstyles}. | |
24 | ||
a660d684 KB |
25 | \wxheading{Event handling} |
26 | ||
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: | |
29 | ||
30 | \twocolwidtha{7cm} | |
31 | \begin{twocollist} | |
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).} | |
44 | \end{twocollist}% | |
45 | ||
46 | \wxheading{See also} | |
47 | ||
48 | \helpref{Event handling overview}{eventhandlingoverview} | |
49 | ||
50 | \latexignore{\rtfignore{\wxheading{Members}}} | |
51 | ||
52 | \membersection{wxSpinButton::wxSpinButton}\label{wxspinbuttonconstr} | |
53 | ||
54 | \func{}{wxSpinButton}{\void} | |
55 | ||
56 | Default constructor. | |
57 | ||
eaaa6a06 | 58 | \func{}{wxSpinButton}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp |
a660d684 | 59 | \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 60 | \param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp |
a660d684 KB |
61 | \param{const wxString\& }{name = ``spinButton"}} |
62 | ||
63 | Constructor, creating and showing a spin button. | |
64 | ||
65 | \wxheading{Parameters} | |
66 | ||
67 | \docparam{parent}{Parent window. Must not be NULL.} | |
68 | ||
69 | \docparam{id}{Window identifier. A value of -1 indicates a default value.} | |
70 | ||
71 | \docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.} | |
72 | ||
73 | \docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.} | |
74 | ||
75 | \docparam{style}{Window style. See \helpref{wxSpinButton}{wxspinbutton}.} | |
76 | ||
77 | \docparam{validator}{Window validator.} | |
78 | ||
79 | \docparam{name}{Window name.} | |
80 | ||
81 | \wxheading{See also} | |
82 | ||
83 | \helpref{wxSpinButton::Create}{wxspinbuttoncreate}, \helpref{wxValidator}{wxvalidator} | |
84 | ||
85 | \membersection{wxSpinButton::\destruct{wxSpinButton}} | |
86 | ||
87 | \func{void}{\destruct{wxSpinButton}}{\void} | |
88 | ||
89 | Destructor, destroying the spin button. | |
90 | ||
91 | \membersection{wxSpinButton::Create}\label{wxspinbuttoncreate} | |
92 | ||
eaaa6a06 | 93 | \func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp |
a660d684 | 94 | \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 95 | \param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp |
a660d684 KB |
96 | \param{const wxString\& }{name = ``spinButton"}} |
97 | ||
98 | Scrollbar creation function called by the spin button constructor. | |
99 | See \helpref{wxSpinButton::wxSpinButton}{wxspinbuttonconstr} for details. | |
100 | ||
101 | \membersection{wxSpinButton::GetMax}\label{wxspinbuttongetmax} | |
102 | ||
103 | \constfunc{int}{GetMax}{\void} | |
104 | ||
105 | Returns the maximum permissable value. | |
106 | ||
107 | \wxheading{See also} | |
108 | ||
109 | \helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange} | |
110 | ||
111 | \membersection{wxSpinButton::GetMin}\label{wxspinbuttongetmin} | |
112 | ||
113 | \constfunc{int}{GetMin}{\void} | |
114 | ||
115 | Returns the minimum permissable value. | |
116 | ||
117 | \wxheading{See also} | |
118 | ||
119 | \helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange} | |
120 | ||
121 | \membersection{wxSpinButton::GetValue}\label{wxspinbuttongetvalue} | |
122 | ||
123 | \constfunc{int}{GetValue}{\void} | |
124 | ||
125 | Returns the current spin button value. | |
126 | ||
127 | \wxheading{See also} | |
128 | ||
129 | \helpref{wxSpinButton::SetValue}{wxspinbuttonsetvalue} | |
130 | ||
131 | \membersection{wxSpinButton::SetRange}\label{wxspinbuttonsetrange} | |
132 | ||
eaaa6a06 | 133 | \func{void}{SetRange}{\param{int}{ min}, \param{int}{ max}} |
a660d684 KB |
134 | |
135 | Sets the range of the spin button. | |
136 | ||
137 | \wxheading{Parameters} | |
138 | ||
139 | \docparam{min}{The minimum value for the spin button.} | |
140 | ||
141 | \docparam{max}{The maximum value for the spin button.} | |
142 | ||
143 | \wxheading{See also} | |
144 | ||
145 | \helpref{wxSpinButton::GetMin}{wxspinbuttongetmin}, \helpref{wxSpinButton::GetMax}{wxspinbuttongetmax} | |
146 | ||
147 | \membersection{wxSpinButton::SetValue}\label{wxspinbuttonsetvalue} | |
148 | ||
eaaa6a06 | 149 | \func{void}{SetValue}{\param{int}{ value}} |
a660d684 KB |
150 | |
151 | Sets the value of the spin button. | |
152 | ||
153 | \wxheading{Parameters} | |
154 | ||
155 | \docparam{value}{The value for the spin button.} | |
156 | ||
157 | \wxheading{See also} | |
158 | ||
159 | \helpref{wxSpinButton::GetValue}{wxspinbuttongetvalue} | |
160 |