]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: tglbtn.h | |
3 | // Purpose: documentation for wxBitmapToggleButton class | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxBitmapToggleButton | |
11 | @wxheader{tglbtn.h} | |
7c913512 | 12 | |
23324ae1 FM |
13 | wxBitmapToggleButton is a wxToggleButton |
14 | that contains a bitmap instead of text. | |
7c913512 | 15 | |
23324ae1 | 16 | This control emits an update UI event. |
7c913512 | 17 | |
23324ae1 | 18 | @beginEventTable |
4cc4bfaf | 19 | @event{EVT_TOGGLEBUTTON(id, func)}: |
23324ae1 FM |
20 | Handles a toggle button click event. |
21 | @endEventTable | |
7c913512 | 22 | |
23324ae1 FM |
23 | @library{wxcore} |
24 | @category{ctrl} | |
25 | @appearance{bitmaptogglebutton.png} | |
26 | */ | |
27 | class wxBitmapToggleButton : public wxControl | |
28 | { | |
29 | public: | |
30 | //@{ | |
31 | /** | |
32 | Constructor, creating and showing a toggle button with the bitmap @e label. | |
33 | Internally calls Create(). | |
34 | */ | |
35 | wxBitmapToggleButton(); | |
7c913512 FM |
36 | wxBitmapToggleButton(wxWindow* parent, wxWindowID id, |
37 | const wxBitmap& label, | |
38 | const wxPoint& pos = wxDefaultPosition, | |
39 | const wxSize& size = wxDefaultSize, | |
40 | long style = 0, | |
41 | const wxValidator& val, | |
42 | const wxString& name = "checkBox"); | |
23324ae1 FM |
43 | //@} |
44 | ||
45 | /** | |
46 | Create method for two-step construction. | |
47 | */ | |
48 | bool Create(wxWindow* parent, wxWindowID id, | |
49 | const wxBitmap& label, | |
50 | const wxPoint& pos = wxDefaultPosition, | |
51 | const wxSize& size = wxDefaultSize, | |
52 | long style = 0, | |
53 | const wxValidator& val, | |
54 | const wxString& name = "checkBox"); | |
55 | ||
56 | /** | |
57 | Gets the state of the toggle button. | |
58 | ||
59 | @returns Returns @true if it is pressed, @false otherwise. | |
60 | */ | |
328f5751 | 61 | bool GetValue() const; |
23324ae1 FM |
62 | |
63 | /** | |
64 | Sets the toggle button to the given state. This does not cause a | |
65 | @c EVT_TOGGLEBUTTON event to be emitted. | |
66 | ||
7c913512 | 67 | @param state |
4cc4bfaf | 68 | If @true, the button is pressed. |
23324ae1 FM |
69 | */ |
70 | void SetValue(bool state); | |
71 | }; | |
72 | ||
73 | ||
74 | /** | |
75 | @class wxToggleButton | |
76 | @wxheader{tglbtn.h} | |
7c913512 | 77 | |
23324ae1 FM |
78 | wxToggleButton is a button that stays pressed when clicked by the user. In |
79 | other words, it is similar to wxCheckBox in | |
80 | functionality but looks like a wxButton. | |
7c913512 | 81 | |
23324ae1 | 82 | Since wxWidgets version 2.9.0 this control emits an update UI event. |
7c913512 | 83 | |
23324ae1 FM |
84 | You can see wxToggleButton in action in the sixth page of the |
85 | controls sample. | |
7c913512 | 86 | |
23324ae1 | 87 | @beginEventTable |
4cc4bfaf | 88 | @event{EVT_TOGGLEBUTTON(id, func)}: |
23324ae1 FM |
89 | Handles a toggle button click event. |
90 | @endEventTable | |
7c913512 | 91 | |
23324ae1 FM |
92 | @library{wxcore} |
93 | @category{ctrl} | |
94 | @appearance{togglebutton.png} | |
7c913512 | 95 | |
23324ae1 FM |
96 | @seealso |
97 | wxCheckBox, wxButton, wxBitmapToggleButton | |
98 | */ | |
99 | class wxToggleButton : public wxControl | |
100 | { | |
101 | public: | |
102 | //@{ | |
103 | /** | |
104 | Constructor, creating and showing a toggle button. | |
105 | ||
7c913512 | 106 | @param parent |
4cc4bfaf | 107 | Parent window. Must not be @NULL. |
7c913512 | 108 | @param id |
4cc4bfaf | 109 | Toggle button identifier. The value wxID_ANY indicates a default value. |
7c913512 | 110 | @param label |
4cc4bfaf | 111 | Text to be displayed next to the toggle button. |
7c913512 | 112 | @param pos |
4cc4bfaf FM |
113 | Toggle button position. If wxDefaultPosition is specified then a |
114 | default position is chosen. | |
7c913512 | 115 | @param size |
4cc4bfaf FM |
116 | Toggle button size. If wxDefaultSize is specified then a |
117 | default size is chosen. | |
7c913512 | 118 | @param style |
4cc4bfaf | 119 | Window style. See wxToggleButton. |
7c913512 | 120 | @param validator |
4cc4bfaf | 121 | Window validator. |
7c913512 | 122 | @param name |
4cc4bfaf | 123 | Window name. |
23324ae1 | 124 | |
4cc4bfaf | 125 | @see Create(), wxValidator |
23324ae1 FM |
126 | */ |
127 | wxToggleButton(); | |
7c913512 FM |
128 | wxToggleButton(wxWindow* parent, wxWindowID id, |
129 | const wxString& label, | |
130 | const wxPoint& pos = wxDefaultPosition, | |
131 | const wxSize& size = wxDefaultSize, | |
132 | long style = 0, | |
133 | const wxValidator& val, | |
134 | const wxString& name = "checkBox"); | |
23324ae1 FM |
135 | //@} |
136 | ||
137 | /** | |
138 | Destructor, destroying the toggle button. | |
139 | */ | |
140 | ~wxToggleButton(); | |
141 | ||
142 | /** | |
143 | Creates the toggle button for two-step construction. See wxToggleButton() | |
144 | for details. | |
145 | */ | |
146 | bool Create(wxWindow* parent, wxWindowID id, | |
147 | const wxString& label, | |
148 | const wxPoint& pos = wxDefaultPosition, | |
149 | const wxSize& size = wxDefaultSize, | |
150 | long style = 0, | |
151 | const wxValidator& val, | |
152 | const wxString& name = "checkBox"); | |
153 | ||
154 | /** | |
155 | Gets the state of the toggle button. | |
156 | ||
157 | @returns Returns @true if it is pressed, @false otherwise. | |
158 | */ | |
328f5751 | 159 | bool GetValue() const; |
23324ae1 FM |
160 | |
161 | /** | |
162 | Sets the toggle button to the given state. This does not cause a | |
163 | @c EVT_TOGGLEBUTTON event to be emitted. | |
164 | ||
7c913512 | 165 | @param state |
4cc4bfaf | 166 | If @true, the button is pressed. |
23324ae1 FM |
167 | */ |
168 | void SetValue(bool state); | |
169 | }; |