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
\_HORIZONTAL}}{Lays the radiobox out in rows.
}
19 \twocolitem{\windowstyle{wxRA
\_VERTICAL}}{Lays the radiobox out in columns.
}
22 See also
\helpref{window styles overview
}{windowstyles
}.
24 \wxheading{Event handling
}
27 \begin{twocollist
}\itemsep=
0pt
28 \twocolitem{{\bf EVT
\_RADIOBOX(id, func)
}}{Process a wxEVT
\_COMMAND\_RADIOBOX\_SELECTED event,
29 when a radiobutton is clicked.
}
34 \helpref{Event handling overview
}{eventhandlingoverview
},
\helpref{wxRadioButton
}{wxradiobutton
},
\rtfsp
35 \helpref{wxCheckBox
}{wxcheckbox
}
37 \latexignore{\rtfignore{\wxheading{Members
}}}
39 \membersection{wxRadioBox::wxRadioBox
}\label{wxradioboxconstr
}
41 \func{}{wxRadioBox
}{\void}
45 \func{}{wxRadioBox
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
46 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
47 \param{int
}{ n =
0},
\param{const wxString
}{ choices
[] = NULL
},
\rtfsp
48 \param{int
}{ majorDimension =
0},
\param{long
}{ style = wxRA
\_HORIZONTAL},
\rtfsp
49 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
50 \param{const wxString\&
}{name = ``radioBox"
}}
52 Constructor, creating and showing a radiobox.
54 \wxheading{Parameters
}
56 \docparam{parent
}{Parent window. Must not be NULL.
}
58 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
60 \docparam{label
}{Label for the static box surrounding the radio buttons.
}
62 \docparam{pos
}{Window position. If the position (-
1, -
1) is specified then a default position is chosen.
}
64 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
66 \docparam{n
}{Number of choices with which to initialize the radiobox.
}
68 \docparam{choices
}{An array of choices with which to initialize the radiobox.
}
70 \docparam{majorDimension
}{Specifies the number of rows (if style is wxRA
\_VERTICAL) or columns (if style is wxRA
\_HORIZONTAL) for a two-dimensional
73 \docparam{style
}{Window style. See
\helpref{wxRadioBox
}{wxradiobox
}.
}
75 \docparam{validator
}{Window validator.
}
77 \docparam{name
}{Window name.
}
81 \helpref{wxRadioBox::Create
}{wxradioboxcreate
},
\helpref{wxValidator
}{wxvalidator
}
83 \membersection{wxRadioBox::
\destruct{wxRadioBox
}}
85 \func{}{\destruct{wxRadioBox
}}{\void}
87 Destructor, destroying the radiobox item.
89 \membersection{wxRadioBox::Create
}\label{wxradioboxcreate
}
91 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{id
},
\param{const wxString\&
}{label
},
\rtfsp
92 \param{const wxPoint\&
}{point = wxDefaultPosition
},
\param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
93 \param{int
}{ n =
0},
\param{const wxString
}{ choices
[] = NULL
},
\rtfsp
94 \param{int
}{ majorDimension =
0},
\param{long
}{ style = wxRA
\_HORIZONTAL},
\rtfsp
95 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
\rtfsp
96 \param{const wxString\&
}{name = ``radioBox"
}}
98 Creates the radiobox for two-step construction. See
\helpref{wxRadioBox::wxRadioBox
}{wxradioboxconstr
}\rtfsp
101 \membersection{wxRadioBox::Enable
}\label{wxradioboxenable
}
103 \func{void
}{Enable
}{\param{const bool
}{ enable
}}
105 Enables or disables the entire radiobox.
107 \func{void
}{Enable
}{\param{int
}{ n
},
\param{const bool
}{ enable
}}
109 Enables or disables an individual button in the radiobox.
111 \wxheading{Parameters
}
113 \docparam{enable
}{TRUE to enable, FALSE to disable.
}
115 \docparam{n
}{The zero-based button to enable or disable.
}
117 \membersection{wxRadioBox::FindString
}\label{wxradioboxfindstring
}
119 \constfunc{int
}{FindString
}{\param{const wxString\&
}{string
}}
121 Finds a button matching the given string, returning the position if found, or
124 \wxheading{Parameters
}
126 \docparam{string
}{The string to find.
}
128 \membersection{wxRadioBox::GetLabel
}\label{wxradioboxgetlabel
}
130 \constfunc{wxString
}{GetLabel
}{\void}
132 Returns the radiobox label.
134 \constfunc{wxString
}{GetLabel
}{\param{int
}{n
}}
136 Returns the label for the given button.
138 \wxheading{Parameters
}
140 \docparam{n
}{The zero-based button index.
}
144 \helpref{wxRadioBox::SetLabel
}{wxradioboxsetlabel
}
146 \membersection{wxRadioBox::GetSelection
}\label{wxradioboxgetselection
}
148 \constfunc{int
}{GetSelection
}{\void}
150 Returns the zero-based position of the selected button.
152 \membersection{wxRadioBox::GetStringSelection
}\label{wxradioboxgetstringselection
}
154 \constfunc{wxString
}{GetStringSelection
}{\void}
156 Returns the selected string.
158 \membersection{wxRadioBox::Number
}\label{wxradioboxnumber
}
160 \constfunc{int
}{Number
}{\void}
162 Returns the number of buttons in the radiobox.
164 \membersection{wxRadioBox::SetLabel
}\label{wxradioboxsetlabel
}
166 \func{void
}{SetLabel
}{\param{const wxString\&
}{ label
}}
168 Sets the radiobox label.
170 \func{void
}{SetLabel
}{\param{int
}{n
},
\param{const wxString\&
}{ label
}}
172 Sets a label for a radio button.
174 \wxheading{Parameters
}
176 \docparam{label
}{The label to set.
}
178 \docparam{n
}{The zero-based button index.
}
180 \membersection{wxRadioBox::SetSelection
}\label{wxradioboxsetselection
}
182 \func{void
}{SetSelection
}{\param{int
}{ n
}}
184 Sets a button by passing the desired string position.
186 \wxheading{Parameters
}
188 \docparam{n
}{The zero-based button position.
}
190 \membersection{wxRadioBox::SetStringSelection
}\label{wxradioboxsetstringselection
}
192 \func{void
}{SetStringSelection
}{\param{const wxString\&
}{string
}}
194 Sets a button by passing the desired string.
196 \wxheading{Parameters
}
198 \docparam{string
}{The label of the button to select.
}
200 \membersection{wxRadioBox::Show
}\label{wxradioboxshow
}
202 \func{void
}{Show
}{\param{const bool
}{ show
}}
204 Shows or hides the entire radiobox.
206 \func{void
}{Show
}{\param{int
}{item
},
\param{const bool
}{ show
}}
208 Shows or hides individual buttons.
210 \wxheading{Parameters
}
212 \docparam{show
}{TRUE to show, FALSE to hide.
}
214 \docparam{item
}{The zero-based position of the button to show or hide.
}
216 \membersection{wxRadioBox::GetString
}\label{wxradioboxgetstring
}
218 \constfunc{wxString
}{GetString
}{\param{int
}{ n
}}
220 Returns the label for the button at the given position.
222 \wxheading{Parameters
}
224 \docparam{n
}{The zero-based button position.
}