File: wx216.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (307 lines) | stat: -rw-r--r-- 8,060 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<HTML>
<head><title>wxSpinButton</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxspinbutton"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx215.htm#wxsocketoutputstream"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx217.htm#wxsplitterwindow"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxSpinButton</H2>
<P>
A wxSpinButton has two small up and down (or left and right) arrow buttons. It is often
used next to a text control for increment and decrementing a value.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx56.htm#wxcontrol">wxControl</A><BR>

<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>

<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>

<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/spinbutt.h&gt;<P>
<B><FONT COLOR="#FF0000">Window styles</FONT></B><P>


<TABLE>


<TR><TD VALIGN=TOP>
<B>wxSP_HORIZONTAL</B>
</TD>

<TD VALIGN=TOP>
Specifies a horizontal spin button.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxSP_VERTICAL</B>
</TD>

<TD VALIGN=TOP>
Specifies a vertical spin button.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxSP_ARROW_KEYS</B>
</TD>

<TD VALIGN=TOP>
The user can use arrow keys.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxSP_WRAP</B>
</TD>

<TD VALIGN=TOP>
The value wraps at the minimum and maximum.
</TD></TR>


</TABLE>
<P>
See also <A HREF="wx305.htm#windowstyles">window styles overview</A>.<P>
<B><FONT COLOR="#FF0000">Event handling</FONT></B><P>
To process input from a spin button, use one of these event handler macros to direct input to member
functions that take a <A HREF="wx202.htm#wxscrollevent">wxScrollEvent</A> argument:<P>


<TABLE>


