[Scummvm-cvs-logs] SF.net SVN: scummvm:[35018] scummvm/trunk/gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Nov 12 13:53:55 CET 2008


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

Log Message:
-----------
GUI: Got rid of most 'built-in' variables

Modified Paths:
--------------
    scummvm/trunk/gui/ThemeEval.cpp
    scummvm/trunk/gui/dialog.cpp
    scummvm/trunk/gui/dialog.h
    scummvm/trunk/gui/message.cpp
    scummvm/trunk/gui/message.h
    scummvm/trunk/gui/themes/default.inc
    scummvm/trunk/gui/themes/scummclassic/classic_layout.stx
    scummvm/trunk/gui/themes/scummclassic/classic_layout_320.stx
    scummvm/trunk/gui/themes/scummclassic.zip
    scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx
    scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_320.stx
    scummvm/trunk/gui/themes/scummmodern.zip
    scummvm/trunk/gui/widget.h

Modified: scummvm/trunk/gui/ThemeEval.cpp
===================================================================
--- scummvm/trunk/gui/ThemeEval.cpp	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/ThemeEval.cpp	2008-11-12 12:53:53 UTC (rev 35018)
@@ -39,16 +39,6 @@
 	_builtin["kThumbnailHeight"] = kThumbnailHeight1;
 	_builtin["kThumbnailHeight2"] = kThumbnailHeight2;
 	
-	_builtin["kButtonWidth"] = GUI::kButtonWidth;
-	_builtin["kButtonHeight"] = GUI::kButtonHeight;
-	_builtin["kSliderWidth"] = GUI::kSliderWidth;
-	_builtin["kSliderHeight"] = GUI::kSliderHeight;
-	_builtin["kBigButtonWidth"] = GUI::kBigButtonWidth;
-	_builtin["kBigButtonHeight"] = GUI::kBigButtonHeight;
-	_builtin["kBigSliderWidth"] = GUI::kBigSliderWidth;
-	_builtin["kBigSliderWidth"] = GUI::kBigSliderWidth;
-	_builtin["kBigSliderHeight"] = GUI::kBigSliderHeight;
-	
 	_builtin["kNormalWidgetSize"] = GUI::kNormalWidgetSize;
 	_builtin["kBigWidgetSize"] = GUI::kBigWidgetSize;
 }

Modified: scummvm/trunk/gui/dialog.cpp
===================================================================
--- scummvm/trunk/gui/dialog.cpp	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/dialog.cpp	2008-11-12 12:53:53 UTC (rev 35018)
@@ -344,18 +344,4 @@
 	}
 }
 
-ButtonWidget *Dialog::addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey) {
-	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);
-}
-
 } // End of namespace GUI

Modified: scummvm/trunk/gui/dialog.h
===================================================================
--- scummvm/trunk/gui/dialog.h	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/dialog.h	2008-11-12 12:53:53 UTC (rev 35018)
@@ -86,8 +86,6 @@
 	Widget *findWidget(const char *name);
 	void removeWidget(Widget *widget);
 
-	ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey);
-
 	void setResult(int result) { _result = result; }
 	int getResult() const { return _result; }
 };

Modified: scummvm/trunk/gui/message.cpp
===================================================================
--- scummvm/trunk/gui/message.cpp	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/message.cpp	2008-11-12 12:53:53 UTC (rev 35018)
@@ -36,6 +36,16 @@
 	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 @@
 	}
 }
 
+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;

Modified: scummvm/trunk/gui/message.h
===================================================================
--- scummvm/trunk/gui/message.h	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/message.h	2008-11-12 12:53:53 UTC (rev 35018)
@@ -44,6 +44,9 @@
 	MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = 0);
 
 	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
