3 This file is part of libmspgltk
4 Copyright © 2007-2011 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_TOGGLE_H_
9 #define MSP_GLTK_TOGGLE_H_
11 #include <sigc++/signal.h>
19 Allows toggling a value between two states.
21 class Toggle: public Widget
24 class Loader: public Widget::Loader
28 Toggle &get_object() const;
30 virtual void finish();
31 void text(const std::string &);
34 sigc::signal<void, bool> signal_toggled;
43 Toggle(const std::string & = std::string());
45 virtual const char *get_class() const { return "toggle"; }
47 void set_text(const std::string &);
48 void set_exclusive(bool);
49 bool get_exclusive() const { return exclusive; }
51 void exclude_siblings();
54 bool get_value() const { return value; }
57 virtual void render_special(const Part &) const;
60 virtual void button_press(int, int, unsigned);
61 virtual void button_release(int, int, unsigned);
63 virtual void on_style_change();