]>
git.saurik.com Git - wxWidgets.git/blob - interface/tglbtn.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapToggleButton
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
14 wxToggleButton is a button that stays pressed when clicked by the user. In
15 other words, it is similar to wxCheckBox in
16 functionality but looks like a wxButton.
18 Since wxWidgets version 2.9.0 this control emits an update UI event.
20 You can see wxToggleButton in action in the sixth page of the
24 @event{EVT_TOGGLEBUTTON(id, func)}:
25 Handles a toggle button click event.
30 @appearance{togglebutton.png}
32 @see wxCheckBox, wxButton, wxBitmapToggleButton
34 class wxToggleButton
: public wxControl
39 Constructor, creating and showing a toggle button.
42 Parent window. Must not be @NULL.
44 Toggle button identifier. The value wxID_ANY indicates a default value.
46 Text to be displayed next to the toggle button.
48 Toggle button position. If wxDefaultPosition is specified then a
49 default position is chosen.
51 Toggle button size. If wxDefaultSize is specified then a
52 default size is chosen.
54 Window style. See wxToggleButton.
60 @see Create(), wxValidator
63 wxToggleButton(wxWindow
* parent
, wxWindowID id
,
64 const wxString
& label
,
65 const wxPoint
& pos
= wxDefaultPosition
,
66 const wxSize
& size
= wxDefaultSize
,
68 const wxValidator
& val
= wxDefaultValidator
,
69 const wxString
& name
= "checkBox");
73 Destructor, destroying the toggle button.
75 virtual ~wxToggleButton();
78 Creates the toggle button for two-step construction. See wxToggleButton()
81 bool Create(wxWindow
* parent
, wxWindowID id
,
82 const wxString
& label
,
83 const wxPoint
& pos
= wxDefaultPosition
,
84 const wxSize
& size
= wxDefaultSize
,
86 const wxValidator
& val
= wxDefaultValidator
,
87 const wxString
& name
= "checkBox");
90 Gets the state of the toggle button.
92 @returns Returns @true if it is pressed, @false otherwise.
94 bool GetValue() const;
97 Sets the toggle button to the given state. This does not cause a
98 @c EVT_TOGGLEBUTTON event to be emitted.
101 If @true, the button is pressed.
103 void SetValue(bool state
);
108 @class wxBitmapToggleButton
111 wxBitmapToggleButton is a wxToggleButton
112 that contains a bitmap instead of text.
114 This control emits an update UI event.
117 @event{EVT_TOGGLEBUTTON(id, func)}:
118 Handles a toggle button click event.
123 @appearance{bitmaptogglebutton.png}
125 class wxBitmapToggleButton
: public wxControl
130 Constructor, creating and showing a toggle button with the bitmap @e label.
131 Internally calls Create().
133 wxBitmapToggleButton();
134 wxBitmapToggleButton(wxWindow
* parent
, wxWindowID id
,
135 const wxBitmap
& label
,
136 const wxPoint
& pos
= wxDefaultPosition
,
137 const wxSize
& size
= wxDefaultSize
,
139 const wxValidator
& val
= wxDefaultValidator
,
140 const wxString
& name
= "checkBox");
144 Create method for two-step construction.
146 bool Create(wxWindow
* parent
, wxWindowID id
,
147 const wxBitmap
& label
,
148 const wxPoint
& pos
= wxDefaultPosition
,
149 const wxSize
& size
= wxDefaultSize
,
151 const wxValidator
& val
= wxDefaultValidator
,
152 const wxString
& name
= "checkBox");
155 Gets the state of the toggle button.
157 @returns Returns @true if it is pressed, @false otherwise.
159 virtual bool GetValue() const;
162 Sets the toggle button to the given state. This does not cause a
163 @c EVT_TOGGLEBUTTON event to be emitted.
166 If @true, the button is pressed.
168 virtual void SetValue(bool state
);