]>
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.
30 @beginEventEmissionTable{wxCommandEvent}
31 @event{EVT_RADIOBUTTON(id, func)}
32 Process a @c wxEVT_RADIOBUTTON event, when the
33 radiobutton is clicked.
38 @appearance{radiobutton}
40 @see @ref overview_events, wxRadioBox, wxCheckBox
42 class wxRadioButton
: public wxControl
48 @see Create(), wxValidator
53 Constructor, creating and showing a radio button.
56 Parent window. Must not be @NULL.
58 Window identifier. The value @c wxID_ANY indicates a default value.
60 Label for the radio button.
62 Window position. If ::wxDefaultPosition is specified then a default
65 Window size. If ::wxDefaultSize is specified then a default size
68 Window style. See wxRadioButton.
74 @see Create(), wxValidator
76 wxRadioButton(wxWindow
* parent
, wxWindowID id
,
77 const wxString
& label
,
78 const wxPoint
& pos
= wxDefaultPosition
,
79 const wxSize
& size
= wxDefaultSize
,
81 const wxValidator
& validator
= wxDefaultValidator
,
82 const wxString
& name
= wxRadioButtonNameStr
);
85 Destructor, destroying the radio button item.
87 virtual ~wxRadioButton();
90 Creates the choice for two-step construction. See wxRadioButton() for
93 bool Create(wxWindow
* parent
, wxWindowID id
, const wxString
& label
,
94 const wxPoint
& pos
= wxDefaultPosition
,
95 const wxSize
& size
= wxDefaultSize
, long style
= 0,
96 const wxValidator
& validator
= wxDefaultValidator
,
97 const wxString
& name
= wxRadioButtonNameStr
);
100 Returns @true if the radio button is checked, @false otherwise.
102 virtual bool GetValue() const;
105 Sets the radio button to checked or unchecked status. This does not cause a
106 @c wxEVT_RADIOBUTTON event to get emitted.
108 If the radio button belongs to a radio group exactly one button in the
109 group may be checked and so this method can be only called with @a
110 value set to @true. To uncheck a radio button in a group you must check
111 another button in the same group.
114 @true to check, @false to uncheck.
116 virtual void SetValue(bool value
);