File: wx190.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 (423 lines) | stat: -rw-r--r-- 11,458 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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
<HTML>
<head><title>wxRadioBox</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxradiobox"></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="wx189.htm#wxquerylayoutinfoevent"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx191.htm#wxradiobutton"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxRadioBox</H2>
<P>
A radio box item is used to select one of number of mutually exclusive
choices.  It is displayed as a vertical column or horizontal row of
labelled buttons.<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/radiobox.h&gt;<P>
<B><FONT COLOR="#FF0000">Window styles</FONT></B><P>


<TABLE>


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

<TD VALIGN=TOP>
The major dimension parameter refers to the
maximum number of rows.
</TD></TR>


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

<TD VALIGN=TOP>
The major dimension parameter refers to the
maximum number of columns.
</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>


<TABLE>


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

<TD VALIGN=TOP>
Process a wxEVT_COMMAND_RADIOBOX_SELECTED event,
when a radiobutton is clicked.
</TD></TR>


</TABLE>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx299.htm#eventhandlingoverview">Event handling overview</A>, <A HREF="wx191.htm#wxradiobutton">wxRadioButton</A>,
<A HREF="wx39.htm#wxcheckbox">wxCheckBox</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxradioboxconstr">wxRadioBox::wxRadioBox</A><BR>
<A HREF="#topic717">wxRadioBox::~wxRadioBox</A><BR>
<A HREF="#wxradioboxcreate">wxRadioBox::Create</A><BR>
<A HREF="#wxradioboxenable">wxRadioBox::Enable</A><BR>
<A HREF="#wxradioboxfindstring">wxRadioBox::FindString</A><BR>
<A HREF="#wxradioboxgetlabel">wxRadioBox::GetLabel</A><BR>
<A HREF="#wxradioboxgetselection">wxRadioBox::GetSelection</A><BR>
<A HREF="#wxradioboxgetstringselection">wxRadioBox::GetStringSelection</A><BR>
<A HREF="#wxradioboxnumber">wxRadioBox::Number</A><BR>
<A HREF="#wxradioboxsetlabel">wxRadioBox::SetLabel</A><BR>
<A HREF="#wxradioboxsetselection">wxRadioBox::SetSelection</A><BR>
<A HREF="#wxradioboxsetstringselection">wxRadioBox::SetStringSelection</A><BR>
<A HREF="#wxradioboxshow">wxRadioBox::Show</A><BR>
<A HREF="#wxradioboxgetstring">wxRadioBox::GetString</A><BR>
<P>

<HR>
<A NAME="wxradioboxconstr"></A>
<H3>wxRadioBox::wxRadioBox</H3>
<P>
<B></B> <B>wxRadioBox</B>()<P>
Default constructor.<P>
<B></B> <B>wxRadioBox</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>, <B>const wxString&amp; </B><I>label</I>,
<B>const wxPoint&amp; </B><I>point = wxDefaultPosition</I>, <B>const wxSize&amp; </B><I>size = wxDefaultSize</I>,
<B>int</B><I> n = 0</I>, <B>const wxString</B><I> choices[] = NULL</I>,
<B>int</B><I> majorDimension = 0</I>, <B>long</B><I> style = wxRA_SPECIFY_COLS</I>,
<B>const wxValidator&amp; </B><I>validator = wxDefaultValidator</I>,
<B>const wxString&amp; </B><I>name = "radioBox"</I>)<P>
Constructor, creating and showing a radiobox.<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>label</I><UL><UL>
Label for the static box surrounding the radio buttons.</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>n</I><UL><UL>
Number of choices with which to initialize the radiobox.</UL></UL>
<P>
<I>choices</I><UL><UL>
An array of choices with which to initialize the radiobox.</UL></UL>
<P>
<I>majorDimension</I><UL><UL>
Specifies the maximum number of rows (if style contains wxRA_SPECIFY_ROWS) or columns (if style contains wxRA_SPECIFY_COLS) for a two-dimensional
radiobox.</UL></UL>
<P>
<I>style</I><UL><UL>
Window style. See <A HREF="wx190.htm#wxradiobox">wxRadioBox</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="wx190.htm#wxradioboxcreate">wxRadioBox::Create</A>, <A HREF="wx255.htm#wxvalidator">wxValidator</A><P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
 The wxRadioBox constructor in wxPython reduces the <TT>n</TT>
