diff options
author | Max Horn | 2002-07-06 12:57:51 +0000 |
---|---|---|
committer | Max Horn | 2002-07-06 12:57:51 +0000 |
commit | 671678a6c50d9e6c8aed01e9ff86ad77ead930cc (patch) | |
tree | 73de9e88b858812c2ea9662a4e06eed0595ee5e1 /gui/widget.h | |
parent | 71080f98ab69cb080c8f09349f72e969bfd5a7e5 (diff) | |
download | scummvm-rg350-671678a6c50d9e6c8aed01e9ff86ad77ead930cc.tar.gz scummvm-rg350-671678a6c50d9e6c8aed01e9ff86ad77ead930cc.tar.bz2 scummvm-rg350-671678a6c50d9e6c8aed01e9ff86ad77ead930cc.zip |
added mouse over effect
svn-id: r4466
Diffstat (limited to 'gui/widget.h')
-rw-r--r-- | gui/widget.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gui/widget.h b/gui/widget.h index 30b0b6c431..ec83d723ad 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -29,9 +29,10 @@ class Dialog; enum { WIDGET_ENABLED = 1 << 0, WIDGET_INVISIBLE = 1 << 1, - WIDGET_BORDER = 1 << 2, - WIDGET_CLEARBG = 1 << 3, - WIDGET_WANT_TICKLE = 1 << 4, + WIDGET_HILITED = 1 << 2, + WIDGET_BORDER = 1 << 3, + WIDGET_CLEARBG = 1 << 4, + WIDGET_WANT_TICKLE = 1 << 5, }; /* Widget */ @@ -47,7 +48,9 @@ protected: public: Widget(Dialog *boss, int x, int y, int w, int h); - virtual void handleClick(int button) {} + virtual void handleClick(int button) {} + virtual void handleMouseEntered(int button) {} + virtual void handleMouseLeft(int button) {} void draw(); void setFlags(int flags) { _flags |= flags; } @@ -76,13 +79,16 @@ protected: /* ButtonWidget */ class ButtonWidget : public StaticTextWidget { protected: - uint8 _hotkey; uint32 _cmd; + uint8 _hotkey; public: ButtonWidget(Dialog *boss, int x, int y, int w, int h, const char *label, uint32 cmd); void setCmd(uint32 cmd); uint32 getCmd(); void handleClick(int button); + + void handleMouseEntered(int button) { printf("handleMouseEntered\n"); setFlags(WIDGET_HILITED); draw(); } + void handleMouseLeft(int button) { printf("handleMouseLeft\n"); clearFlags(WIDGET_HILITED); draw(); } }; |