]> git.saurik.com Git - wxWidgets.git/blob - interface/radiobut.h
0fa6d4441cfce5c4321b2e0a03b7535a01927888
[wxWidgets.git] / interface / radiobut.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: radiobut.h
3 // Purpose: documentation for wxRadioButton class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxRadioButton
11 @wxheader{radiobut.h}
12
13 A radio button item is a button which usually denotes one of several mutually
14 exclusive options. It has a text label next to a (usually) round button.
15
16 You can create a group of mutually-exclusive radio buttons by specifying @c
17 wxRB_GROUP for
18 the first in the group. The group ends when another radio button group is
19 created, or there are no more radio buttons.
20
21 @beginStyleTable
22 @style{wxRB_GROUP}:
23 Marks the beginning of a new group of radio buttons.
24 @style{wxRB_SINGLE}:
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
31 only on PalmOS).
32 @endStyleTable
33
34 @beginEventTable
35 @event{EVT_RADIOBUTTON(id, func)}:
36 Process a wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the
37 radiobutton is clicked.
38 @endEventTable
39
40 @library{wxcore}
41 @category{ctrl}
42 @appearance{radiobutton.png}
43
44 @seealso
45 @ref overview_eventhandlingoverview, wxRadioBox, wxCheckBox
46 */
47 class wxRadioButton : public wxControl
48 {
49 public:
50 //@{
51 /**
52 Constructor, creating and showing a radio button.
53
54 @param parent
55 Parent window. Must not be @NULL.
56 @param id
57 Window identifier. The value wxID_ANY indicates a default value.
58 @param label
59 Label for the radio button.
60 @param pos
61 Window position. If wxDefaultPosition is specified then a default
62 position is chosen.
63 @param size
64 Window size. If wxDefaultSize is specified then a default size
65 is chosen.
66 @param style
67 Window style. See wxRadioButton.
68 @param validator
69 Window validator.
70 @param name
71 Window name.
72
73 @see Create(), wxValidator
74 */
75 wxRadioButton();
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 = "radioButton");
83 //@}
84
85 /**
86 Destructor, destroying the radio button item.
87 */
88 ~wxRadioButton();
89
90 /**
91 Creates the choice for two-step construction. See wxRadioButton() for
92 further details.
93 */
94 bool Create(wxWindow* parent, wxWindowID id,
95 const wxString& label,
96 const wxPoint& pos = wxDefaultPosition,
97 const wxSize& size = wxDefaultSize,
98 long style = 0,
99 const wxValidator& validator = wxDefaultValidator,
100 const wxString& name = "radioButton");
101
102 /**
103 Returns @true if the radio button is depressed, @false otherwise.
104 */
105 bool GetValue();
106
107 /**
108 Sets the radio button to selected or deselected status. This does not cause a
109 wxEVT_COMMAND_RADIOBUTTON_SELECTED event to get emitted.
110
111 @param value
112 @true to select, @false to deselect.
113 */
114 void SetValue(const bool value);
115 };