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

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Wed May 31 05:28:03 CEST 2006


Revision: 22799
Author:   eriktorbjorn
Date:     2006-05-31 05:27:05 -0700 (Wed, 31 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22799&view=rev

Log Message:
-----------
More cleanup. We shouldn't need these widget size parameters either.

Modified Paths:
--------------
    scummvm/trunk/gui/ListWidget.cpp
    scummvm/trunk/gui/dialog.cpp
    scummvm/trunk/gui/dialog.h
    scummvm/trunk/gui/message.cpp
    scummvm/trunk/gui/widget.cpp
    scummvm/trunk/gui/widget.h
Modified: scummvm/trunk/gui/ListWidget.cpp
===================================================================
--- scummvm/trunk/gui/ListWidget.cpp	2006-05-31 12:09:00 UTC (rev 22798)
+++ scummvm/trunk/gui/ListWidget.cpp	2006-05-31 12:27:05 UTC (rev 22799)
@@ -444,8 +444,6 @@
 void ListWidget::handleScreenChanged() {
 	Widget::handleScreenChanged();
 
-	WidgetSize ws = g_gui.getWidgetSize();
-
 	_leftPadding = g_gui.evaluator()->getVar("ListWidget.leftPadding", 0);
 	_rightPadding = g_gui.evaluator()->getVar("ListWidget.rightPadding", 0);
 	_topPadding = g_gui.evaluator()->getVar("ListWidget.topPadding", 0);
@@ -453,7 +451,7 @@
 	_hlLeftPadding = g_gui.evaluator()->getVar("ListWidget.hlLeftPadding", 0);
 	_hlRightPadding = g_gui.evaluator()->getVar("ListWidget.hlRightPadding", 0);
 
-	if (ws == kBigWidgetSize) {
+	if (g_gui.getWidgetSize() == kBigWidgetSize) {
 		_scrollBarWidth =  kBigScrollBarWidth;
 	} else {
 		_scrollBarWidth = kNormalScrollBarWidth;

Modified: scummvm/trunk/gui/dialog.cpp
===================================================================
--- scummvm/trunk/gui/dialog.cpp	2006-05-31 12:09:00 UTC (rev 22798)
+++ scummvm/trunk/gui/dialog.cpp	2006-05-31 12:27:05 UTC (rev 22799)
@@ -329,14 +329,18 @@
 	}
 }
 
-ButtonWidget *Dialog::addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws) {
-	int w = kButtonWidth;
-	int h = kButtonHeight;
-	if (ws == kBigWidgetSize) {
+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, ws);
+
+	return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey);
 }
 
 uint32 GuiObject::getMillis() {

Modified: scummvm/trunk/gui/dialog.h
===================================================================
--- scummvm/trunk/gui/dialog.h	2006-05-31 12:09:00 UTC (rev 22798)
+++ scummvm/trunk/gui/dialog.h	2006-05-31 12:27:05 UTC (rev 22799)
@@ -84,7 +84,7 @@
 	Widget *findWidget(const char *name);
 	void deleteWidget(Widget *widget);
 
-	ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey, WidgetSize ws = kDefaultWidgetSize);
+	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	2006-05-31 12:09:00 UTC (rev 22798)
+++ scummvm/trunk/gui/message.cpp	2006-05-31 12:27:05 UTC (rev 22799)
@@ -41,15 +41,12 @@
 	const int screenW = g_system->getOverlayWidth();
 	const int screenH = g_system->getOverlayHeight();
 
-	GUI::WidgetSize ws;
 	int buttonWidth, buttonHeight;
 
-	if (screenW >= 400 && screenH >= 300) {
-		ws = GUI::kBigWidgetSize;
+	if (g_gui.getWidgetSize() == kBigWidgetSize) {
 		buttonWidth = kBigButtonWidth;
 		buttonHeight = kBigButtonHeight;
 	} else {
-		ws = GUI::kNormalWidgetSize;
 		buttonWidth = kButtonWidth;
 		buttonHeight = kButtonHeight;
 	}
@@ -96,10 +93,10 @@
 	}
 
 	if (defaultButton)
-		addButton(this, okButtonPos, _h - buttonHeight - 8, defaultButton, kOkCmd, '\n', ws);	// Confirm dialog
+		addButton(this, okButtonPos, _h - buttonHeight - 8, defaultButton, kOkCmd, '\n');	// Confirm dialog
 
 	if (altButton)
-		addButton(this, cancelButtonPos, _h - buttonHeight - 8, altButton, kCancelCmd, '\27', ws);	// Cancel dialog
+		addButton(this, cancelButtonPos, _h - buttonHeight - 8, altButton, kCancelCmd, '\27');	// Cancel dialog
 }
 
 void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {

Modified: scummvm/trunk/gui/widget.cpp
===================================================================
--- scummvm/trunk/gui/widget.cpp	2006-05-31 12:09:00 UTC (rev 22798)
+++ scummvm/trunk/gui/widget.cpp	2006-05-31 12:27:05 UTC (rev 22799)
@@ -190,7 +190,7 @@
 
 #pragma mark -
 
-ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey, WidgetSize ws)
+ButtonWidget::ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey)
 	: StaticTextWidget(boss, x, y, w, h, label, kTextAlignCenter), CommandSender(boss),
 	  _cmd(cmd), _hotkey(hotkey) {
 	_flags = WIDGET_ENABLED/* | WIDGET_BORDER*/ | WIDGET_CLEARBG;
@@ -215,8 +215,8 @@
 
 #pragma mark -
 
-CheckboxWidget::CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey, WidgetSize ws)
-	: ButtonWidget(boss, x, y, w, h, label, cmd, hotkey, ws), _state(false) {
+CheckboxWidget::CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd, uint8 hotkey)
+	: ButtonWidget(boss, x, y, w, h, label, cmd, hotkey), _state(false) {
 	_flags = WIDGET_ENABLED;
 	_type = kCheckboxWidget;
 }

Modified: scummvm/trunk/gui/widget.h
===================================================================
--- scummvm/trunk/gui/widget.h	2006-05-31 12:09:00 UTC (rev 22798)
+++ scummvm/trunk/gui/widget.h	2006-05-31 12:27:05 UTC (rev 22799)
@@ -189,7 +189,7 @@
 	uint32	_cmd;
 	uint8	_hotkey;
 public:
-	ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0, WidgetSize ws = kDefaultWidgetSize);
+	ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
 	ButtonWidget(GuiObject *boss, String name, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
 
 	void setCmd(uint32 cmd)				{ _cmd = cmd; }
@@ -208,7 +208,7 @@
 protected:
 	bool	_state;
 public:
-	CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0, WidgetSize ws = kDefaultWidgetSize);
+	CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
 	CheckboxWidget(GuiObject *boss, String name, const String &label, uint32 cmd = 0, uint8 hotkey = 0);
 
 	void handleMouseUp(int x, int y, int button, int clickCount);


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