libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
checkbox.h
1 /* Copyright (C) 2011-2012 G.P. Halkes
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License version 3, as
4  published by the Free Software Foundation.
5 
6  This program is distributed in the hope that it will be useful,
7  but WITHOUT ANY WARRANTY; without even the implied warranty of
8  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  GNU General Public License for more details.
10 
11  You should have received a copy of the GNU General Public License
12  along with this program. If not, see <http://www.gnu.org/licenses/>.
13 */
14 #ifndef T3_WIDGET_CHECKBOX_H
15 #define T3_WIDGET_CHECKBOX_H
16 
17 #include <t3widget/widgets/widget.h>
18 #include <t3widget/widgets/smartlabel.h>
19 
20 namespace t3_widget {
21 
23 class T3_WIDGET_API checkbox_t : public widget_t, public focus_widget_t {
24  private:
25  bool state,
26  has_focus;
27  smart_label_t *label;
29  public:
33  checkbox_t(bool _state = false);
34  virtual bool process_key(key_t key);
37  virtual bool set_size(optint height, optint width);
38  virtual void update_contents(void);
39  virtual void set_focus(focus_t focus);
40  virtual bool is_hotkey(key_t key);
41  virtual bool process_mouse_event(mouse_event_t event);
46  virtual void set_enabled(bool enable);
48  bool get_state(void);
50  void set_state(bool _state);
52  void set_label(smart_label_t *_label);
53 
58  T3_WIDGET_SIGNAL(activate, void);
63  T3_WIDGET_SIGNAL(toggled, void);
64 };
65 
66 }; // namespace
67 #endif