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>
26 void text(const std::string &);
29 sigc::signal<void> signal_clicked;
33 const GL::Texture2D *icon = nullptr;
37 Button(const std::string & = std::string());
39 const char *get_class() const override { return "button"; }
42 void autosize_special(const Part &, Geometry &) const override;
45 void set_text(const std::string &);
46 void set_icon(const GL::Texture2D *);
49 void rebuild_special(const Part &) override;
52 void button_press(int, int, unsigned) override;
53 void button_release(int, int, unsigned) override;
54 void pointer_motion(int, int) override;
55 bool navigate(Navigation) override;
57 void on_style_change() override;