aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2008-11-12 12:58:33 +0000
committerMax Horn2008-11-12 12:58:33 +0000
commit710084dde6236bb09c6f9c75538d5ed5f79b067d (patch)
tree4c0215c1d9e712f378765d67b7ad5c70ec746e59 /gui
parentfa942c42cc780f34b96fc308a2b7fdde52088e42 (diff)
downloadscummvm-rg350-710084dde6236bb09c6f9c75538d5ed5f79b067d.tar.gz
scummvm-rg350-710084dde6236bb09c6f9c75538d5ed5f79b067d.tar.bz2
scummvm-rg350-710084dde6236bb09c6f9c75538d5ed5f79b067d.zip
GUI: Got rid of kBigButtonWidth etc.
svn-id: r35019
Diffstat (limited to 'gui')
-rw-r--r--gui/message.cpp33
1 files changed, 5 insertions, 28 deletions
diff --git a/gui/message.cpp b/gui/message.cpp
index 3fe277c7eb..3ac3cef3cf 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -27,6 +27,7 @@
#include "common/system.h"
#include "gui/message.h"
#include "gui/newgui.h"
+#include "gui/ThemeEval.h"
#include "gui/widget.h"
namespace GUI {
@@ -37,15 +38,6 @@ enum {
};
-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)
@@ -54,15 +46,8 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();
- int buttonWidth, buttonHeight;
-
- if (g_gui.getWidgetSize() == kBigWidgetSize) {
- buttonWidth = kBigButtonWidth;
- buttonHeight = kBigButtonHeight;
- } else {
- buttonWidth = kButtonWidth;
- buttonHeight = kButtonHeight;
- }
+ int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0);
+ int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
// First, determine the size the dialog needs. For this we have to break
// down the string into lines, and taking the maximum of their widths.
@@ -124,16 +109,8 @@ 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;
- }
+ int w = g_gui.xmlEval()->getVar("Globals.Button.Width", 0);
+ int h = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey);
}