X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fbutton.hh;h=a3805aa069f459e1dc904075ce9a0feaeef8b0e4;hb=648c55b829e09c66222a9bbf08d10434622feae2;hp=dd3c78b95644af7c75eda053ce1d7d2f6e15fcbc;hpb=d8d9b42777ace234f3471918e1210062578f8188;p=chaz%2Fopenbox diff --git a/otk/button.hh b/otk/button.hh index dd3c78b9..a3805aa0 100644 --- a/otk/button.hh +++ b/otk/button.hh @@ -2,49 +2,31 @@ #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; } + virtual ~Button(); - inline const RenderTexture *getPressedUnfocusTexture(void) const - { return _pressed_unfocus_tx; } - void setPressedUnfocusTexture(RenderTexture *texture) - { _pressed_unfocus_tx = texture; } + virtual inline bool isPressed() const { return _pressed; } - void setTexture(RenderTexture *texture); - void setUnfocusTexture(RenderTexture *texture); + virtual void press(unsigned int mouse_button); + virtual void release(unsigned int mouse_button); - inline bool isPressed(void) const { return _pressed; } - void press(unsigned int mouse_button); - void release(unsigned int mouse_button); + virtual void buttonPressHandler(const XButtonEvent &e); + virtual void buttonReleaseHandler(const XButtonEvent &e); - void buttonPressHandler(const XButtonEvent &e); - void buttonReleaseHandler(const XButtonEvent &e); + virtual void clickHandler(unsigned int button) {(void)button;} - 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; }; }