]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxRadioButton
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 A radio button item is a button which usually denotes one of several
13 mutually exclusive options. It has a text label next to a (usually) round
16 You can create a group of mutually-exclusive radio buttons by specifying
17 @c wxRB_GROUP for the first in the group. The group ends when another
18 radio button group is created, or there are no more radio buttons.
22 Marks the beginning of a new group of radio buttons.
24 In some circumstances, radio buttons that are not consecutive
25 siblings trigger a hang bug in Windows (only). If this happens, add
26 this style to mark the button as not belonging to a group, and
27 implement the mutually-exclusive group behaviour yourself.
28 @style{wxRB_USE_CHECKBOX}
29 Use a checkbox button instead of radio button (currently supported
33 @beginEventTable{wxCommandEvent}
34 @event{EVT_RADIOBUTTON(id, func)}
35 Process a @c wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the
36 radiobutton is clicked.
41 <!-- @appearance{radiobutton.png} -->
43 @see @ref overview_eventhandling, wxRadioBox, wxCheckBox
45 class wxRadioButton
: public wxControl
52 @see Create(), wxValidator
57 Constructor, creating and showing a radio button.
60 Parent window. Must not be @NULL.
62 Window identifier. The value @c wxID_ANY indicates a default value.
64 Label for the radio button.
66 Window position. If @c wxDefaultPosition is specified then a default
69 Window size. If @c wxDefaultSize is specified then a default size
72 Window style. See wxRadioButton.
78 @see Create(), wxValidator
80 wxRadioButton(wxWindow
* parent
, wxWindowID id
,
81 const wxString
& label
,
82 const wxPoint
& pos
= wxDefaultPosition
,
83 const wxSize
& size
= wxDefaultSize
,
85 const wxValidator
& validator
= wxDefaultValidator
,
86 const wxString
& name
= "radioButton");
89 Destructor, destroying the radio button item.
94 Creates the choice for two-step construction. See wxRadioButton() for
97 bool Create(wxWindow
* parent
, wxWindowID id
,
98 const wxString
& label
,
99 const wxPoint
& pos
= wxDefaultPosition
,
100 const wxSize
& size
= wxDefaultSize
,
102 const wxValidator
& validator
= wxDefaultValidator
,
103 const wxString
& name
= "radioButton");
106 Returns @true if the radio button is depressed, @false otherwise.
108 bool GetValue() const;
111 Sets the radio button to selected or deselected status. This does not cause a
112 @c wxEVT_COMMAND_RADIOBUTTON_SELECTED event to get emitted.
115 @true to select, @false to deselect.
117 void SetValue(const bool value
);