]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/radiobox.tex
docs for wxTextDataObjet and wxBitmapDataObject
[wxWidgets.git] / docs / latex / wx / radiobox.tex
1 \section{\class{wxRadioBox}}\label{wxradiobox}
2
3 A radio box item is used to select one of number of mutually exclusive
4 choices. It is displayed as a vertical column or horizontal row of
5 labelled buttons.
6
7 \wxheading{Derived from}
8
9 \helpref{wxControl}{wxcontrol}\\
10 \helpref{wxWindow}{wxwindow}\\
11 \helpref{wxEvtHandler}{wxevthandler}\\
12 \helpref{wxObject}{wxobject}
13
14 \wxheading{Window styles}
15
16 \twocolwidtha{5cm}
17 \begin{twocollist}\itemsep=0pt
18 \twocolitem{\windowstyle{wxRA\_SPECIFY\_ROWS}}{The major dimension parameter refers to the
19 maximum number of rows.}
20 \twocolitem{\windowstyle{wxRA\_SPECIFY\_COLS}}{The major dimension parameter refers to the
21 maximum number of columns.}
22 \end{twocollist}
23
24 See also \helpref{window styles overview}{windowstyles}.
25
26 \wxheading{Event handling}
27
28 \twocolwidtha{7cm}
29 \begin{twocollist}\itemsep=0pt
30 \twocolitem{{\bf EVT\_RADIOBOX(id, func)}}{Process a wxEVT\_COMMAND\_RADIOBOX\_SELECTED event,
31 when a radiobutton is clicked.}
32 \end{twocollist}
33
34 \wxheading{See also}
35
36 \helpref{Event handling overview}{eventhandlingoverview}, \helpref{wxRadioButton}{wxradiobutton},\rtfsp
37 \helpref{wxCheckBox}{wxcheckbox}
38
39 \latexignore{\rtfignore{\wxheading{Members}}}
40
41 \membersection{wxRadioBox::wxRadioBox}\label{wxradioboxconstr}
42
43 \func{}{wxRadioBox}{\void}
44
45 Default constructor.
46
47 \func{}{wxRadioBox}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
48 \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
49 \param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
50 \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
51 \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
52 \param{const wxString\& }{name = ``radioBox"}}
53
54 Constructor, creating and showing a radiobox.
55
56 \wxheading{Parameters}
57
58 \docparam{parent}{Parent window. Must not be NULL.}
59
60 \docparam{id}{Window identifier. A value of -1 indicates a default value.}
61
62 \docparam{label}{Label for the static box surrounding the radio buttons.}
63
64 \docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
65
66 \docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
67
68 \docparam{n}{Number of choices with which to initialize the radiobox.}
69
70 \docparam{choices}{An array of choices with which to initialize the radiobox.}
71
72 \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
73 radiobox.}
74
75 \docparam{style}{Window style. See \helpref{wxRadioBox}{wxradiobox}.}
76
77 \docparam{validator}{Window validator.}
78
79 \docparam{name}{Window name.}
80
81 \wxheading{See also}
82
83 \helpref{wxRadioBox::Create}{wxradioboxcreate}, \helpref{wxValidator}{wxvalidator}
84
85 \membersection{wxRadioBox::\destruct{wxRadioBox}}
86
87 \func{}{\destruct{wxRadioBox}}{\void}
88
89 Destructor, destroying the radiobox item.
90
91 \membersection{wxRadioBox::Create}\label{wxradioboxcreate}
92
93 \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{label},\rtfsp
94 \param{const wxPoint\& }{point = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
95 \param{int}{ n = 0}, \param{const wxString}{ choices[] = NULL},\rtfsp
96 \param{int}{ majorDimension = 0}, \param{long}{ style = wxRA\_SPECIFY\_COLS},\rtfsp
97 \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
98 \param{const wxString\& }{name = ``radioBox"}}
99
100 Creates the radiobox for two-step construction. See \helpref{wxRadioBox::wxRadioBox}{wxradioboxconstr}\rtfsp
101 for further details.
102
103 \membersection{wxRadioBox::Enable}\label{wxradioboxenable}
104
105 \func{void}{Enable}{\param{const bool}{ enable}}
106
107 Enables or disables the entire radiobox.
108
109 \func{void}{Enable}{\param{int}{ n}, \param{const bool}{ enable}}
110
111 Enables or disables an individual button in the radiobox.
112
113 \wxheading{Parameters}
114
115 \docparam{enable}{TRUE to enable, FALSE to disable.}
116
117 \docparam{n}{The zero-based button to enable or disable.}
118
119 \membersection{wxRadioBox::FindString}\label{wxradioboxfindstring}
120
121 \constfunc{int}{FindString}{\param{const wxString\& }{string}}
122
123 Finds a button matching the given string, returning the position if found, or
124 -1 if not found.
125
126 \wxheading{Parameters}
127
128 \docparam{string}{The string to find.}
129
130 \membersection{wxRadioBox::GetLabel}\label{wxradioboxgetlabel}
131
132 \constfunc{wxString}{GetLabel}{\void}
133
134 Returns the radiobox label.
135
136 \constfunc{wxString}{GetLabel}{\param{int }{n}}
137
138 Returns the label for the given button.
139
140 \wxheading{Parameters}
141
142 \docparam{n}{The zero-based button index.}
143
144 \wxheading{See also}
145
146 \helpref{wxRadioBox::SetLabel}{wxradioboxsetlabel}
147
148 \membersection{wxRadioBox::GetSelection}\label{wxradioboxgetselection}
149
150 \constfunc{int}{GetSelection}{\void}
151
152 Returns the zero-based position of the selected button.
153
154 \membersection{wxRadioBox::GetStringSelection}\label{wxradioboxgetstringselection}
155
156 \constfunc{wxString}{GetStringSelection}{\void}
157
158 Returns the selected string.
159
160 \membersection{wxRadioBox::Number}\label{wxradioboxnumber}
161
162 \constfunc{int}{Number}{\void}
163
164 Returns the number of buttons in the radiobox.
165
166 \membersection{wxRadioBox::SetLabel}\label{wxradioboxsetlabel}
167
168 \func{void}{SetLabel}{\param{const wxString\&}{ label}}
169
170 Sets the radiobox label.
171
172 \func{void}{SetLabel}{\param{int }{n}, \param{const wxString\&}{ label}}
173
174 Sets a label for a radio button.
175
176 \wxheading{Parameters}
177
178 \docparam{label}{The label to set.}
179
180 \docparam{n}{The zero-based button index.}
181
182 \membersection{wxRadioBox::SetSelection}\label{wxradioboxsetselection}
183
184 \func{void}{SetSelection}{\param{int}{ n}}
185
186 Sets a button by passing the desired string position.
187
188 \wxheading{Parameters}
189
190 \docparam{n}{The zero-based button position.}
191
192 \membersection{wxRadioBox::SetStringSelection}\label{wxradioboxsetstringselection}
193
194 \func{void}{SetStringSelection}{\param{const wxString\& }{string}}
195
196 Sets a button by passing the desired string.
197
198 \wxheading{Parameters}
199
200 \docparam{string}{The label of the button to select.}
201
202 \membersection{wxRadioBox::Show}\label{wxradioboxshow}
203
204 \func{void}{Show}{\param{const bool}{ show}}
205
206 Shows or hides the entire radiobox.
207
208 \func{void}{Show}{\param{int }{item}, \param{const bool}{ show}}
209
210 Shows or hides individual buttons.
211
212 \wxheading{Parameters}
213
214 \docparam{show}{TRUE to show, FALSE to hide.}
215
216 \docparam{item}{The zero-based position of the button to show or hide.}
217
218 \membersection{wxRadioBox::GetString}\label{wxradioboxgetstring}
219
220 \constfunc{wxString}{GetString}{\param{int}{ n}}
221
222 Returns the label for the button at the given position.
223
224 \wxheading{Parameters}
225
226 \docparam{n}{The zero-based button position.}
227
228