and <TT>choices</TT> arguments are to a single argument, which is
a list of strings.<P>


<HR>
<A NAME="topic717"></A>
<H3>wxRadioBox::~wxRadioBox</H3>
<P>
<B></B> <B>~wxRadioBox</B>()<P>
Destructor, destroying the radiobox item.<P>

<HR>
<A NAME="wxradioboxcreate"></A>
<H3>wxRadioBox::Create</H3>
<P>
<B>bool</B> <B>Create</B>(<B>wxWindow* </B><I>parent</I>, <B>wxWindowID </B><I>id</I>, <B>const wxString&amp; </B><I>label</I>,
<B>const wxPoint&amp; </B><I>point = wxDefaultPosition</I>, <B>const wxSize&amp; </B><I>size = wxDefaultSize</I>,
<B>int</B><I> n = 0</I>, <B>const wxString</B><I> choices[] = NULL</I>,
<B>int</B><I> majorDimension = 0</I>, <B>long</B><I> style = wxRA_SPECIFY_COLS</I>,
<B>const wxValidator&amp; </B><I>validator = wxDefaultValidator</I>,
<B>const wxString&amp; </B><I>name = "radioBox"</I>)<P>
Creates the radiobox for two-step construction. See <A HREF="wx190.htm#wxradioboxconstr">wxRadioBox::wxRadioBox</A>
for further details.<P>

<HR>
<A NAME="wxradioboxenable"></A>
<H3>wxRadioBox::Enable</H3>
<P>
<B>void</B> <B>Enable</B>(<B>const bool</B><I> enable</I>)<P>
Enables or disables the entire radiobox.<P>
<B>void</B> <B>Enable</B>(<B>int</B><I> n</I>, <B>const bool</B><I> enable</I>)<P>
Enables or disables an individual button in the radiobox.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>enable</I><UL><UL>
TRUE to enable, FALSE to disable.</UL></UL>
<P>
<I>n</I><UL><UL>
The zero-based button to enable or disable.</UL></UL>
<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
 In place of a single overloaded method name, wxPython
implements the following methods:<P>

<UL><UL>

<TABLE>


<TR><TD VALIGN=TOP>
<B>Enable(flag)</B>
</TD>

<TD VALIGN=TOP>
Enables or disables the entire radiobox.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EnableItem(n, flag)</B>
</TD>

<TD VALIGN=TOP>
Enables or disables an
individual button in the radiobox.
</TD></TR>


</TABLE>
</UL></UL>

<P>


<HR>
<A NAME="wxradioboxfindstring"></A>
<H3>wxRadioBox::FindString</H3>
<P>
<B>int</B> <B>FindString</B>(<B>const wxString&amp; </B><I>string</I>) <B>const</B><P>
Finds a button matching the given string, returning the position if found, or
-1 if not found.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>string</I><UL><UL>
The string to find.</UL></UL>
<P>

<HR>
<A NAME="wxradioboxgetlabel"></A>
<H3>wxRadioBox::GetLabel</H3>
<P>
<B>wxString</B> <B>GetLabel</B>() <B>const</B><P>
Returns the radiobox label.<P>
<B>wxString</B> <B>GetLabel</B>(<B>int </B><I>n</I>) <B>const</B><P>
Returns the label for the given button.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>n</I><UL><UL>
The zero-based button index.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx190.htm#wxradioboxsetlabel">wxRadioBox::SetLabel</A><P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
 In place of a single overloaded method name, wxPython
implements the following methods:<P>

<UL><UL>

<TABLE>


<TR><TD VALIGN=TOP>
<B>GetLabel()</B>
</TD>

<TD VALIGN=TOP>
Returns the radiobox label.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>GetItemLabel(n)</B>
</TD>

<TD VALIGN=TOP>
Returns the label for the given button.
</TD></TR>


</TABLE>
</UL></UL>

