aboutsummaryrefslogtreecommitdiff
path: root/gui/message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/message.cpp')
-rw-r--r--gui/message.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/gui/message.cpp b/gui/message.cpp
index b4e0f8407b..3fe277c7eb 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -36,6 +36,16 @@ enum {
kCancelCmd = 'CNCL'
};
+
+enum {
+ kButtonWidth = 72, // FIXME: Get rid of this
+ kButtonHeight = 16, // FIXME: Get rid of this
+
+ kBigButtonWidth = 108, // FIXME: Get rid of this
+ kBigButtonHeight = 24 // FIXME: Get rid of this
+};
+
+
// TODO: The default button should be visibly distinct from the alternate button
MessageDialog::MessageDialog(const Common::String &message, const char *defaultButton, const char *altButton)
@@ -113,6 +123,21 @@ void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
}
}
+ButtonWidget *MessageDialog::addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey) {
+ // FIXME: Get rid of this method: Use theme stuff instead.
+ int w, h;
+
+ if (g_gui.getWidgetSize() == kBigWidgetSize) {
+ w = kBigButtonWidth;
+ h = kBigButtonHeight;
+ } else {
+ w = kButtonWidth;
+ h = kButtonHeight;
+ }
+
+ return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey);
+}
+
TimedMessageDialog::TimedMessageDialog(const Common::String &message, uint32 duration)
: MessageDialog(message, 0, 0) {
_timer = getMillis() + duration;