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