1 #ifndef MSP_GLTK_TOGGLE_H_
2 #define MSP_GLTK_TOGGLE_H_
4 #include <sigc++/signal.h>
5 #include "mspgltk_api.h"
13 Allows toggling a value between two states.
15 class MSPGLTK_API Toggle: public Widget
18 class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Toggle, Widget::Loader>
24 void finish() override;
26 void text(const std::string &);
29 sigc::signal<void, bool> signal_toggled;
35 bool exclusive = false;
38 Toggle(const std::string & = std::string());
40 const char *get_class() const override { return "toggle"; }
43 void autosize_special(const Part &, Geometry &) const override;
46 void set_text(const std::string &);
47 void set_exclusive(bool);
48 bool get_exclusive() const { return exclusive; }
50 void exclude_siblings();
53 bool get_value() const { return value; }
56 void rebuild_special(const Part &) override;
59 void button_press(int, int, unsigned) override;
60 void button_release(int, int, unsigned) override;
61 bool navigate(Navigation) override;
63 void on_style_change() override;