]> git.saurik.com Git - wxWidgets.git/blob - interface/tglbtn.h
revised archive header; changed overview_arc to overview_archive which reads better...
[wxWidgets.git] / interface / tglbtn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tglbtn.h
3 // Purpose: interface of wxBitmapToggleButton
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() const;
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 /**
76 @class wxToggleButton
77 @wxheader{tglbtn.h}
78
79 wxToggleButton is a button that stays pressed when clicked by the user. In
80 other words, it is similar to wxCheckBox in
81 functionality but looks like a wxButton.
82
83 Since wxWidgets version 2.9.0 this control emits an update UI event.
84
85 You can see wxToggleButton in action in the sixth page of the
86 controls() sample.
87
88 @beginEventTable
89 @event{EVT_TOGGLEBUTTON(id, func)}:
90 Handles a toggle button click event.
91 @endEventTable
92
93 @library{wxcore}
94 @category{ctrl}
95 @appearance{togglebutton.png}
96
97 @see 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 @param id
109 Toggle button identifier. The value wxID_ANY indicates a default value.
110 @param label
111 Text to be displayed next to the toggle button.
112 @param pos
113 Toggle button position. If wxDefaultPosition is specified then a
114 default position is chosen.
115 @param size
116 Toggle button size. If wxDefaultSize is specified then a
117 default size is chosen.
118 @param style
119 Window style. See wxToggleButton.
120 @param validator
121 Window validator.
122 @param name
123 Window name.
124
125 @see Create(), wxValidator
126 */
127 wxToggleButton();
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");
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 */
159 bool GetValue() const;
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
165 @param state
166 If @true, the button is pressed.
167 */
168 void SetValue(bool state);
169 };
170