From fa942c42cc780f34b96fc308a2b7fdde52088e42 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 12 Nov 2008 12:53:53 +0000 Subject: GUI: Got rid of most 'built-in' variables svn-id: r35018 --- gui/message.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gui/message.cpp') 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; -- cgit v1.2.3