+
+protected:
+	ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey);
 };
 
 /**

Modified: scummvm/trunk/gui/themes/default.inc
===================================================================
--- scummvm/trunk/gui/themes/default.inc	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/themes/default.inc	2008-11-12 12:53:53 UTC (rev 35018)
@@ -327,10 +327,10 @@
 "size='60,Globals.Line.Height' "
 "/> "
 "<widget name='Button' "
-"size='kBigButtonWidth,kBigButtonHeight' "
+"size='108,24' "
 "/> "
 "<widget name='Slider' "
-"size='kBigSliderWidth,kBigSliderHeight' "
+"size='128,18' "
 "/> "
 "<widget name='PopUp' "
 "size='-1,19' "
@@ -930,10 +930,10 @@
 "<def var='ShowGlobalMenuLogo' value='0'/> "
 "<def var='ScummSaveLoad.ExtInfo.Visible' value='0'/> "
 "<widget name='Button' "
-"size='kButtonWidth,kButtonHeight' "
+"size='72,16' "
 "/> "
 "<widget name='Slider' "
-"size='kSliderWidth,kSliderHeight' "
+"size='85,12' "
 "/> "
 "<widget name='OptionsLabel' "
 "size='110,Globals.Line.Height' "

Modified: scummvm/trunk/gui/themes/scummclassic/classic_layout.stx
===================================================================
--- scummvm/trunk/gui/themes/scummclassic/classic_layout.stx	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/themes/scummclassic/classic_layout.stx	2008-11-12 12:53:53 UTC (rev 35018)
@@ -51,10 +51,10 @@
 		/>
 			
 		<widget name = 'Button'
-				size = 'kBigButtonWidth, kBigButtonHeight'
+				size = '108, 24'
 		/>
 		<widget name = 'Slider'
-				size = 'kBigSliderWidth, kBigSliderHeight'
+				size = '128, 18'
 		/>
 		
 		<widget name = 'PopUp'

Modified: scummvm/trunk/gui/themes/scummclassic/classic_layout_320.stx
===================================================================
--- scummvm/trunk/gui/themes/scummclassic/classic_layout_320.stx	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/themes/scummclassic/classic_layout_320.stx	2008-11-12 12:53:53 UTC (rev 35018)
@@ -40,11 +40,11 @@
 		<def var = 'ScummSaveLoad.ExtInfo.Visible' value = '0'/>
 
 		<widget name = 'Button'
-				size = 'kButtonWidth, kButtonHeight'
+				size = '72, 16'
 		/>
 
 		<widget name = 'Slider'
-				size = 'kSliderWidth, kSliderHeight'
+				size = '85, 12'
 		/>
 
 		<widget name = 'OptionsLabel'

Modified: scummvm/trunk/gui/themes/scummclassic.zip
===================================================================
(Binary files differ)

Modified: scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx
===================================================================
--- scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx	2008-11-12 12:53:53 UTC (rev 35018)
@@ -55,12 +55,12 @@
 		/>
 		
 		<widget name = 'Button'
-				size = 'kBigButtonWidth, kBigButtonHeight'
+				size = '108, 24'
 		/>
 		
 		
 		<widget name = 'Slider'
-				size = 'kBigSliderWidth, kBigSliderHeight'
+				size = '128, 18'
 		/>
 		<widget name = 'PopUp'
 				size = '-1, 19'

Modified: scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_320.stx
===================================================================
--- scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_320.stx	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_320.stx	2008-11-12 12:53:53 UTC (rev 35018)
@@ -38,11 +38,11 @@
 		<def var = 'ScummSaveLoad.ExtInfo.Visible' value = '0'/>
 
 		<widget name = 'Button'
-				size = 'kButtonWidth, kButtonHeight'
+				size = '72, 16'
 		/>
 
 		<widget name = 'Slider'
-				size = 'kSliderWidth, kSliderHeight'
+				size = '85, 12'
 		/>
 
 		<widget name = 'OptionsLabel'

Modified: scummvm/trunk/gui/themes/scummmodern.zip
===================================================================
(Binary files differ)

Modified: scummvm/trunk/gui/widget.h
===================================================================
--- scummvm/trunk/gui/widget.h	2008-11-12 12:50:21 UTC (rev 35017)
+++ scummvm/trunk/gui/widget.h	2008-11-12 12:53:53 UTC (rev 35018)
@@ -72,19 +72,6 @@
 	kBigWidgetSize
 };
 
-enum {
-	kButtonWidth = 72,
-	kButtonHeight = 16,
-	kSliderWidth = 85,
-	kSliderHeight = 12,
-
-	kBigButtonWidth = 108,
-	kBigButtonHeight = 24,
-	kBigSliderWidth = 128,
-	kBigSliderHeight = 18
-};
-
-
 /* Widget */
 class Widget : public GuiObject {
 	friend class Dialog;


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