aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.h
diff options
context:
space:
mode:
authorEugene Sandulenko2011-01-03 12:23:50 +0000
committerEugene Sandulenko2011-01-03 12:23:50 +0000
commit04a9082d0256597e61724e2418f388b61b4ba792 (patch)
treea76c7f5d3db82d37fcffdd4bd144cb419c99bc19 /gui/widget.h
parente00c17712c142763d5fca42f5ebb69062f8648a3 (diff)
downloadscummvm-rg350-04a9082d0256597e61724e2418f388b61b4ba792.tar.gz
scummvm-rg350-04a9082d0256597e61724e2418f388b61b4ba792.tar.bz2
scummvm-rg350-04a9082d0256597e61724e2418f388b61b4ba792.zip
GUI: Implement PicButtonWidget
It is a button with picture intead of text. To be used by Hugo engine svn-id: r55099
Diffstat (limited to 'gui/widget.h')
-rw-r--r--gui/widget.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/gui/widget.h b/gui/widget.h
index 92bfbf8256..544b9c7601 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -198,6 +198,36 @@ protected:
void drawWidget();
};
+/* PicButtonWidget */
+class PicButtonWidget : public Widget, public CommandSender {
+ friend class Dialog; // Needed for the hotkey handling
+protected:
+ uint32 _cmd;
+ uint8 _hotkey;
+public:
+ PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
+ PicButtonWidget(GuiObject *boss, const Common::String &name, const char *tooltip = 0, uint32 cmd = 0, uint8 hotkey = 0);
+
+ void setCmd(uint32 cmd) { _cmd = cmd; }
+ uint32 getCmd() const { return _cmd; }
+
+ void setGfx(const Graphics::Surface *gfx);
+
+ void useAlpha(int alpha) { _alpha = alpha; }
+ void useThemeTransparency(bool enable) { _transparency = enable; }
+
+ void handleMouseUp(int x, int y, int button, int clickCount);
+ void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); }
+ void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); }
+
+protected:
+ void drawWidget();
+
+ Graphics::Surface _gfx;
+ int _alpha;
+ bool _transparency;
+};
+
/* CheckboxWidget */
class CheckboxWidget : public ButtonWidget {
protected: