]>
Commit | Line | Data |
---|---|---|
03021f71 WS |
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 | |
8795498c | 9 | %% License: wxWindows license |
03021f71 WS |
10 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
11 | ||
a660d684 KB |
12 | \section{\class{wxRadioBox}}\label{wxradiobox} |
13 | ||
14 | A radio box item is used to select one of number of mutually exclusive | |
15 | choices. It is displayed as a vertical column or horizontal row of | |
16 | labelled buttons. | |
17 | ||
18 | \wxheading{Derived from} | |
19 | ||
20 | \helpref{wxControl}{wxcontrol}\\ | |
21 | \helpref{wxWindow}{wxwindow}\\ | |
22 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
23 | \helpref{wxObject}{wxobject} | |
24 | ||
954b8ae6 JS |
25 | \wxheading{Include files} |
26 | ||
27 | <wx/radiobox.h> | |
28 | ||
a660d684 KB |
29 | \wxheading{Window styles} |
30 | ||
31 | \twocolwidtha{5cm} | |
32 | \begin{twocollist}\itemsep=0pt | |
94b49b93 JS |
33 | \twocolitem{\windowstyle{wxRA\_SPECIFY\_ROWS}}{The major dimension parameter refers to the |
34 | maximum number of rows.} | |
35 | \twocolitem{\windowstyle{wxRA\_SPECIFY\_COLS}}{The major dimension parameter refers to the | |
36 | maximum number of columns.} | |
bcf576cc WS |
37 | \twocolitem{\windowstyle{wxRA\_USE\_CHECKBOX}}{Use of the checkbox controls instead of radio |
38 | buttons (currently supported only on PalmOS)} | |
a660d684 KB |
39 | \end{twocollist} |
40 | ||
41 | See also \helpref{window styles overview}{windowstyles}. | |
42 | ||
5de76427 JS |
43 | \wxheading{Event handling} |
44 | ||
45 | \twocolwidtha{7cm} | |
46 | \begin{twocollist}\itemsep=0pt | |
47 | \twocolitem{{\bf EVT\_RADIOBOX(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event, | |
48 | when a radiobutton is clicked.} | |
49 | \end{twocollist} | |
50 | ||
a660d684 KB |
51 | \wxheading{See also} |
52 | ||
53 | \helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxRadioButton}{wxradiobutton},\rtfsp | |
54 | \helpref{wxCheckBox}{wxcheckbox} | |
55 | ||
56 | \latexignore{\rtfignore{\wxheading{Members}}} | |
57 | ||
3e79fa75 | 58 | \membersection{wxRadioBox::wxRadioBox}\label{wxradioboxctor} |
a660d684 KB |
59 | |
60 | \func{}{wxRadioBox}{\void} | |
61 | ||
62 | Default constructor. | |
63 | ||
eaaa6a06 | 64 | \func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp |
a660d684 | 65 | \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 66 | \param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp |
94b49b93 | 67 | \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp |
a660d684 KB |
68 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp |
69 | \param{const wxString\& }{name = ``radioBox"}} | |
70 | ||
56b88f12 MB |
71 | \func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp |
72 | \param{const wxPoint\& }{point}, \param{const wxSize\& }{size},\rtfsp | |
73 | \param{const wxArrayString\&}{ choices},\rtfsp | |
74 | \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp | |
75 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp | |
76 | \param{const wxString\& }{name = ``radioBox"}} | |
77 | ||
a660d684 KB |
78 | Constructor, creating and showing a radiobox. |
79 | ||
80 | \wxheading{Parameters} | |
81 | ||
82 | \docparam{parent}{Parent window. Must not be NULL.} | |
83 | ||
84 | \docparam{id}{Window identifier. A value of -1 indicates a default value.} | |
85 | ||
86 | \docparam{label}{Label for the static box surrounding the radio buttons.} | |
87 | ||
88 | \docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.} | |
89 | ||
90 | \docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.} | |
91 | ||
92 | \docparam{n}{Number of choices with which to initialize the radiobox.} | |
93 | ||
94 | \docparam{choices}{An array of choices with which to initialize the radiobox.} | |
95 | ||
94b49b93 | 96 | \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 |
a660d684 KB |
97 | radiobox.} |
98 | ||
99 | \docparam{style}{Window style. See \helpref{wxRadioBox}{wxradiobox}.} | |
100 | ||
101 | \docparam{validator}{Window validator.} | |
102 | ||
103 | \docparam{name}{Window name.} | |
104 | ||
105 | \wxheading{See also} | |
106 | ||
107 | \helpref{wxRadioBox::Create}{wxradioboxcreate}, \helpref{wxValidator}{wxvalidator} | |
108 | ||
c9110876 VS |
109 | \pythonnote{The wxRadioBox constructor in wxPython reduces the {\tt n} |
110 | and {\tt choices} arguments are to a single argument, which is | |
06d20283 RD |
111 | a list of strings.} |
112 | ||
5873607e VZ |
113 | \perlnote{In wxPerl there is just an array reference in place of {\tt n} |
114 | and {\tt choices}.} | |
06d20283 | 115 | |
3e79fa75 | 116 | \membersection{wxRadioBox::\destruct{wxRadioBox}}\label{wxradioboxdtor} |
a660d684 KB |
117 | |
118 | \func{}{\destruct{wxRadioBox}}{\void} | |
119 | ||
120 | Destructor, destroying the radiobox item. | |
121 | ||
122 | \membersection{wxRadioBox::Create}\label{wxradioboxcreate} | |
123 | ||
eaaa6a06 | 124 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp |
a660d684 | 125 | \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp |
eaaa6a06 | 126 | \param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp |
94b49b93 | 127 | \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp |
a660d684 | 128 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp |
56b88f12 MB |
129 | \param{const wxString\& }{name = ``radioBox"}} |
130 | ||
131 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp | |
132 | \param{const wxPoint\& }{point}, \param{const wxSize\& }{size},\rtfsp | |
133 | \param{const wxArrayString\&}{ choices},\rtfsp | |
134 | \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp | |
135 | \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp | |
a660d684 KB |
136 | \param{const wxString\& }{name = ``radioBox"}} |
137 | ||
3e79fa75 | 138 | Creates the radiobox for two-step construction. See \helpref{wxRadioBox::wxRadioBox}{wxradioboxctor}\rtfsp |
a660d684 KB |
139 | for further details. |
140 | ||
141 | \membersection{wxRadioBox::Enable}\label{wxradioboxenable} | |
142 | ||
1a87edf2 | 143 | \func{virtual bool}{Enable}{\param{bool}{ enable = {\tt true}}} |
a660d684 KB |
144 | |
145 | Enables or disables the entire radiobox. | |
146 | ||
1a87edf2 | 147 | \func{virtual bool}{Enable}{\param{int}{ n}, \param{bool}{ enable = {\tt true}}} |
a660d684 KB |
148 | |
149 | Enables or disables an individual button in the radiobox. | |
150 | ||
151 | \wxheading{Parameters} | |
152 | ||
cc81d32f | 153 | \docparam{enable}{true to enable, false to disable.} |
a660d684 KB |
154 | |
155 | \docparam{n}{The zero-based button to enable or disable.} | |
156 | ||
21f280f4 RD |
157 | \pythonnote{In place of a single overloaded method name, wxPython |
158 | implements the following methods:\par | |
159 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
160 | \twocolitem{{\bf Enable(flag)}}{Enables or disables the entire radiobox.} |
161 | \twocolitem{{\bf EnableItem(n, flag)}}{Enables or disables an | |
21f280f4 RD |
162 | individual button in the radiobox.} |
163 | \end{twocollist}} | |
164 | } | |
165 | ||
1a87edf2 WS |
166 | \wxheading{See also} |
167 | ||
168 | \helpref{wxWindow::Enable}{wxwindowenable} | |
169 | ||
21f280f4 | 170 | |
a660d684 KB |
171 | \membersection{wxRadioBox::FindString}\label{wxradioboxfindstring} |
172 | ||
173 | \constfunc{int}{FindString}{\param{const wxString\& }{string}} | |
174 | ||
175 | Finds a button matching the given string, returning the position if found, or | |
176 | -1 if not found. | |
177 | ||
178 | \wxheading{Parameters} | |
179 | ||
180 | \docparam{string}{The string to find.} | |
181 | ||
28ca7610 VZ |
182 | \membersection{wxRadioBox::GetCount}\label{wxradioboxgetcount} |
183 | ||
184 | \constfunc{int}{GetCount}{\void} | |
185 | ||
186 | Returns the number of items in the radiobox. | |
187 | ||
a660d684 KB |
188 | \membersection{wxRadioBox::GetLabel}\label{wxradioboxgetlabel} |
189 | ||
190 | \constfunc{wxString}{GetLabel}{\void} | |
191 | ||
192 | Returns the radiobox label. | |
193 | ||
a660d684 KB |
194 | \wxheading{Parameters} |
195 | ||
196 | \docparam{n}{The zero-based button index.} | |
197 | ||
198 | \wxheading{See also} | |
199 | ||
200 | \helpref{wxRadioBox::SetLabel}{wxradioboxsetlabel} | |
201 | ||
21f280f4 RD |
202 | \pythonnote{In place of a single overloaded method name, wxPython |
203 | implements the following methods:\par | |
204 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
205 | \twocolitem{{\bf GetLabel()}}{Returns the radiobox label.} |
206 | \twocolitem{{\bf GetItemLabel(n)}}{Returns the label for the given button.} | |
21f280f4 RD |
207 | \end{twocollist}} |
208 | } | |
209 | ||
210 | ||
a660d684 KB |
211 | \membersection{wxRadioBox::GetSelection}\label{wxradioboxgetselection} |
212 | ||
213 | \constfunc{int}{GetSelection}{\void} | |
214 | ||
215 | Returns the zero-based position of the selected button. | |
216 | ||
217 | \membersection{wxRadioBox::GetStringSelection}\label{wxradioboxgetstringselection} | |
218 | ||
219 | \constfunc{wxString}{GetStringSelection}{\void} | |
220 | ||
221 | Returns the selected string. | |
222 | ||
d61c1a6f JS |
223 | \membersection{wxRadioBox::GetString}\label{wxradioboxgetstring} |
224 | ||
225 | \constfunc{wxString}{GetString}{\param{int}{ n}} | |
226 | ||
227 | Returns the label for the button at the given position. | |
228 | ||
229 | \wxheading{Parameters} | |
230 | ||
231 | \docparam{n}{The zero-based button position.} | |
232 | ||
a660d684 KB |
233 | \membersection{wxRadioBox::Number}\label{wxradioboxnumber} |
234 | ||
235 | \constfunc{int}{Number}{\void} | |
236 | ||
bcf576cc | 237 | {\bf Obsolescence note:} This method is obsolete and was replaced with |
e676441f | 238 | \helpref{GetCount}{wxradioboxgetcount}, please use the new method in the new |
bcf576cc | 239 | code. This method is only available if wxWidgets was compiled with |
28ca7610 VZ |
240 | {\tt WXWIN\_COMPATIBILITY\_2\_2} defined and will disappear completely in |
241 | future versions. | |
242 | ||
a660d684 KB |
243 | Returns the number of buttons in the radiobox. |
244 | ||
245 | \membersection{wxRadioBox::SetLabel}\label{wxradioboxsetlabel} | |
246 | ||
247 | \func{void}{SetLabel}{\param{const wxString\&}{ label}} | |
248 | ||
249 | Sets the radiobox label. | |
250 | ||
a660d684 KB |
251 | |
252 | \wxheading{Parameters} | |
253 | ||
254 | \docparam{label}{The label to set.} | |
255 | ||
256 | \docparam{n}{The zero-based button index.} | |
257 | ||
21f280f4 RD |
258 | \pythonnote{In place of a single overloaded method name, wxPython |
259 | implements the following methods:\par | |
260 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
261 | \twocolitem{{\bf SetLabel(string)}}{Sets the radiobox label.} |
262 | \twocolitem{{\bf SetItemLabel(n, string)}}{Sets a label for a radio button.} | |
21f280f4 RD |
263 | \end{twocollist}} |
264 | } | |
265 | ||
a660d684 KB |
266 | \membersection{wxRadioBox::SetSelection}\label{wxradioboxsetselection} |
267 | ||
eaaa6a06 | 268 | \func{void}{SetSelection}{\param{int}{ n}} |
a660d684 | 269 | |
953704c1 RR |
270 | Sets a button by passing the desired string position. This does not cause |
271 | a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event to get emitted. | |
a660d684 KB |
272 | |
273 | \wxheading{Parameters} | |
274 | ||
275 | \docparam{n}{The zero-based button position.} | |
276 | ||
277 | \membersection{wxRadioBox::SetStringSelection}\label{wxradioboxsetstringselection} | |
278 | ||
279 | \func{void}{SetStringSelection}{\param{const wxString\& }{string}} | |
280 | ||
953704c1 RR |
281 | Sets the selection to a button by passing the desired string. This does not cause |
282 | a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event to get emitted. | |
a660d684 KB |
283 | |
284 | \wxheading{Parameters} | |
285 | ||
286 | \docparam{string}{The label of the button to select.} | |
287 | ||
288 | \membersection{wxRadioBox::Show}\label{wxradioboxshow} | |
289 | ||
03021f71 | 290 | \func{virtual bool}{Show}{\param{const bool}{ show = {\tt true}}} |
a660d684 KB |
291 | |
292 | Shows or hides the entire radiobox. | |
293 | ||
03021f71 | 294 | \func{virtual bool}{Show}{\param{int}{ item}, \param{const bool}{ show = {\tt true}}} |
a660d684 KB |
295 | |
296 | Shows or hides individual buttons. | |
297 | ||
298 | \wxheading{Parameters} | |
299 | ||
cc81d32f | 300 | \docparam{show}{true to show, false to hide.} |
a660d684 KB |
301 | |
302 | \docparam{item}{The zero-based position of the button to show or hide.} | |
303 | ||
03021f71 WS |
304 | \wxheading{Return value} |
305 | ||
306 | {\tt true} if the box or item has been shown or hidden or {\tt false} if nothing was | |
307 | done because it already was in the requested state. | |
308 | ||
309 | \wxheading{See also} | |
310 | ||
311 | \helpref{wxWindow::Show}{wxwindowshow} | |
312 | ||
21f280f4 RD |
313 | \pythonnote{In place of a single overloaded method name, wxPython |
314 | implements the following methods:\par | |
315 | \indented{2cm}{\begin{twocollist} | |
c9110876 VS |
316 | \twocolitem{{\bf Show(flag)}}{Shows or hides the entire radiobox.} |
317 | \twocolitem{{\bf ShowItem(n, flag)}}{Shows or hides individual buttons.} | |
21f280f4 RD |
318 | \end{twocollist}} |
319 | } |