]>
git.saurik.com Git - wxWidgets.git/blob - interface/radiobox.h
799165ff0bb975b4f7b6577720db6239246523dc
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 "Event handling overview", wxRadioButton,
42 class wxRadioBox
: public wxControlWithItems
47 Constructor, creating and showing a radiobox.
50 Parent window. Must not be @NULL.
53 Window identifier. The value wxID_ANY indicates a default value.
56 Label for the static box surrounding the radio buttons.
59 Window position. If wxDefaultPosition is specified then a default position
63 Window size. If wxDefaultSize is specified then a default size is
67 Number of choices with which to initialize the radiobox.
70 An array of choices with which to initialize the radiobox.
73 Specifies the maximum number of rows (if style contains wxRA_SPECIFY_ROWS) or
74 columns (if style contains wxRA_SPECIFY_COLS) for a two-dimensional
78 Window style. See wxRadioBox.
86 @sa Create(), wxValidator
89 wxRadioBox(wxWindow
* parent
, wxWindowID id
,
90 const wxString
& label
,
91 const wxPoint
& point
= wxDefaultPosition
,
92 const wxSize
& size
= wxDefaultSize
,
94 const wxString choices
[] = @NULL
,
95 int majorDimension
= 0,
96 long style
= wxRA_SPECIFY_COLS
,
97 const wxValidator
& validator
= wxDefaultValidator
,
98 const wxString
& name
= "radioBox");
99 wxRadioBox(wxWindow
* parent
, wxWindowID id
,
100 const wxString
& label
,
101 const wxPoint
& point
,
103 const wxArrayString
& choices
,
104 int majorDimension
= 0,
105 long style
= wxRA_SPECIFY_COLS
,
106 const wxValidator
& validator
= wxDefaultValidator
,
107 const wxString
& name
= "radioBox");
111 Destructor, destroying the radiobox item.
117 Creates the radiobox for two-step construction. See wxRadioBox()
120 bool Create(wxWindow
* parent
, wxWindowID id
,
121 const wxString
& label
,
122 const wxPoint
& point
= wxDefaultPosition
,
123 const wxSize
& size
= wxDefaultSize
,
125 const wxString choices
[] = @NULL
,
126 int majorDimension
= 0,
127 long style
= wxRA_SPECIFY_COLS
,
128 const wxValidator
& validator
= wxDefaultValidator
,
129 const wxString
& name
= "radioBox");
130 bool Create(wxWindow
* parent
, wxWindowID id
,
131 const wxString
& label
,
132 const wxPoint
& point
,
134 const wxArrayString
& choices
,
135 int majorDimension
= 0,
136 long style
= wxRA_SPECIFY_COLS
,
137 const wxValidator
& validator
= wxDefaultValidator
,
138 const wxString
& name
= "radioBox");
143 Enables or disables an individual button in the radiobox.
146 @true to enable, @false to disable.
149 The zero-based button to enable or disable.
153 virtual bool Enable(bool enable
= @
true);
154 virtual bool Enable(unsigned int n
, bool enable
= @
true);
158 Finds a button matching the given string, returning the position if found, or
164 int FindString(const wxString
& string
);
167 Returns the number of columns in the radiobox.
169 unsigned int GetColumnCount();
172 Returns a radio box item under the point, a zero-based item index, or @c
173 wxNOT_FOUND if no item is under the point.
176 Point in client coordinates.
178 int GetItemFromPoint(const wxPoint pt
);
181 Returns the helptext associated with the specified @e item if any or @c
185 The zero-based item index.
187 @sa SetItemHelpText()
189 wxString
GetItemHelpText(unsigned int item
);
192 Returns the tooltip associated with the specified @e item if any or @NULL.
194 @sa SetItemToolTip(), wxWindow::GetToolTip
196 wxToolTip
* GetItemToolTip(unsigned int item
);
199 Returns the radiobox label.
202 The zero-based button index.
209 Returns the number of rows in the radiobox.
211 unsigned int GetRowCount();
214 Returns the zero-based position of the selected button.
219 Returns the label for the button at the given position.
222 The zero-based button position.
224 wxString
GetString(unsigned int n
);
227 Returns the selected string.
229 wxString
GetStringSelection();
232 Returns @true if the item is enabled or @false if it was disabled using
233 @ref enable() "Enable(n, @false)".
235 @b Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal
236 and always returns @true in the other ports.
239 The zero-based button position.
241 bool IsItemEnabled(unsigned int n
);
244 Returns @true if the item is currently shown or @false if it was hidden
246 @ref show() "Show(n, @false)".
248 Note that this function returns @true for an item which hadn't been hidden
250 if the entire radiobox is not currently shown.
252 @b Platform note: Currently only implemented in wxMSW, wxGTK and wxUniversal
253 and always returns @true in the other ports.
256 The zero-based button position.
258 bool IsItemShown(unsigned int n
);
261 Sets the helptext for an item. Empty string erases any existing helptext.
264 The zero-based item index.
267 The help text to set for the item.
269 @sa GetItemHelpText()
271 void SetItemHelpText(unsigned int item
, const wxString
& helptext
);
274 Sets the tooltip text for the specified item in the radio group.
276 @b Platform note: Currently only implemented in wxMSW and wxGTK2 and does
277 nothing in the other ports.
280 Index of the item the tooltip will be shown for.
283 Tooltip text for the item, the tooltip is removed if empty.
285 @sa GetItemToolTip(), wxWindow::SetToolTip
287 void SetItemToolTip(unsigned int item
, const wxString
& text
);
290 Sets the radiobox label.
296 The zero-based button index.
298 void SetLabel(const wxString
& label
);
301 Sets a button by passing the desired string position. This does not cause
302 a wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted.
305 The zero-based button position.
307 void SetSelection(int n
);
310 Sets the selection to a button by passing the desired string. This does not
312 a wxEVT_COMMAND_RADIOBOX_SELECTED event to get emitted.
315 The label of the button to select.
317 void SetStringSelection(const wxString
& string
);