<TR><TD VALIGN=TOP>
<B>EVT_SPIN(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch all scroll commands.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_SPIN_UP(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch up (or left) commands.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_SPIN_DOWN(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch down (or right) commands.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_TOP(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a command to put the scroll thumb at the maximum position.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_SCROLL(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch all scroll commands.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_TOP(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a command to put the scroll thumb at the maximum position.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_BOTTOM(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a command to put the scroll thumb at the maximum position.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_LINEUP(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a line up command.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_LINEDOWN(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a line down command.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_PAGEUP(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a page up command.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_PAGEDOWN(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a page down command.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_COMMAND_THUMBTRACK(id, func)</B>
</TD>

<TD VALIGN=TOP>
Catch a thumbtrack command (continuous movement of the scroll thumb).
</TD></TR>


</TABLE>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx299.htm#eventhandlingoverview">Event handling overview</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxspinbuttonconstr">wxSpinButton::wxSpinButton</A><BR>
<A HREF="#topic843">wxSpinButton::~wxSpinButton</A><BR>
<A HREF="#wxspinbuttoncreate">wxSpinButton::Create</A><BR>
<A HREF="#wxspinbuttongetmax">wxSpinButton::GetMax</A><BR>
<A HREF="#wxspinbuttongetmin">wxSpinButton::GetMin</A><BR>
<A HREF="#wxspinbuttongetvalue">wxSpinButton::GetValue</A><BR>
<A HREF="#wxspinbuttonsetrange">wxSpinButton::SetRange</A><BR>
<A HREF="#wxspinbuttonsetvalue">wxSpinButton::SetValue</A><BR>
<P>

<HR>
<A NAME="wxspinbuttonconstr"></A>
<H3>wxSpinButton::wxSpinButton</H3>
<P>
<B></B> <B>wxSpinButton</B>()<P>
Default constructor.<P>
<B></B> <B>wxSpinButton</B>(<B>wxWindow*</B><I> parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxPoint&amp; </B><I>pos = wxDefaultPosition</I>, <B>const wxSize&amp; </B><I>size = wxDefaultSize</I>,
<B>long</B><I> style = wxSP_HORIZONTAL</I>, <B>const wxValidator&amp; </B><I>validator = wxDefaultValidator</I>,
<B>const wxString&amp; </B><I>name = "spinButton"</I>)<P>
Constructor, creating and showing a spin button.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>parent</I><UL><UL>
Parent window. Must not be NULL.</UL></UL>
<P>
<I>id</I><UL><UL>
Window identifier. A value of -1 indicates a default value.</UL></UL>
<P>
<I>pos</I><UL><UL>
Window position. If the position (-1, -1) is specified then a default position is chosen.</UL></UL>
<P>
<I>size</I><UL><UL>
Window size. If the default size (-1, -1) is specified then a default size is chosen.</UL></UL>
<P>
<I>style</I><UL><UL>
Window style. See <A HREF="wx216.htm#wxspinbutton">wxSpinButton</A>.</UL></UL>
<P>
<I>validator</I><UL><UL>
Window validator.</UL></UL>
<P>
<I>name</I><UL><UL>
Window name.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx216.htm#wxspinbuttoncreate">wxSpinButton::Create</A>, <A HREF="wx255.htm#wxvalidator">wxValidator</A><P>

<HR>
<A NAME="topic843"></A>
<H3>wxSpinButton::~wxSpinButton</H3>
<P>
<B>void</B> <B>~wxSpinButton</B>()<P>
Destructor, destroying the spin button.<P>

<HR>
<A NAME="wxspinbuttoncreate"></A>
<H3>wxSpinButton::Create</H3>
<P>
<B>bool</B> <B>Create</B>(<B>wxWindow*</B><I> parent</I>, <B>wxWindowID </B><I>id</I>,
<B>const wxPoint&amp; </B><I>pos = wxDefaultPosition</I>, <B>const wxSize&amp; </B><I>size = wxDefaultSize</I>,
<B>long</B><I> style = wxSP_HORIZONTAL</I>, <B>const wxValidator&amp; </B><I>validator = wxDefaultValidator</I>,
<B>const wxString&amp; </B><I>name = "spinButton"</I>)<P>
Scrollbar creation function called by the spin button constructor.
See <A HREF="wx216.htm#wxspinbuttonconstr">wxSpinButton::wxSpinButton</A> for details.<P>

<HR>
<A NAME="wxspinbuttongetmax"></A>
<H3>wxSpinButton::GetMax</H3>
<P>
<B>int</B> <B>GetMax</B>() <B>const</B><P>
Returns the maximum permissable value.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx216.htm#wxspinbuttonsetrange">wxSpinButton::SetRange</A><P>

<HR>
<A NAME="wxspinbuttongetmin"></A>
<H3>wxSpinButton::GetMin</H3>
<P>
<B>int</B> <B>GetMin</B>() <B>const</B><P>
Returns the minimum permissable value.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx216.htm#wxspinbuttonsetrange">wxSpinButton::SetRange</A><P>

<HR>
<A NAME="wxspinbuttongetvalue"></A>
<H3>wxSpinButton::GetValue</H3>
<P>
<B>int</B> <B>GetValue</B>() <B>const</B><P>
Returns the current spin button value.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx216.htm#wxspinbuttonsetvalue">wxSpinButton::SetValue</A><P>

<HR>
<A NAME="wxspinbuttonsetrange"></A>
<H3>wxSpinButton::SetRange</H3>
<P>
<B>void</B> <B>SetRange</B>(<B>int</B><I> min</I>, <B>int</B><I> max</I>)<P>
Sets the range of the spin button.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>min</I><UL><UL>
The minimum value for the spin button.</UL></UL>
<P>
<I>max</I><UL><UL>
The maximum value for the spin button.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx216.htm#wxspinbuttongetmin">wxSpinButton::GetMin</A>, <A HREF="wx216.htm#wxspinbuttongetmax">wxSpinButton::GetMax</A><P>

<HR>
<A NAME="wxspinbuttonsetvalue"></A>
<H3>wxSpinButton::SetValue</H3>
<P>
<B>void</B> <B>SetValue</B>(<B>int</B><I> value</I>)<P>
Sets the value of the spin button.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>value</I><UL><UL>
The value for the spin button.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx216.htm#wxspinbuttongetvalue">wxSpinButton::GetValue</A><P>

</BODY></HTML>