]> git.saurik.com Git - wxWidgets.git/blob - interface/tglbtn.h
make it callable from any path
[wxWidgets.git] / interface / tglbtn.h
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}
12
13 wxBitmapToggleButton is a wxToggleButton
14 that contains a bitmap instead of text.
15
16 This control emits an update UI event.
17
18 @beginEventTable
19 @event{EVT_TOGGLEBUTTON(id\, func)}:
20 Handles a toggle button click event.
21 @endEventTable
22
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();
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");
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 */
61 bool GetValue();
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
67 @param state
68 If @true, the button is pressed.
69 */
70 void SetValue(bool state);
71 };
72
73
74 /**
75 @class wxToggleButton
76 @wxheader{tglbtn.h}
77
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.
81
82 Since wxWidgets version 2.9.0 this control emits an update UI event.
83
84 You can see wxToggleButton in action in the sixth page of the
85 controls sample.
86
87 @beginEventTable
88 @event{EVT_TOGGLEBUTTON(id\, func)}:
89 Handles a toggle button click event.
90 @endEventTable
91
92 @library{wxcore}
93 @category{ctrl}
94 @appearance{togglebutton.png}
95
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
106 @param parent
107 Parent window. Must not be @NULL.
108
109 @param id
110 Toggle button identifier. The value wxID_ANY indicates a default value.
111
112 @param label
113 Text to be displayed next to the toggle button.
114
115 @param pos
116 Toggle button position. If wxDefaultPosition is specified then a default
117 position is chosen.
118
119 @param size
120 Toggle button size. If wxDefaultSize is specified then a default
121 size is chosen.
122
123 @param style
124 Window style. See wxToggleButton.
125
126 @param validator
127 Window validator.
128
129 @param name
130 Window name.
131
132 @sa Create(), wxValidator
133 */
134 wxToggleButton();
135 wxToggleButton(wxWindow* parent, wxWindowID id,
136 const wxString& label,
137 const wxPoint& pos = wxDefaultPosition,
138 const wxSize& size = wxDefaultSize,
139 long style = 0,
140 const wxValidator& val,
141 const wxString& name = "checkBox");
142 //@}
143
144 /**
145 Destructor, destroying the toggle button.
146 */
147 ~wxToggleButton();
148
149 /**
150 Creates the toggle button for two-step construction. See wxToggleButton()
151 for details.
152 */
153 bool Create(wxWindow* parent, wxWindowID id,
154 const wxString& label,
155 const wxPoint& pos = wxDefaultPosition,
156 const wxSize& size = wxDefaultSize,
157 long style = 0,
158 const wxValidator& val,
159 const wxString& name = "checkBox");
160
161 /**
162 Gets the state of the toggle button.
163
164 @returns Returns @true if it is pressed, @false otherwise.
165 */
166 bool GetValue();
167
168 /**
169 Sets the toggle button to the given state. This does not cause a
170 @c EVT_TOGGLEBUTTON event to be emitted.
171
172 @param state
173 If @true, the button is pressed.
174 */
175 void SetValue(bool state);
176 };