1 \section{\class{wxRadioBox
}}\label{wxradiobox
}
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
7 \wxheading{Derived from
}
9 \helpref{wxControl
}{wxcontrol
}\\
10 \helpref{wxWindow
}{wxwindow
}\\
11 \helpref{wxEvtHandler
}{wxevthandler
}\\
12 \helpref{wxObject
}{wxobject
}
14 \wxheading{Window styles
}
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.
}
24 See also
\helpref{window styles overview
}{windowstyles
}.
26 \wxheading{Event handling
}
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.
}
36 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxRadioButton
}{wxradiobutton
},
\rtfsp
37 \helpref{wxCheckBox
}{wxcheckbox
}
39 \latexignore{\rtfignore{\wxheading{Members
}}}
41 \membersection{wxRadioBox::wxRadioBox
}\label{wxradioboxconstr
}
43 \func{}{wxRadioBox
}{\void}
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"
}}
54 Constructor, creating and showing a radiobox.
56 \wxheading{Parameters
}
58 \docparam{parent
}{Parent window. Must not be NULL.
}
60 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
62 \docparam{label
}{Label for the static box surrounding the radio buttons.
}
64 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
66 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
68 \docparam{n
}{Number of choices with which to initialize the radiobox.
}
70 \docparam{choices
}{An array of choices with which to initialize the radiobox.
}
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
75 \docparam{style
}{Window style. See
\helpref{wxRadioBox
}{wxradiobox
}.
}
77 \docparam{validator
}{Window validator.
}
79 \docparam{name
}{Window name.
}
83 \helpref{wxRadioBox::Create
}{wxradioboxcreate
},
\helpref{wxValidator
}{wxvalidator
}
85 \membersection{wxRadioBox::
\destruct{wxRadioBox
}}
87 \func{}{\destruct{wxRadioBox
}}{\void}
89 Destructor, destroying the radiobox item.
91 \membersection{wxRadioBox::Create
}\label{wxradioboxcreate
}
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"
}}
100 Creates the radiobox for two-step construction. See
\helpref{wxRadioBox::wxRadioBox
}{wxradioboxconstr
}\rtfsp
103 \membersection{wxRadioBox::Enable
}\label{wxradioboxenable
}
105 \func{void
}{Enable
}{\param{const bool
}{ enable
}}
107 Enables or disables the entire radiobox.
109 \func{void
}{Enable
}{\param{int
}{ n
},
\param{const bool
}{ enable
}}
111 Enables or disables an individual button in the radiobox.
113 \wxheading{Parameters
}
115 \docparam{enable
}{TRUE to enable, FALSE to disable.
}
117 \docparam{n
}{The zero-based button to enable or disable.
}
119 \membersection{wxRadioBox::FindString
}\label{wxradioboxfindstring
}
121 \constfunc{int
}{FindString
}{\param{const wxString\&
}{string
}}
123 Finds a button matching the given string, returning the position if found, or
126 \wxheading{Parameters
}
128 \docparam{string
}{The string to find.
}
130 \membersection{wxRadioBox::GetLabel
}\label{wxradioboxgetlabel
}
132 \constfunc{wxString
}{GetLabel
}{\void}
134 Returns the radiobox label.
136 \constfunc{wxString
}{GetLabel
}{\param{int
}{n
}}
138 Returns the label for the given button.
140 \wxheading{Parameters
}
142 \docparam{n
}{The zero-based button index.
}
146 \helpref{wxRadioBox::SetLabel
}{wxradioboxsetlabel
}
148 \membersection{wxRadioBox::GetSelection
}\label{wxradioboxgetselection
}
150 \constfunc{int
}{GetSelection
}{\void}
152 Returns the zero-based position of the selected button.
154 \membersection{wxRadioBox::GetStringSelection
}\label{wxradioboxgetstringselection
}
156 \constfunc{wxString
}{GetStringSelection
}{\void}
158 Returns the selected string.
160 \membersection{wxRadioBox::Number
}\label{wxradioboxnumber
}
162 \constfunc{int
}{Number
}{\void}
164 Returns the number of buttons in the radiobox.
166 \membersection{wxRadioBox::SetLabel
}\label{wxradioboxsetlabel
}
168 \func{void
}{SetLabel
}{\param{const wxString\&
}{ label
}}
170 Sets the radiobox label.
172 \func{void
}{SetLabel
}{\param{int
}{n
},
\param{const wxString\&
}{ label
}}
174 Sets a label for a radio button.
176 \wxheading{Parameters
}
178 \docparam{label
}{The label to set.
}
180 \docparam{n
}{The zero-based button index.
}
182 \membersection{wxRadioBox::SetSelection
}\label{wxradioboxsetselection
}
184 \func{void
}{SetSelection
}{\param{int
}{ n
}}
186 Sets a button by passing the desired string position.
188 \wxheading{Parameters
}
190 \docparam{n
}{The zero-based button position.
}
192 \membersection{wxRadioBox::SetStringSelection
}\label{wxradioboxsetstringselection
}
194 \func{void
}{SetStringSelection
}{\param{const wxString\&
}{string
}}
196 Sets a button by passing the desired string.
198 \wxheading{Parameters
}
200 \docparam{string
}{The label of the button to select.
}
202 \membersection{wxRadioBox::Show
}\label{wxradioboxshow
}
204 \func{void
}{Show
}{\param{const bool
}{ show
}}
206 Shows or hides the entire radiobox.
208 \func{void
}{Show
}{\param{int
}{item
},
\param{const bool
}{ show
}}
210 Shows or hides individual buttons.
212 \wxheading{Parameters
}
214 \docparam{show
}{TRUE to show, FALSE to hide.
}
216 \docparam{item
}{The zero-based position of the button to show or hide.
}
218 \membersection{wxRadioBox::GetString
}\label{wxradioboxgetstring
}
220 \constfunc{wxString
}{GetString
}{\param{int
}{ n
}}
222 Returns the label for the button at the given position.
224 \wxheading{Parameters
}
226 \docparam{n
}{The zero-based button position.
}