]>
git.saurik.com Git - wxWidgets.git/blob - interface/checkbox.h
09c30ce4fb5b6764a3989c1ea28dc77a11a96138
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxCheckBox class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A checkbox is a labelled box which by default is either on (checkmark is
14 visible) or off (no checkmark). Optionally (when the wxCHK_3STATE style flag
15 is set) it can have a third state, called the mixed or undetermined state.
16 Often this is used as a "Does Not Apply" state.
20 Create a 2-state checkbox. This is the default.
22 Create a 3-state checkbox. Not implemented in wxMGL, wxOS2 and
23 wxGTK built against GTK+ 1.2.
24 @style{wxCHK_ALLOW_3RD_STATE_FOR_USER}:
25 By default a user can't set a 3-state checkbox to the third state.
26 It can only be done from code. Using this flags allows the user to
27 set the checkbox to the third state by clicking.
28 @style{wxALIGN_RIGHT}:
29 Makes the text appear on the left of the checkbox.
33 @event{EVT_CHECKBOX(id, func)}:
34 Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox
40 @appearance{checkbox.png}
43 wxRadioButton, wxCommandEvent
45 class wxCheckBox
: public wxControl
50 Constructor, creating and showing a checkbox.
53 Parent window. Must not be @NULL.
55 Checkbox identifier. The value wxID_ANY indicates a default value.
57 Text to be displayed next to the checkbox.
59 Checkbox position. If wxDefaultPosition is specified then a default
62 Checkbox size. If wxDefaultSize is specified then a default
65 Window style. See wxCheckBox.
71 @see Create(), wxValidator
74 wxCheckBox(wxWindow
* parent
, wxWindowID id
,
75 const wxString
& label
,
76 const wxPoint
& pos
= wxDefaultPosition
,
77 const wxSize
& size
= wxDefaultSize
,
79 const wxValidator
& val
,
80 const wxString
& name
= "checkBox");
84 Destructor, destroying the checkbox.
89 Creates the checkbox for two-step construction. See wxCheckBox()
92 bool Create(wxWindow
* parent
, wxWindowID id
,
93 const wxString
& label
,
94 const wxPoint
& pos
= wxDefaultPosition
,
95 const wxSize
& size
= wxDefaultSize
,
97 const wxValidator
& val
,
98 const wxString
& name
= "checkBox");
101 Gets the state of a 3-state checkbox.
103 @returns Returns wxCHK_UNCHECKED when the checkbox is unchecked,
104 wxCHK_CHECKED when it is checked and
105 wxCHK_UNDETERMINED when it's in the undetermined state.
106 Asserts when the function is used with a 2-state
109 wxCheckBoxState
Get3StateValue();
112 Gets the state of a 2-state checkbox.
114 @returns Returns @true if it is checked, @false otherwise.
119 Returns whether or not the checkbox is a 3-state checkbox.
121 @returns Returns @true if this checkbox is a 3-state checkbox, @false if
122 it's a 2-state checkbox.
127 Returns whether or not the user can set the checkbox to the third state.
129 @returns Returns @true if the user can set the third state of this
130 checkbox, @false if it can only be set programmatically
131 or if it's a 2-state checkbox.
133 bool Is3rdStateAllowedForUser();
136 This is just a maybe more readable synonym for
137 GetValue(): just as the latter, it returns
138 @true if the checkbox is checked and @false otherwise.
143 Sets the checkbox to the given state. This does not cause a
144 wxEVT_COMMAND_CHECKBOX_CLICKED event to get emitted.
147 If @true, the check is on, otherwise it is off.
149 void SetValue(bool state
);