diff options
author | Max Horn | 2008-11-12 12:53:53 +0000 |
---|---|---|
committer | Max Horn | 2008-11-12 12:53:53 +0000 |
commit | fa942c42cc780f34b96fc308a2b7fdde52088e42 (patch) | |
tree | 9da5c5d5e2b6d057a7f713f281ff1d461aeaa004 /gui/message.cpp | |
parent | 201c26fcd0ad71568a3581a5520c094d93ec6d06 (diff) | |
download | scummvm-rg350-fa942c42cc780f34b96fc308a2b7fdde52088e42.tar.gz scummvm-rg350-fa942c42cc780f34b96fc308a2b7fdde52088e42.tar.bz2 scummvm-rg350-fa942c42cc780f34b96fc308a2b7fdde52088e42.zip |
GUI: Got rid of most 'built-in' variables
svn-id: r35018
Diffstat (limited to 'gui/message.cpp')
-rw-r--r-- | gui/message.cpp | 25 |
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; |