[Scummvm-cvs-logs] CVS: scummvm/gui dialog.h,1.24,1.25 PopUpWidget.h,1.6,1.7 PopUpWidget.cpp,1.23,1.24

Max Horn fingolfin at users.sourceforge.net
Wed Nov 5 03:26:05 CET 2003


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv23768

Modified Files:
	dialog.h PopUpWidget.h PopUpWidget.cpp 
Log Message:
minor tweaks

Index: dialog.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- dialog.h	3 Nov 2003 23:33:40 -0000	1.24
+++ dialog.h	5 Nov 2003 11:24:36 -0000	1.25
@@ -78,6 +78,7 @@
 	ButtonWidget *addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey);
 
 	void setResult(int result) { _result = result; }
+	int getResult() const { return _result; }
 };
 
 #endif

Index: PopUpWidget.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/PopUpWidget.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- PopUpWidget.h	5 Nov 2003 00:58:42 -0000	1.6
+++ PopUpWidget.h	5 Nov 2003 11:24:37 -0000	1.7
@@ -53,7 +53,7 @@
 	uint			_labelWidth;
 
 public:
-	PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint labelWidth);
+	PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint labelWidth = 0);
 
 	void handleMouseDown(int x, int y, int button, int clickCount);
 

Index: PopUpWidget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/PopUpWidget.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- PopUpWidget.cpp	3 Nov 2003 01:04:55 -0000	1.23
+++ PopUpWidget.cpp	5 Nov 2003 11:24:37 -0000	1.24
@@ -252,8 +252,8 @@
 	g_gui.fillRect(x, y, w, kLineHeight, hilite ? g_gui._textcolorhi : g_gui._bgcolor);
 	if (name.size() == 0) {
 		// Draw a seperator
-		g_gui.hLine(x, y + kLineHeight / 2, x + w - 1, g_gui._color);
-		g_gui.hLine(x + 1, y + 1 + kLineHeight / 2, x + w - 1, g_gui._shadowcolor);
+		g_gui.hLine(x - 1, y + kLineHeight / 2, x + w, g_gui._shadowcolor);
+		g_gui.hLine(x, y + 1 + kLineHeight / 2, x + w, g_gui._color);
 	} else {
 		g_gui.drawString(name, x + 1, y + 2, w - 2, hilite ? g_gui._bgcolor : g_gui._textcolor);
 	}
@@ -273,6 +273,9 @@
 	_type = kPopUpWidget;
 
 	_selectedItem = -1;
+	
+	if (!_label.isEmpty() && _labelWidth == 0)
+		_labelWidth = g_gui.getStringWidth(_label);
 }
 
 void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {





More information about the Scummvm-git-logs mailing list