1 #ifndef MSP_GLTK_BUTTON_H_
2 #define MSP_GLTK_BUTTON_H_
4 #include <sigc++/sigc++.h>
5 #include <msp/gl/texture2d.h>
6 #include "mspgltk_api.h"
14 A clickable button widget. Buttons can have a text label, which is displayed
15 in a spacial part "text".
17 class MSPGLTK_API Button: public Widget
20 class MSPGLTK_API Loader: public DataFile::DerivedObjectLoader<Button, Widget::Loader>
25 void text(const std::string &);
28 sigc::signal<void> signal_clicked;
32 const GL::Texture2D *icon = nullptr;
36 Button(const std::string & = std::string());
38 const char *get_class() const override { return "button"; }
41 void autosize_special(const Part &, Geometry &) const override;
44 void set_text(const std::string &);
45 void set_icon(const GL::Texture2D *);
48 void rebuild_special(const Part &) override;
51 void button_press(int, int, unsigned) override;
52 void button_release(int, int, unsigned) override;
53 void pointer_motion(int, int) override;
54 bool navigate(Navigation) override;
56 void on_style_change() override;