]>
git.saurik.com Git - wxWidgets.git/blob - interface/radiobox.h
dd57b38e78dcda983038f16975a906c622061069
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxRadioBox class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A radio box item is used to select one of number of mutually exclusive
14 choices. It is displayed as a vertical column or horizontal row of
18 @style{wxRA_SPECIFY_ROWS}:
19 The major dimension parameter refers to the maximum number of rows.
20 @style{wxRA_SPECIFY_COLS}:
21 The major dimension parameter refers to the maximum number of
23 @style{wxRA_USE_CHECKBOX}:
24 Use of the checkbox controls instead of radio buttons (currently
25 supported only on PalmOS)
29 @event{EVT_RADIOBOX(id, func)}:
30 Process a wxEVT_COMMAND_RADIOBOX_SELECTED event, when a radiobutton
36 @appearance{radiobox.png}
39 @ref overview_eventhandlingoverview, wxRadioButton, wxCheckBox
41 class wxRadioBox
: public wxControlWithItems
46 Constructor, creating and showing a radiobox.
49 Parent window. Must not be @NULL.
51 Window identifier. The value wxID_ANY indicates a default value.
53 Label for the static box surrounding the radio buttons.
55 Window position. If wxDefaultPosition is specified then a default
58 Window size. If wxDefaultSize is specified then a default size
61 Number of choices with which to initialize the radiobox.
63 An array of choices with which to initialize the radiobox.
65 Specifies the maximum number of rows (if style contains wxRA_SPECIFY_ROWS)
66 or columns (if style contains wxRA_SPECIFY_COLS) for a two-dimensional
69 Window style. See wxRadioBox.
75 @see Create(), wxValidator
78 wxRadioBox(wxWindow
* parent
, wxWindowID id
,
79 const wxString
& label
,
80 const wxPoint
& point
= wxDefaultPosition
,
81 const wxSize
& size
= wxDefaultSize
,
83 const wxString choices
[] = NULL
,
84 int majorDimension
= 0,
85 long style
= wxRA_SPECIFY_COLS
,
86 const wxValidator
& validator
= wxDefaultValidator
,
87 const wxString
& name
= "radioBox");
88 wxRadioBox(wxWindow
* parent
, wxWindowID id
,
89 const wxString
& label
,
92 const wxArrayString
& choices
,
93 int majorDimension
= 0,
94 long style
= wxRA_SPECIFY_COLS
,
95 const wxValidator
& validator
= wxDefaultValidator
,
96 const wxString
& name
= "radioBox");
100 Destructor, destroying the radiobox item.
106 Creates the radiobox for two-step construction. See wxRadioBox()
109 bool Create(wxWindow
* parent
, wxWindowID id
,
110 const wxString
& label
,
111 const wxPoint
& point
= wxDefaultPosition
,
112 const wxSize
& size
= wxDefaultSize
,
114 const wxString choices
[] = NULL
,
115 int majorDimension
= 0,
116 long style
= wxRA_SPECIFY_COLS
,
117 const wxValidator
& validator
= wxDefaultValidator
,
118 const wxString
& name
= "radioBox");
119 bool Create(wxWindow
* parent
, wxWindowID id
,
120 const wxString
& label
,
121 const wxPoint
& point
,
123 const wxArrayString
& choices
,
124 int majorDimension
= 0,
125 long style
= wxRA_SPECIFY_COLS
,
126 const wxValidator
& validator
= wxDefaultValidator
,
127 const wxString
& name
= "radioBox");
132 Enables or disables an individual button in the radiobox.
135 @true to enable, @false to disable.
137 The zero-based button to enable or disable.
139 @see wxWindow::Enable
141 virtual bool Enable(bool enable
= true);
142 virtual bool Enable(unsigned int n
, bool enable
= true);
146 Finds a button matching the given string, returning the position if found, or
152 int FindString(const wxString
& string
);
155 Returns the number of columns in the radiobox.
157 unsigned int GetColumnCount();
160 Returns a radio box item under the point, a zero-based item index, or @c
161 wxNOT_FOUND if no item is under the point.
164 Point in client coordinates.
166 int GetItemFromPoint(const wxPoint pt
);
169 Returns the helptext associated with the specified @a item if any or @c
173 The zero-based item index.
175 @see SetItemHelpText()
177 wxString
GetItemHelpText(unsigned int item
);
180 Returns the tooltip associated with the specified @a item if any or @NULL.
182 @see SetItemToolTip(), wxWindow::GetToolTip
184 wxToolTip
* GetItemToolTip(unsigned int item
);
187 Returns the radiobox label.
190 The zero-based button index.
197 Returns the number of rows in the radiobox.
199 unsigned int GetRowCount();
202 Returns the zero-based position of the selected button.
207 Returns the label for the button at the given position.
210 The zero-based button position.
212 wxString
GetString(unsigned int n
);
215 Returns the selected string.
217 wxString
GetStringSelection();
220 Returns @true if the item is enabled or @false if it was disabled using
221 @ref enable() "Enable(n, @false)".
222 @b Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal
223 and always returns @true in the other ports.
226 The zero-based button position.
228 bool IsItemEnabled(unsigned int n
);
231 Returns @true if the item is currently shown or @false if it was hidden
233 @ref show() "Show(n, @false)".
234 Note that this function returns @true for an item which hadn't been hidden
236 if the entire radiobox is not currently shown.
237 @b Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal
238 and always returns @true in the other ports.
241 The zero-based button position.
243 bool IsItemShown(unsigned int n
);
246 Sets the helptext for an item. Empty string erases any existing helptext.
249 The zero-based item index.
251 The help text to set for the item.
253 @see GetItemHelpText()
255 void SetItemHelpText(unsigned int item
, const wxString
& helptext
);
258 Sets the tooltip text for the specified item in the radio group.
259 @b Platform note: Currently only implemented in wxMSW and wxGTK2 and does
260 nothing in the other ports.
263 Index of the item the tooltip will be shown for.
265 Tooltip text for the item, the tooltip is removed if empty.
267 @see GetItemToolTip(), wxWindow::SetToolTip
269 void SetItemToolTip(unsigned int item
, const wxString
& text
);
272 Sets the radiobox label.
277 The zero-based button index.
279 void SetLabel(const wxString
& label
);
282 Sets a button by passing the desired string position. This does not cause
283 a wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted.
286 The zero-based button position.
288 void SetSelection(int n
);
291 Sets the selection to a button by passing the desired string. This does not
293 a wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted.
296 The label of the button to select.
298 void SetStringSelection(const wxString
& string
);