]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/radiobox.tex
add wxSYS_DCLICK_TIME system metric constant; use it for the generic list control...
[wxWidgets.git] / docs / latex / wx / radiobox.tex
... / ...
CommitLineData
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: radiobox.tex
3%% Purpose: wxRadioBox documentation
4%% Author: wxWidgets Team
5%% Modified by:
6%% Created:
7%% RCS-ID: $Id$
8%% Copyright: (c) wxWidgets Team
9%% License: wxWindows license
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxRadioBox}}\label{wxradiobox}
13
14A radio box item is used to select one of number of mutually exclusive
15choices. It is displayed as a vertical column or horizontal row of
16labelled buttons.
17
18\wxheading{Derived from}
19
20\helpref{wxControlWithItems}{wxcontrolwithitems}\\
21\helpref{wxControl}{wxcontrol}\\
22\helpref{wxWindow}{wxwindow}\\
23\helpref{wxEvtHandler}{wxevthandler}\\
24\helpref{wxObject}{wxobject}
25
26\wxheading{Include files}
27
28<wx/radiobox.h>
29
30\wxheading{Library}
31
32\helpref{wxCore}{librarieslist}
33
34\wxheading{Window styles}
35
36\twocolwidtha{5cm}
37\begin{twocollist}\itemsep=0pt
38\twocolitem{\windowstyle{wxRA\_SPECIFY\_ROWS}}{The major dimension parameter refers to the
39maximum number of rows.}
40\twocolitem{\windowstyle{wxRA\_SPECIFY\_COLS}}{The major dimension parameter refers to the
41maximum number of columns.}
42\twocolitem{\windowstyle{wxRA\_USE\_CHECKBOX}}{Use of the checkbox controls instead of radio
43buttons (currently supported only on PalmOS)}
44\end{twocollist}
45
46See also \helpref{window styles overview}{windowstyles}.
47
48\wxheading{Event handling}
49
50\twocolwidtha{7cm}
51\begin{twocollist}\itemsep=0pt
52\twocolitem{{\bf EVT\_RADIOBOX(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event,
53when a radiobutton is clicked.}
54\end{twocollist}
55
56\wxheading{See also}
57
58\helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxRadioButton}{wxradiobutton},\rtfsp
59\helpref{wxCheckBox}{wxcheckbox}
60
61\latexignore{\rtfignore{\wxheading{Members}}}
62
63
64\membersection{wxRadioBox::wxRadioBox}\label{wxradioboxctor}
65
66\func{}{wxRadioBox}{\void}
67
68Default constructor.
69
70\func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
71\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
72\param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
73\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
74\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
75\param{const wxString\& }{name = ``radioBox"}}
76
77\func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
78\param{const wxPoint\& }{point}, \param{const wxSize\& }{size},\rtfsp
79\param{const wxArrayString\&}{ choices},\rtfsp
80\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
81\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
82\param{const wxString\& }{name = ``radioBox"}}
83
84Constructor, creating and showing a radiobox.
85
86\wxheading{Parameters}
87
88\docparam{parent}{Parent window. Must not be NULL.}
89
90\docparam{id}{Window identifier. A value of -1 indicates a default value.}
91
92\docparam{label}{Label for the static box surrounding the radio buttons.}
93
94\docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
95
96\docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
97
98\docparam{n}{Number of choices with which to initialize the radiobox.}
99
100\docparam{choices}{An array of choices with which to initialize the radiobox.}
101
102\docparam{majorDimension}{Specifies the maximum number of rows (if style contains wxRA\_SPECIFY\_ROWS) or columns (if style contains wxRA\_SPECIFY\_COLS) for a two-dimensional
103radiobox.}
104
105\docparam{style}{Window style. See \helpref{wxRadioBox}{wxradiobox}.}
106
107\docparam{validator}{Window validator.}
108
109\docparam{name}{Window name.}
110
111\wxheading{See also}
112
113\helpref{wxRadioBox::Create}{wxradioboxcreate}, \helpref{wxValidator}{wxvalidator}
114
115\pythonnote{The wxRadioBox constructor in wxPython reduces the {\tt n}
116and {\tt choices} arguments are to a single argument, which is
117a list of strings.}
118
119\perlnote{In wxPerl there is just an array reference in place of {\tt n}
120and {\tt choices}.}
121
122
123\membersection{wxRadioBox::\destruct{wxRadioBox}}\label{wxradioboxdtor}
124
125\func{}{\destruct{wxRadioBox}}{\void}
126
127Destructor, destroying the radiobox item.
128
129
130\membersection{wxRadioBox::Create}\label{wxradioboxcreate}
131
132\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
133\param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
134\param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
135\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
136\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
137\param{const wxString\& }{name = ``radioBox"}}
138
139\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
140\param{const wxPoint\& }{point}, \param{const wxSize\& }{size},\rtfsp
141\param{const wxArrayString\&}{ choices},\rtfsp
142\param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
143\param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
144\param{const wxString\& }{name = ``radioBox"}}
145
146Creates the radiobox for two-step construction. See \helpref{wxRadioBox::wxRadioBox}{wxradioboxctor}\rtfsp
147for further details.
148
149
150\membersection{wxRadioBox::Enable}\label{wxradioboxenable}
151
152\func{virtual bool}{Enable}{\param{bool}{ enable = {\tt true}}}
153
154Enables or disables the entire radiobox.
155
156\func{virtual bool}{Enable}{\param{unsigned int}{ n}, \param{bool}{ enable = {\tt true}}}
157
158Enables or disables an individual button in the radiobox.
159
160\wxheading{Parameters}
161
162\docparam{enable}{true to enable, false to disable.}
163
164\docparam{n}{The zero-based button to enable or disable.}
165
166\pythonnote{In place of a single overloaded method name, wxPython
167implements the following methods:\par
168\indented{2cm}{\begin{twocollist}
169\twocolitem{{\bf Enable(flag)}}{Enables or disables the entire radiobox.}
170\twocolitem{{\bf EnableItem(n, flag)}}{Enables or disables an
171individual button in the radiobox.}
172\end{twocollist}}
173}
174
175\wxheading{See also}
176
177\helpref{wxWindow::Enable}{wxwindowenable}
178
179
180
181\membersection{wxRadioBox::FindString}\label{wxradioboxfindstring}
182
183\constfunc{int}{FindString}{\param{const wxString\& }{string}}
184
185Finds a button matching the given string, returning the position if found, or
186-1 if not found.
187
188\wxheading{Parameters}
189
190\docparam{string}{The string to find.}
191
192
193\membersection{wxRadioBox::GetColumnCount}\label{wxradioboxgetcolumncount}
194
195\constfunc{unsigned int}{GetColumnCount}{\void}
196
197Returns the number of columns in the radiobox.
198
199
200\membersection{wxRadioBox::GetItemHelpText}\label{wxradioboxgetitemhelptext}
201
202\constfunc{wxString}{GetItemHelpText}{\param{unsigned int}{ item}}
203
204Returns the helptext associated with the specified \arg{item} if any or {\tt wxEmptyString}.
205
206\wxheading{Parameters}
207
208\docparam{item}{The zero-based item index.}
209
210\wxheading{See also}
211
212\helpref{SetItemHelpText}{wxradioboxsetitemhelptext}
213
214
215\membersection{wxRadioBox::GetItemToolTip}\label{wxradioboxgetitemtooltip}
216
217\constfunc{wxToolTip *}{GetItemToolTip}{\param{unsigned int}{ item}}
218
219Returns the tooltip associated with the specified \arg{item} if any or \NULL.
220
221\wxheading{See also}
222
223\helpref{SetItemToolTip}{wxradioboxsetitemtooltip},\\
224\helpref{wxWindow::GetToolTip}{wxwindowgettooltip}
225
226
227\membersection{wxRadioBox::GetItemFromPoint}\label{wxradioboxgetitemfrompoint}
228
229\constfunc{int}{GetItemFromPoint}{\param{const wxPoint&}{ pt}}
230
231Returns a radio box item under the point, a zero-based item index, or {\tt wxNOT\_FOUND} if no item is under the point.
232
233\docparam{pt}{Point in client coordinates.}
234
235
236\membersection{wxRadioBox::GetLabel}\label{wxradioboxgetlabel}
237
238\constfunc{wxString}{GetLabel}{\void}
239
240Returns the radiobox label.
241
242\wxheading{Parameters}
243
244\docparam{n}{The zero-based button index.}
245
246\wxheading{See also}
247
248\helpref{wxRadioBox::SetLabel}{wxradioboxsetlabel}
249
250\pythonnote{In place of a single overloaded method name, wxPython
251implements the following methods:\par
252\indented{2cm}{\begin{twocollist}
253\twocolitem{{\bf GetLabel()}}{Returns the radiobox label.}
254\twocolitem{{\bf GetItemLabel(n)}}{Returns the label for the given button.}
255\end{twocollist}}
256}
257
258
259\membersection{wxRadioBox::GetRowCount}\label{wxradioboxgetrowcount}
260
261\constfunc{unsigned int}{GetRowCount}{\void}
262
263Returns the number of rows in the radiobox.
264
265
266\membersection{wxRadioBox::GetSelection}\label{wxradioboxgetselection}
267
268\constfunc{int}{GetSelection}{\void}
269
270Returns the zero-based position of the selected button.
271
272
273\membersection{wxRadioBox::GetStringSelection}\label{wxradioboxgetstringselection}
274
275\constfunc{wxString}{GetStringSelection}{\void}
276
277Returns the selected string.
278
279
280\membersection{wxRadioBox::GetString}\label{wxradioboxgetstring}
281
282\constfunc{wxString}{GetString}{\param{unsigned int}{ n}}
283
284Returns the label for the button at the given position.
285
286\wxheading{Parameters}
287
288\docparam{n}{The zero-based button position.}
289
290
291\membersection{wxRadioBox::IsItemEnabled}\label{wxradioboxisitemenabled}
292
293\constfunc{bool}{IsItemEnabled}{\param{unsigned int}{ n}}
294
295Returns \true if the item is enabled or \false if it was disabled using
296\helpref{Enable(n, false)}{wxradioboxenable}.
297
298{\bf Platform note:} Currently only implemented in wxMSW, wxGTK and wxUniversal
299and always returns \true in the other ports.
300
301\wxheading{Parameters}
302
303\docparam{n}{The zero-based button position.}
304
305
306\membersection{wxRadioBox::IsItemShown}\label{wxradioboxisitemshown}
307
308\constfunc{bool}{IsItemShown}{\param{unsigned int}{ n}}
309
310Returns \true if the item is currently shown or \false if it was hidden using
311\helpref{Show(n, false)}{wxradioboxshow}.
312
313Note that this function returns \true for an item which hadn't been hidden even
314if the entire radiobox is not currently shown.
315
316{\bf Platform note:} Currently only implemented in wxMSW, wxGTK and wxUniversal
317and always returns \true in the other ports.
318
319\wxheading{Parameters}
320
321\docparam{n}{The zero-based button position.}
322
323
324\membersection{wxRadioBox::SetItemHelpText}\label{wxradioboxsetitemhelptext}
325
326\func{void}{SetItemHelpText}{\param{unsigned int}{ item}, \param{const wxString\&}{ helptext}}
327
328Sets the helptext for an item. Empty string erases any existing helptext.
329
330\wxheading{Parameters}
331
332\docparam{item}{The zero-based item index.}
333
334\docparam{helptext}{The help text to set for the item.}
335
336\wxheading{See also}
337
338\helpref{GetItemHelpText}{wxradioboxgetitemhelptext}
339
340
341\membersection{wxRadioBox::SetLabel}\label{wxradioboxsetlabel}
342
343\func{void}{SetLabel}{\param{const wxString\&}{ label}}
344
345Sets the radiobox label.
346
347
348\wxheading{Parameters}
349
350\docparam{label}{The label to set.}
351
352\docparam{n}{The zero-based button index.}
353
354\pythonnote{In place of a single overloaded method name, wxPython
355implements the following methods:\par
356\indented{2cm}{\begin{twocollist}
357\twocolitem{{\bf SetLabel(string)}}{Sets the radiobox label.}
358\twocolitem{{\bf SetItemLabel(n, string)}}{Sets a label for a radio button.}
359\end{twocollist}}
360}
361
362
363\membersection{wxRadioBox::SetSelection}\label{wxradioboxsetselection}
364
365\func{void}{SetSelection}{\param{int}{ n}}
366
367Sets a button by passing the desired string position. This does not cause
368a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event to get emitted.
369
370\wxheading{Parameters}
371
372\docparam{n}{The zero-based button position.}
373
374
375\membersection{wxRadioBox::SetStringSelection}\label{wxradioboxsetstringselection}
376
377\func{void}{SetStringSelection}{\param{const wxString\& }{string}}
378
379Sets the selection to a button by passing the desired string. This does not cause
380a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event to get emitted.
381
382\wxheading{Parameters}
383
384\docparam{string}{The label of the button to select.}
385
386
387\membersection{wxRadioBox::SetItemToolTip}\label{wxradioboxsetitemtooltip}
388
389\func{void}{SetItemToolTip}{\param{unsigned int}{ item}, \param{const wxString\& }{text}}
390
391Sets the tooltip text for the specified item in the radio group.
392
393{\bf Platform note:} Currently only implemented in wxMSW and wxGTK2 and does
394nothing in the other ports.
395
396\wxheading{Parameters}
397
398\docparam{item}{Index of the item the tooltip will be shown for.}
399
400\docparam{text}{Tooltip text for the item, the tooltip is removed if empty.}
401
402\wxheading{See also}
403
404\helpref{GetItemToolTip}{wxradioboxgetitemtooltip},\\
405\helpref{wxWindow::SetToolTip}{wxwindowsettooltip}
406
407
408\membersection{wxRadioBox::Show}\label{wxradioboxshow}
409
410\func{virtual bool}{Show}{\param{const bool}{ show = {\tt true}}}
411
412Shows or hides the entire radiobox.
413
414\func{virtual bool}{Show}{\param{unsigned int}{ item}, \param{const bool}{ show = {\tt true}}}
415
416Shows or hides individual buttons.
417
418\wxheading{Parameters}
419
420\docparam{show}{true to show, false to hide.}
421
422\docparam{item}{The zero-based position of the button to show or hide.}
423
424\wxheading{Return value}
425
426{\tt true} if the box or item has been shown or hidden or {\tt false} if nothing was
427done because it already was in the requested state.
428
429\wxheading{See also}
430
431\helpref{wxWindow::Show}{wxwindowshow}
432
433\pythonnote{In place of a single overloaded method name, wxPython
434implements the following methods:\par
435\indented{2cm}{\begin{twocollist}
436\twocolitem{{\bf Show(flag)}}{Shows or hides the entire radiobox.}
437\twocolitem{{\bf ShowItem(n, flag)}}{Shows or hides individual buttons.}
438\end{twocollist}}
439}