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