Provide shorter synonyms for wxEVT_XXX constants.
[wxWidgets.git] / interface / wx / radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: radiobut.h
3 // Purpose: interface of wxRadioButton
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxRadioButton
11
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
14 button.
15
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.
19
20 @beginStyleTable
21 @style{wxRB_GROUP}
22 Marks the beginning of a new group of radio buttons.
23 @style{wxRB_SINGLE}
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 @endStyleTable
29
30 @beginEventEmissionTable{wxCommandEvent}
31 @event{EVT_RADIOBUTTON(id, func)}
32 Process a @c wxEVT_RADIOBUTTON event, when the
33 radiobutton is clicked.
34 @endEventTable
35
36 @library{wxcore}
37 @category{ctrl}
38 @appearance{radiobutton}
39
40 @see @ref overview_events, wxRadioBox, wxCheckBox
41 */
42 class wxRadioButton : public wxControl
43 {
44 public:
45 /**
46 Default constructor.
47
48 @see Create(), wxValidator
49 */
50 wxRadioButton();
51
52 /**
53 Constructor, creating and showing a radio button.
54
55 @param parent
56 Parent window. Must not be @NULL.
57 @param id
58 Window identifier. The value @c wxID_ANY indicates a default value.
59 @param label
60 Label for the radio button.
61 @param pos
62 Window position. If ::wxDefaultPosition is specified then a default
63 position is chosen.
64 @param size
65 Window size. If ::wxDefaultSize is specified then a default size
66 is chosen.
67 @param style
68 Window style. See wxRadioButton.
69 @param validator
70 Window validator.
71 @param name
72 Window name.
73
74 @see Create(), wxValidator
75 */
76 wxRadioButton(wxWindow* parent, wxWindowID id,
77 const wxString& label,
78 const wxPoint& pos = wxDefaultPosition,
79 const wxSize& size = wxDefaultSize,
80 long style = 0,
81 const wxValidator& validator = wxDefaultValidator,
82 const wxString& name = wxRadioButtonNameStr);
83
84 /**
85 Destructor, destroying the radio button item.
86 */
87 virtual ~wxRadioButton();
88
89 /**
90 Creates the choice for two-step construction. See wxRadioButton() for
91 further details.
92 */
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);
98
99 /**
100 Returns @true if the radio button is checked, @false otherwise.
101 */
102 virtual bool GetValue() const;
103
104 /**
105 Sets the radio button to checked or unchecked status. This does not cause a
106 @c wxEVT_RADIOBUTTON event to get emitted.
107
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.
112
113 @param value
114 @true to check, @false to uncheck.
115 */
116 virtual void SetValue(bool value);
117 };
118