3 This file is part of libmspgltk
4 Copyright © 2007 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>
18 Allows toggling a value between two states.
20 class Toggle: public Widget
23 class Loader: public Widget::Loader
27 Toggle &get_object() const;
29 virtual void finish();
39 sigc::signal<void, bool> signal_toggled;
41 Toggle(const Resources &, const std::string & =std::string());
43 void set_text(const std::string &);
44 void set_exclusive(bool);
45 bool get_exclusive() const { return exclusive; }
47 bool get_value() const { return value; }
49 virtual void button_press(int, int, unsigned);
50 virtual void button_release(int, int, unsigned);
52 virtual const char *get_class() const { return "toggle"; }
53 virtual void render_special(const Part &) const;
55 void exclude_siblings();