]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
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} | |
7c913512 | 12 | |
23324ae1 FM |
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. | |
7c913512 | 15 | |
23324ae1 FM |
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. | |
7c913512 | 20 | |
23324ae1 FM |
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 | |
7c913512 | 33 | |
23324ae1 FM |
34 | @beginEventTable |
35 | @event{EVT_RADIOBUTTON(id\, func)}: | |
36 | Process a wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the | |
37 | radiobutton is clicked. | |
38 | @endEventTable | |
7c913512 | 39 | |
23324ae1 FM |
40 | @library{wxcore} |
41 | @category{ctrl} | |
42 | @appearance{radiobutton.png} | |
7c913512 | 43 | |
23324ae1 FM |
44 | @seealso |
45 | @ref overview_eventhandlingoverview "Event handling overview", wxRadioBox, | |
46 | wxCheckBox | |
47 | */ | |
48 | class wxRadioButton : public wxControl | |
49 | { | |
50 | public: | |
51 | //@{ | |
52 | /** | |
53 | Constructor, creating and showing a radio button. | |
54 | ||
7c913512 | 55 | @param parent |
23324ae1 FM |
56 | Parent window. Must not be @NULL. |
57 | ||
7c913512 | 58 | @param id |
23324ae1 FM |
59 | Window identifier. The value wxID_ANY indicates a default value. |
60 | ||
7c913512 | 61 | @param label |
23324ae1 FM |
62 | Label for the radio button. |
63 | ||
7c913512 | 64 | @param pos |
23324ae1 FM |
65 | Window position. If wxDefaultPosition is specified then a default position |
66 | is chosen. | |
67 | ||
7c913512 | 68 | @param size |
23324ae1 FM |
69 | Window size. If wxDefaultSize is specified then a default size is |
70 | chosen. | |
71 | ||
7c913512 | 72 | @param style |
23324ae1 FM |
73 | Window style. See wxRadioButton. |
74 | ||
7c913512 | 75 | @param validator |
23324ae1 FM |
76 | Window validator. |
77 | ||
7c913512 | 78 | @param name |
23324ae1 FM |
79 | Window name. |
80 | ||
81 | @sa Create(), wxValidator | |
82 | */ | |
83 | wxRadioButton(); | |
7c913512 FM |
84 | wxRadioButton(wxWindow* parent, wxWindowID id, |
85 | const wxString& label, | |
86 | const wxPoint& pos = wxDefaultPosition, | |
87 | const wxSize& size = wxDefaultSize, | |
88 | long style = 0, | |
89 | const wxValidator& validator = wxDefaultValidator, | |
90 | const wxString& name = "radioButton"); | |
23324ae1 FM |
91 | //@} |
92 | ||
93 | /** | |
94 | Destructor, destroying the radio button item. | |
95 | */ | |
96 | ~wxRadioButton(); | |
97 | ||
98 | /** | |
99 | Creates the choice for two-step construction. See wxRadioButton() for | |
100 | further details. | |
101 | */ | |
102 | bool Create(wxWindow* parent, wxWindowID id, | |
103 | const wxString& label, | |
104 | const wxPoint& pos = wxDefaultPosition, | |
105 | const wxSize& size = wxDefaultSize, | |
106 | long style = 0, | |
107 | const wxValidator& validator = wxDefaultValidator, | |
108 | const wxString& name = "radioButton"); | |
109 | ||
110 | /** | |
111 | Returns @true if the radio button is depressed, @false otherwise. | |
112 | */ | |
113 | bool GetValue(); | |
114 | ||
115 | /** | |
116 | Sets the radio button to selected or deselected status. This does not cause a | |
117 | wxEVT_COMMAND_RADIOBUTTON_SELECTED event to get emitted. | |
118 | ||
7c913512 | 119 | @param value |
23324ae1 FM |
120 | @true to select, @false to deselect. |
121 | */ | |
122 | void SetValue(const bool value); | |
123 | }; |