X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fbutton.hh;h=09fc0d6b6494aa28bf9c36e8b1379b2f88e3a7ad;hb=e451c08ac5a103362adbece9b8a11a16ade739c1;hp=dd3c78b95644af7c75eda053ce1d7d2f6e15fcbc;hpb=d8d9b42777ace234f3471918e1210062578f8188;p=chaz%2Fopenbox diff --git a/otk/button.hh b/otk/button.hh index dd3c78b9..09fc0d6b 100644 --- a/otk/button.hh +++ b/otk/button.hh @@ -2,49 +2,29 @@ #ifndef __button_hh #define __button_hh -#include "focuslabel.hh" +#include "label.hh" namespace otk { -class Button : public FocusLabel { +class Button : public Label { public: - Button(Widget *parent); - ~Button(); - - inline const RenderTexture *getPressedFocusTexture(void) const - { return _pressed_focus_tx; } - void setPressedFocusTexture(RenderTexture *texture) - { _pressed_focus_tx = texture; } - - inline const RenderTexture *getPressedUnfocusTexture(void) const - { return _pressed_unfocus_tx; } - void setPressedUnfocusTexture(RenderTexture *texture) - { _pressed_unfocus_tx = texture; } + virtual ~Button(); - void setTexture(RenderTexture *texture); - void setUnfocusTexture(RenderTexture *texture); + virtual inline bool isPressed() const { return _pressed; } - inline bool isPressed(void) const { return _pressed; } - void press(unsigned int mouse_button); - void release(unsigned int mouse_button); + virtual void press(unsigned int mouse_button); + virtual void release(unsigned int mouse_button); - void buttonPressHandler(const XButtonEvent &e); - void buttonReleaseHandler(const XButtonEvent &e); + virtual void buttonPressHandler(const XButtonEvent &e); + virtual void buttonReleaseHandler(const XButtonEvent &e); - virtual void setStyle(Style *style); - + virtual void styleChanged(const RenderStyle &style); + private: - bool _pressed; unsigned int _mouse_button; - - RenderTexture *_pressed_focus_tx; - RenderTexture *_pressed_unfocus_tx; - - RenderTexture *_unpr_focus_tx; - RenderTexture *_unpr_unfocus_tx; }; }