]> git.saurik.com Git - wxWidgets.git/blame - interface/radiobut.h
fixed links to global variables; fixed categories; use @see instead of @seealso
[wxWidgets.git] / interface / radiobut.h
CommitLineData
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 34 @beginEventTable
4cc4bfaf 35 @event{EVT_RADIOBUTTON(id, func)}:
23324ae1
FM
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 44 @seealso
4cc4bfaf 45 @ref overview_eventhandlingoverview, wxRadioBox, wxCheckBox
23324ae1
FM
46*/
47class wxRadioButton : public wxControl
48{
49public:
50 //@{
51 /**
52 Constructor, creating and showing a radio button.
53
7c913512 54 @param parent
4cc4bfaf 55 Parent window. Must not be @NULL.
7c913512 56 @param id
4cc4bfaf 57 Window identifier. The value wxID_ANY indicates a default value.
7c913512 58 @param label
4cc4bfaf 59 Label for the radio button.
7c913512 60 @param pos
4cc4bfaf
FM
61 Window position. If wxDefaultPosition is specified then a default
62 position is chosen.
7c913512 63 @param size
4cc4bfaf
FM
64 Window size. If wxDefaultSize is specified then a default size
65 is chosen.
7c913512 66 @param style
4cc4bfaf 67 Window style. See wxRadioButton.
7c913512 68 @param validator
4cc4bfaf 69 Window validator.
7c913512 70 @param name
4cc4bfaf 71 Window name.
23324ae1 72
4cc4bfaf 73 @see Create(), wxValidator
23324ae1
FM
74 */
75 wxRadioButton();
7c913512
FM
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");
23324ae1
FM
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 */
328f5751 105 bool GetValue() const;
23324ae1
FM
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
7c913512 111 @param value
4cc4bfaf 112 @true to select, @false to deselect.
23324ae1
FM
113 */
114 void SetValue(const bool value);
115};