[Scummvm-cvs-logs] SF.net SVN: scummvm:[35019] scummvm/trunk/gui/message.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Nov 12 13:58:34 CET 2008


Revision: 35019
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35019&view=rev
Author:   fingolfin
Date:     2008-11-12 12:58:33 +0000 (Wed, 12 Nov 2008)

Log Message:
-----------
GUI: Got rid of kBigButtonWidth etc.

Modified Paths:
--------------
    scummvm/trunk/gui/message.cpp

Modified: scummvm/trunk/gui/message.cpp
===================================================================
--- scummvm/trunk/gui/message.cpp	2008-11-12 12:53:53 UTC (rev 35018)
+++ scummvm/trunk/gui/message.cpp	2008-11-12 12:58:33 UTC (rev 35019)
@@ -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 {
-	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,16 +46,9 @@
 	const int screenW = g_system->getOverlayWidth();
 	const int screenH = g_system->getOverlayHeight();
 
-	int buttonWidth, buttonHeight;
+	int buttonWidth = g_gui.xmlEval()->getVar("Globals.Button.Width", 0);
+	int buttonHeight = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
 
-	if (g_gui.getWidgetSize() == kBigWidgetSize) {
-		buttonWidth = kBigButtonWidth;
-		buttonHeight = kBigButtonHeight;
-	} else {
-		buttonWidth = kButtonWidth;
-		buttonHeight = kButtonHeight;
-	}
-
 	// 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.
 	// Using this, and accounting for the space the button(s) need, we can set
@@ -124,17 +109,9 @@
 }
 
 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;
+	int w = g_gui.xmlEval()->getVar("Globals.Button.Width", 0);
+	int h = g_gui.xmlEval()->getVar("Globals.Button.Height", 0);
 
-	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);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list