]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxRadioButton
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
11 A radio button item is a button which usually denotes one of several
12 mutually exclusive options. It has a text label next to a (usually) round
15 You can create a group of mutually-exclusive radio buttons by specifying
16 @c wxRB_GROUP for the first in the group. The group ends when another
17 radio button group is created, or there are no more radio buttons.
21 Marks the beginning of a new group of radio buttons.
23 In some circumstances, radio buttons that are not consecutive
24 siblings trigger a hang bug in Windows (only). If this happens, add
25 this style to mark the button as not belonging to a group, and
26 implement the mutually-exclusive group behaviour yourself.
29 @beginEventEmissionTable{wxCommandEvent}
30 @event{EVT_RADIOBUTTON(id, func)}
31 Process a @c wxEVT_RADIOBUTTON event, when the
32 radiobutton is clicked.
37 @appearance{radiobutton}
39 @see @ref overview_events, wxRadioBox, wxCheckBox
41 class wxRadioButton
: public wxControl
47 @see Create(), wxValidator
52 Constructor, creating and showing a radio button.
55 Parent window. Must not be @NULL.
57 Window identifier. The value @c wxID_ANY indicates a default value.
59 Label for the radio button.
61 Window position. If ::wxDefaultPosition is specified then a default
64 Window size. If ::wxDefaultSize is specified then a default size
67 Window style. See wxRadioButton.
73 @see Create(), wxValidator
75 wxRadioButton(wxWindow
* parent
, wxWindowID id
,
76 const wxString
& label
,
77 const wxPoint
& pos
= wxDefaultPosition
,
78 const wxSize
& size
= wxDefaultSize
,
80 const wxValidator
& validator
= wxDefaultValidator
,
81 const wxString
& name
= wxRadioButtonNameStr
);
84 Destructor, destroying the radio button item.
86 virtual ~wxRadioButton();
89 Creates the choice for two-step construction. See wxRadioButton() for
92 bool Create(wxWindow
* parent
, wxWindowID id
, const wxString
& label
,
93 const wxPoint
& pos
= wxDefaultPosition
,
94 const wxSize
& size
= wxDefaultSize
, long style
= 0,
95 const wxValidator
& validator
= wxDefaultValidator
,
96 const wxString
& name
= wxRadioButtonNameStr
);
99 Returns @true if the radio button is checked, @false otherwise.
101 virtual bool GetValue() const;
104 Sets the radio button to checked or unchecked status. This does not cause a
105 @c wxEVT_RADIOBUTTON event to get emitted.
107 If the radio button belongs to a radio group exactly one button in the
108 group may be checked and so this method can be only called with @a
109 value set to @true. To uncheck a radio button in a group you must check
110 another button in the same group.
113 @true to check, @false to uncheck.
115 virtual void SetValue(bool value
);