]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: radiobut.h | |
e54c96f1 | 3 | // Purpose: interface of wxRadioButton |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxRadioButton | |
7c913512 | 11 | |
3ed3a1c8 BP |
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. | |
7c913512 | 15 | |
3ed3a1c8 BP |
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. | |
7c913512 | 19 | |
23324ae1 | 20 | @beginStyleTable |
8c6791e4 | 21 | @style{wxRB_GROUP} |
23324ae1 | 22 | Marks the beginning of a new group of radio buttons. |
8c6791e4 | 23 | @style{wxRB_SINGLE} |
23324ae1 FM |
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. | |
8c6791e4 | 28 | @style{wxRB_USE_CHECKBOX} |
23324ae1 FM |
29 | Use a checkbox button instead of radio button (currently supported |
30 | only on PalmOS). | |
31 | @endStyleTable | |
7c913512 | 32 | |
1f1d2182 | 33 | @beginEventTable{wxCommandEvent} |
8c6791e4 | 34 | @event{EVT_RADIOBUTTON(id, func)} |
3ed3a1c8 | 35 | Process a @c wxEVT_COMMAND_RADIOBUTTON_SELECTED event, when the |
23324ae1 FM |
36 | radiobutton is clicked. |
37 | @endEventTable | |
7c913512 | 38 | |
23324ae1 FM |
39 | @library{wxcore} |
40 | @category{ctrl} | |
0c7fe6f2 | 41 | <!-- @appearance{radiobutton.png} --> |
7c913512 | 42 | |
1f1d2182 | 43 | @see @ref overview_eventhandling, wxRadioBox, wxCheckBox |
23324ae1 FM |
44 | */ |
45 | class wxRadioButton : public wxControl | |
46 | { | |
47 | public: | |
3ed3a1c8 BP |
48 | |
49 | /** | |
50 | Default constructor. | |
51 | ||
52 | @see Create(), wxValidator | |
53 | */ | |
54 | wxRadioButton(); | |
55 | ||
23324ae1 FM |
56 | /** |
57 | Constructor, creating and showing a radio button. | |
3c4f71cc | 58 | |
7c913512 | 59 | @param parent |
4cc4bfaf | 60 | Parent window. Must not be @NULL. |
7c913512 | 61 | @param id |
3ed3a1c8 | 62 | Window identifier. The value @c wxID_ANY indicates a default value. |
7c913512 | 63 | @param label |
4cc4bfaf | 64 | Label for the radio button. |
7c913512 | 65 | @param pos |
3ed3a1c8 | 66 | Window position. If @c wxDefaultPosition is specified then a default |
4cc4bfaf | 67 | position is chosen. |
7c913512 | 68 | @param size |
3ed3a1c8 | 69 | Window size. If @c wxDefaultSize is specified then a default size |
4cc4bfaf | 70 | is chosen. |
7c913512 | 71 | @param style |
4cc4bfaf | 72 | Window style. See wxRadioButton. |
7c913512 | 73 | @param validator |
4cc4bfaf | 74 | Window validator. |
7c913512 | 75 | @param name |
4cc4bfaf | 76 | Window name. |
3c4f71cc | 77 | |
4cc4bfaf | 78 | @see Create(), wxValidator |
23324ae1 | 79 | */ |
7c913512 FM |
80 | wxRadioButton(wxWindow* parent, wxWindowID id, |
81 | const wxString& label, | |
82 | const wxPoint& pos = wxDefaultPosition, | |
83 | const wxSize& size = wxDefaultSize, | |
84 | long style = 0, | |
85 | const wxValidator& validator = wxDefaultValidator, | |
86 | const wxString& name = "radioButton"); | |
23324ae1 FM |
87 | |
88 | /** | |
89 | Destructor, destroying the radio button item. | |
90 | */ | |
adaaa686 | 91 | virtual ~wxRadioButton(); |
23324ae1 FM |
92 | |
93 | /** | |
94 | Creates the choice for two-step construction. See wxRadioButton() for | |
95 | further details. | |
96 | */ | |
97 | bool Create(wxWindow* parent, wxWindowID id, | |
98 | const wxString& label, | |
99 | const wxPoint& pos = wxDefaultPosition, | |
100 | const wxSize& size = wxDefaultSize, | |
101 | long style = 0, | |
102 | const wxValidator& validator = wxDefaultValidator, | |
103 | const wxString& name = "radioButton"); | |
104 | ||
105 | /** | |
106 | Returns @true if the radio button is depressed, @false otherwise. | |
107 | */ | |
adaaa686 | 108 | virtual bool GetValue() const; |
23324ae1 FM |
109 | |
110 | /** | |
111 | Sets the radio button to selected or deselected status. This does not cause a | |
3ed3a1c8 | 112 | @c wxEVT_COMMAND_RADIOBUTTON_SELECTED event to get emitted. |
3c4f71cc | 113 | |
7c913512 | 114 | @param value |
4cc4bfaf | 115 | @true to select, @false to deselect. |
23324ae1 FM |
116 | */ |
117 | void SetValue(const bool value); | |
118 | }; | |
e54c96f1 | 119 |