<P>


<HR>
<A NAME="wxradioboxgetselection"></A>
<H3>wxRadioBox::GetSelection</H3>
<P>
<B>int</B> <B>GetSelection</B>() <B>const</B><P>
Returns the zero-based position of the selected button.<P>

<HR>
<A NAME="wxradioboxgetstringselection"></A>
<H3>wxRadioBox::GetStringSelection</H3>
<P>
<B>wxString</B> <B>GetStringSelection</B>() <B>const</B><P>
Returns the selected string.<P>

<HR>
<A NAME="wxradioboxnumber"></A>
<H3>wxRadioBox::Number</H3>
<P>
<B>int</B> <B>Number</B>() <B>const</B><P>
Returns the number of buttons in the radiobox.<P>

<HR>
<A NAME="wxradioboxsetlabel"></A>
<H3>wxRadioBox::SetLabel</H3>
<P>
<B>void</B> <B>SetLabel</B>(<B>const wxString&amp;</B><I> label</I>)<P>
Sets the radiobox label.<P>
<B>void</B> <B>SetLabel</B>(<B>int </B><I>n</I>, <B>const wxString&amp;</B><I> label</I>)<P>
Sets a label for a radio button.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>label</I><UL><UL>
The label to set.</UL></UL>
<P>
<I>n</I><UL><UL>
The zero-based button index.</UL></UL>
<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
 In place of a single overloaded method name, wxPython
implements the following methods:<P>

<UL><UL>

<TABLE>


<TR><TD VALIGN=TOP>
<B>SetLabel(string)</B>
</TD>

<TD VALIGN=TOP>
Sets the radiobox label.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>SetItemLabel(n, string)</B>
</TD>

<TD VALIGN=TOP>
Sets a label for a radio button.
</TD></TR>


</TABLE>
</UL></UL>

<P>

<HR>
<A NAME="wxradioboxsetselection"></A>
<H3>wxRadioBox::SetSelection</H3>
<P>
<B>void</B> <B>SetSelection</B>(<B>int</B><I> n</I>)<P>
Sets a button by passing the desired string position.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>n</I><UL><UL>
The zero-based button position.</UL></UL>
<P>

<HR>
<A NAME="wxradioboxsetstringselection"></A>
<H3>wxRadioBox::SetStringSelection</H3>
<P>
<B>void</B> <B>SetStringSelection</B>(<B>const wxString&amp; </B><I>string</I>)<P>
Sets a button by passing the desired string.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>string</I><UL><UL>
The label of the button to select.</UL></UL>
<P>

<HR>
<A NAME="wxradioboxshow"></A>
<H3>wxRadioBox::Show</H3>
<P>
<B>void</B> <B>Show</B>(<B>const bool</B><I> show</I>)<P>
Shows or hides the entire radiobox.<P>
<B>void</B> <B>Show</B>(<B>int </B><I>item</I>, <B>const bool</B><I> show</I>)<P>
Shows or hides individual buttons.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>show</I><UL><UL>
TRUE to show, FALSE to hide.</UL></UL>
<P>
<I>item</I><UL><UL>
The zero-based position of the button to show or hide.</UL></UL>
<P>
<B><FONT COLOR="#0000C8">wxPython note:</FONT></B><BR>
 In place of a single overloaded method name, wxPython
implements the following methods:<P>

<UL><UL>

<TABLE>


<TR><TD VALIGN=TOP>
<B>Show(flag)</B>
</TD>

<TD VALIGN=TOP>
Shows or hides the entire radiobox.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>ShowItem(n, flag)</B>
</TD>

<TD VALIGN=TOP>
Shows or hides individual buttons.
</TD></TR>


</TABLE>
</UL></UL>

<P>

<HR>
<A NAME="wxradioboxgetstring"></A>
<H3>wxRadioBox::GetString</H3>
<P>
<B>wxString</B> <B>GetString</B>(<B>int</B><I> n</I>) <B>const</B><P>
Returns the label for the button at the given position.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>n</I><UL><UL>
The zero-based button position.</UL></UL>
<P>


</BODY></HTML>