diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:33:48 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-08 07:33:48 +0000 |
| commit | 99cd843fc6dc7a7f55b6c90fd1162f233853aad2 (patch) | |
| tree | 42b25c02cbf984fe29b378e9d0dbfbca1436c87b /otk/button.hh | |
| parent | d2df40965bbf042e062b65d6adc12bc158d503eb (diff) | |
Brand spankin new widgets for otk (Label and Button).
Add a new Size class.
Rect, Point, and Size are immutable classes.
Size uses *UNSIGNED* ints. This is causing me headaches * a bajillion right now, so we'll see about that.
Diffstat (limited to 'otk/button.hh')
| -rw-r--r-- | otk/button.hh | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/otk/button.hh b/otk/button.hh index 1483677e..53d08a86 100644 --- a/otk/button.hh +++ b/otk/button.hh @@ -2,49 +2,33 @@ #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; } - - void setTexture(RenderTexture *texture); - void setUnfocusTexture(RenderTexture *texture); + virtual inline bool isDefault() const { return _default; } + virtual void setDefault(bool d); + + 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(RenderStyle *style); - + virtual void styleChanged(const RenderStyle &style); + private: - + bool _default; bool _pressed; unsigned int _mouse_button; - - RenderTexture *_pressed_focus_tx; - RenderTexture *_pressed_unfocus_tx; - - RenderTexture *_unpr_focus_tx; - RenderTexture *_unpr_unfocus_tx; }; } |
