]>
git.saurik.com Git - wxWidgets.git/blob - interface/radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxRadioButton
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A radio button item is a button which usually denotes one of several
14 mutually exclusive options. It has a text label next to a (usually) round
17 You can create a group of mutually-exclusive radio buttons by specifying
18 @c wxRB_GROUP for the first in the group. The group ends when another
19 radio button group is created, or there are no more radio buttons.
23 Marks the beginning of a new group of radio buttons.
25 In some circumstances, radio buttons that are not consecutive
26 siblings trigger a hang bug in Windows (only). If this happens, add
27 this style to mark the button as not belonging to a group, and
28 implement the mutually-exclusive group behaviour yourself.
29 @style{wxRB_USE_CHECKBOX}
30 Use a checkbox button instead of radio button (currently supported
34 @beginEventTable{wxCommandEvent}
35 @event{EVT_RADIOBUTTON(id, func)}
36 Process a @c wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the
37 radiobutton is clicked.
42 <!-- @appearance{radiobutton.png} -->
44 @see @ref overview_eventhandling, wxRadioBox, wxCheckBox
46 class wxRadioButton
: public wxControl
53 @see Create(), wxValidator
58 Constructor, creating and showing a radio button.
61 Parent window. Must not be @NULL.
63 Window identifier. The value @c wxID_ANY indicates a default value.
65 Label for the radio button.
67 Window position. If @c wxDefaultPosition is specified then a default
70 Window size. If @c wxDefaultSize is specified then a default size
73 Window style. See wxRadioButton.
79 @see Create(), wxValidator
81 wxRadioButton(wxWindow
* parent
, wxWindowID id
,
82 const wxString
& label
,
83 const wxPoint
& pos
= wxDefaultPosition
,
84 const wxSize
& size
= wxDefaultSize
,
86 const wxValidator
& validator
= wxDefaultValidator
,
87 const wxString
& name
= "radioButton");
90 Destructor, destroying the radio button item.
95 Creates the choice for two-step construction. See wxRadioButton() for
98 bool Create(wxWindow
* parent
, wxWindowID id
,
99 const wxString
& label
,
100 const wxPoint
& pos
= wxDefaultPosition
,
101 const wxSize
& size
= wxDefaultSize
,
103 const wxValidator
& validator
= wxDefaultValidator
,
104 const wxString
& name
= "radioButton");
107 Returns @true if the radio button is depressed, @false otherwise.
109 bool GetValue() const;
112 Sets the radio button to selected or deselected status. This does not cause a
113 @c wxEVT_COMMAND_RADIOBUTTON_SELECTED event to get emitted.
116 @true to select, @false to deselect.
118 void SetValue(const bool value
);