]> icculus.org git repositories - mikachu/openbox.git/blob - otk/button.hh
added otkapplication and event stuff, changed other files to accomodate for this...
[mikachu/openbox.git] / otk / button.hh
1 #ifndef __button_hh
2 #define __button_hh
3
4 #include "focuswidget.hh"
5 //#include "pixmap.hh"
6
7 namespace otk {
8
9 class OtkButton : public OtkFocusWidget {
10
11 public:
12
13   OtkButton(OtkWidget *parent);
14   ~OtkButton();
15
16   inline const BTexture *getPressedFocusTexture(void) const
17   { return _pressed_focus_tx; }
18   void setPressedFocusTexture(BTexture *texture)
19   { _pressed_focus_tx = texture; }
20
21   inline const BTexture *getPressedUnfocusTexture(void) const
22   { return _pressed_unfocus_tx; }
23   void setPressedUnfocusTexture(BTexture *texture)
24   { _pressed_unfocus_tx = texture; }
25
26   void setTexture(BTexture *texture);
27   void setUnfocusTexture(BTexture *texture);
28
29   inline const std::string &getText(void) const { return _text; }
30   void setText(const std::string &text) { _text = text; _dirty = true; }
31
32   //inline const OtkPixmap &getPixmap(void) const { return _pixmap; }
33   //void setPixmap(const OtkPixmap &pixmap);
34
35   inline bool isPressed(void) const { return _pressed; }
36   void press(void);
37   void release(void);
38
39   void update(void);
40   int exposeHandler(const XExposeEvent &e);
41   int configureHandler(const XConfigureEvent &e);
42
43 private:
44
45   std::string _text;
46   //OtkPixmap _pixmap;
47   bool _pressed;
48   bool _dirty;
49
50   BTexture *_pressed_focus_tx;
51   BTexture *_pressed_unfocus_tx;
52
53   BTexture *_unpr_focus_tx;
54   BTexture *_unpr_unfocus_tx;
55 };
56
57 }
58
59 #endif