]> git.tdb.fi Git - libs/gltk.git/blob - source/button.h
841786c4def84f7795197dbfd623e182ed2a35df
[libs/gltk.git] / source / button.h
1 #ifndef MSP_GLTK_BUTTON_H_
2 #define MSP_GLTK_BUTTON_H_
3
4 #include <sigc++/sigc++.h>
5 #include "widget.h"
6
7 namespace Msp {
8 namespace GLtk {
9
10 class Button: public Widget
11 {
12 public:
13         class Loader: public Widget::Loader
14         {
15         public:
16                 Loader(Button &);
17                 Button &get_object() const;
18         };
19
20         sigc::signal<void> signal_clicked;
21
22         Button(const Resources &, const std::string & =std::string());
23         void set_text(const std::string &);
24         void button_press(int, int, unsigned);
25         void button_release(int, int, unsigned);
26         void pointer_enter();
27         void pointer_leave();
28 private:
29         std::string text;
30         bool pressed;
31
32         const char *get_class() const { return "button"; }
33         void render_part(const Part &) const;
34 };
35
36 } // namespace GLtk
37 } // namespace Msp
38
39 #endif