]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxRadioButton
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
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 @beginEventEmissionTable{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_events, wxRadioBox, wxCheckBox
45 class wxRadioButton
: public wxControl
51 @see Create(), wxValidator
56 Constructor, creating and showing a radio button.
59 Parent window. Must not be @NULL.
61 Window identifier. The value @c wxID_ANY indicates a default value.
63 Label for the radio button.
65 Window position. If ::wxDefaultPosition is specified then a default
68 Window size. If ::wxDefaultSize is specified then a default size
71 Window style. See wxRadioButton.
77 @see Create(), wxValidator
79 wxRadioButton(wxWindow
* parent
, wxWindowID id
,
80 const wxString
& label
,
81 const wxPoint
& pos
= wxDefaultPosition
,
82 const wxSize
& size
= wxDefaultSize
,
84 const wxValidator
& validator
= wxDefaultValidator
,
85 const wxString
& name
= wxRadioButtonNameStr
);
88 Destructor, destroying the radio button item.
90 virtual ~wxRadioButton();
93 Creates the choice for two-step construction. See wxRadioButton() for
96 bool Create(wxWindow
* parent
, wxWindowID id
, const wxString
& label
,
97 const wxPoint
& pos
= wxDefaultPosition
,
98 const wxSize
& size
= wxDefaultSize
, long style
= 0,
99 const wxValidator
& validator
= wxDefaultValidator
,
100 const wxString
& name
= wxRadioButtonNameStr
);
103 Returns @true if the radio button is depressed, @false otherwise.
105 virtual bool GetValue() const;
108 Sets the radio button to selected or deselected status. This does not cause a
109 @c wxEVT_COMMAND_RADIOBUTTON_SELECTED event to get emitted.
111 If the radio button belongs to a group you can only select a radio button
112 (which will deselect the previously selected button) and you therefore
113 must not call this method with value set to @false in that case.
116 @true to select, @false to deselect.
118 virtual void SetValue(bool value
);