aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.h
diff options
context:
space:
mode:
authorMax Horn2002-10-19 01:22:41 +0000
committerMax Horn2002-10-19 01:22:41 +0000
commit7198181b093732592d678fc95c64698fe0470715 (patch)
treede94c24039a14ae90c575440fb47824ff887fd56 /gui/widget.h
parentee13e1638980f8503e8ea04cd676acf1f41197fc (diff)
downloadscummvm-rg350-7198181b093732592d678fc95c64698fe0470715.tar.gz
scummvm-rg350-7198181b093732592d678fc95c64698fe0470715.tar.bz2
scummvm-rg350-7198181b093732592d678fc95c64698fe0470715.zip
reworked the way the save/load dialog works. yup, still not perfect, but we're hopefully getting closer. Feedback welcome
svn-id: r5189
Diffstat (limited to 'gui/widget.h')
-rw-r--r--gui/widget.h32
1 files changed, 21 insertions, 11 deletions
diff --git a/gui/widget.h b/gui/widget.h
index 99808d49a3..8f15309bf0 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -31,10 +31,11 @@ enum {
WIDGET_INVISIBLE = 1 << 1,
WIDGET_HILITED = 1 << 2,
WIDGET_BORDER = 1 << 3,
- WIDGET_CLEARBG = 1 << 4,
- WIDGET_WANT_TICKLE = 1 << 5,
- WIDGET_TRACK_MOUSE = 1 << 6,
- WIDGET_RETAIN_FOCUS = 1 << 7 // Retain focus on mouse up. By default widgets lose focus on mouseup, but some widgets might want to retain it - widgets where you enter text, for instance
+ WIDGET_INV_BORDER = 1 << 4,
+ WIDGET_CLEARBG = 1 << 5,
+ WIDGET_WANT_TICKLE = 1 << 7,
+ WIDGET_TRACK_MOUSE = 1 << 8,
+ WIDGET_RETAIN_FOCUS = 1 << 9 // Retain focus on mouse up. By default widgets lose focus on mouseup, but some widgets might want to retain it - widgets where you enter text, for instance
};
@@ -152,8 +153,8 @@ protected:
class ButtonWidget : public StaticTextWidget, public CommandSender {
friend class Dialog; // Needed for the hotkey handling
protected:
- uint32 _cmd;
- uint8 _hotkey;
+ uint32 _cmd;
+ uint8 _hotkey;
public:
ButtonWidget(Dialog *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
@@ -168,16 +169,25 @@ protected:
void drawWidget(bool hilite);
};
-/* CheckboxWidget */
-class CheckboxWidget : public ButtonWidget {
+/* PushButtonWidget */
+class PushButtonWidget : public ButtonWidget {
protected:
bool _state;
public:
- CheckboxWidget(Dialog *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
- void setState(bool state) { _state = state; }
+ PushButtonWidget(Dialog *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
+
+ void setState(bool state);
+ void toggleState() { setState(!_state); }
bool getState() const { return _state; }
+};
- void handleMouseDown(int x, int y, int button, int clickCount);
+/* CheckboxWidget */
+class CheckboxWidget : public PushButtonWidget {
+protected:
+public:
+ CheckboxWidget(Dialog *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
+
+ void handleMouseUp(int x, int y, int button, int clickCount);
virtual void handleMouseEntered(int button) {}
virtual void handleMouseLeft(int button) {}