]> Dogcows Code - chaz/openbox/blob - otk/button.hh
better xft checks. require xft version 2
[chaz/openbox] / otk / button.hh
1 #ifndef __button_hh
2 #define __button_hh
3
4 #include "focuslabel.hh"
5
6 namespace otk {
7
8 class OtkButton : public OtkFocusLabel {
9
10 public:
11
12 OtkButton(OtkWidget *parent);
13 ~OtkButton();
14
15 inline const BTexture *getPressedFocusTexture(void) const
16 { return _pressed_focus_tx; }
17 void setPressedFocusTexture(BTexture *texture)
18 { _pressed_focus_tx = texture; }
19
20 inline const BTexture *getPressedUnfocusTexture(void) const
21 { return _pressed_unfocus_tx; }
22 void setPressedUnfocusTexture(BTexture *texture)
23 { _pressed_unfocus_tx = texture; }
24
25 void setTexture(BTexture *texture);
26 void setUnfocusTexture(BTexture *texture);
27
28 inline bool isPressed(void) const { return _pressed; }
29 void press(unsigned int mouse_button);
30 void release(unsigned int mouse_button);
31
32 void buttonPressHandler(const XButtonEvent &e);
33 void buttonReleaseHandler(const XButtonEvent &e);
34
35 virtual void setStyle(Style *style);
36
37 private:
38
39 bool _pressed;
40 unsigned int _mouse_button;
41
42 BTexture *_pressed_focus_tx;
43 BTexture *_pressed_unfocus_tx;
44
45 BTexture *_unpr_focus_tx;
46 BTexture *_unpr_unfocus_tx;
47 };
48
49 }
50
51 #endif
This page took 0.036568 seconds and 4 git commands to generate.