]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/tglbtn.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapToggleButton
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 wxToggleButton is a button that stays pressed when clicked by the user. In
14 other words, it is similar to wxCheckBox in
15 functionality but looks like a wxButton.
17 Since wxWidgets version 2.9.0 this control emits an update UI event.
19 You can see wxToggleButton in action in the sixth page of the
22 @beginEventTable{wxCommandEvent}
23 @event{EVT_TOGGLEBUTTON(id, func)}
24 Handles a toggle button click event.
29 <!-- @appearance{togglebutton.png} -->
31 @see wxCheckBox, wxButton, wxBitmapToggleButton
33 class wxToggleButton
: public wxControl
38 Constructor, creating and showing a toggle button.
41 Parent window. Must not be @NULL.
43 Toggle button identifier. The value wxID_ANY indicates a default value.
45 Text to be displayed next to the toggle button.
47 Toggle button position. If wxDefaultPosition is specified then a
48 default position is chosen.
50 Toggle button size. If wxDefaultSize is specified then a
51 default size is chosen.
53 Window style. See wxToggleButton.
59 @see Create(), wxValidator
62 wxToggleButton(wxWindow
* parent
, wxWindowID id
,
63 const wxString
& label
,
64 const wxPoint
& pos
= wxDefaultPosition
,
65 const wxSize
& size
= wxDefaultSize
,
67 const wxValidator
& val
= wxDefaultValidator
,
68 const wxString
& name
= "checkBox");
72 Destructor, destroying the toggle button.
74 virtual ~wxToggleButton();
77 Creates the toggle button for two-step construction. See wxToggleButton()
80 bool Create(wxWindow
* parent
, wxWindowID id
,
81 const wxString
& label
,
82 const wxPoint
& pos
= wxDefaultPosition
,
83 const wxSize
& size
= wxDefaultSize
,
85 const wxValidator
& val
= wxDefaultValidator
,
86 const wxString
& name
= "checkBox");
89 Gets the state of the toggle button.
91 @return Returns @true if it is pressed, @false otherwise.
93 bool GetValue() const;
96 Sets the toggle button to the given state. This does not cause a
97 @c EVT_TOGGLEBUTTON event to be emitted.
100 If @true, the button is pressed.
102 void SetValue(bool state
);
107 @class wxBitmapToggleButton
109 wxBitmapToggleButton is a wxToggleButton
110 that contains a bitmap instead of text.
112 This control emits an update UI event.
114 @beginEventTable{wxCommandEvent}
115 @event{EVT_TOGGLEBUTTON(id, func)}
116 Handles a toggle button click event.
121 <!-- @appearance{bitmaptogglebutton.png} -->
123 class wxBitmapToggleButton
: public wxControl
128 Constructor, creating and showing a toggle button with the bitmap @e label.
129 Internally calls Create().
131 wxBitmapToggleButton();
132 wxBitmapToggleButton(wxWindow
* parent
, wxWindowID id
,
133 const wxBitmap
& label
,
134 const wxPoint
& pos
= wxDefaultPosition
,
135 const wxSize
& size
= wxDefaultSize
,
137 const wxValidator
& val
= wxDefaultValidator
,
138 const wxString
& name
= "checkBox");
142 Create method for two-step construction.
144 bool Create(wxWindow
* parent
, wxWindowID id
,
145 const wxBitmap
& label
,
146 const wxPoint
& pos
= wxDefaultPosition
,
147 const wxSize
& size
= wxDefaultSize
,
149 const wxValidator
& val
= wxDefaultValidator
,
150 const wxString
& name
= "checkBox");
153 Gets the state of the toggle button.
155 @return Returns @true if it is pressed, @false otherwise.
157 virtual bool GetValue() const;
160 Sets the toggle button to the given state. This does not cause a
161 @c EVT_TOGGLEBUTTON event to be emitted.
164 If @true, the button is pressed.
166 virtual void SetValue(bool state
);