[Scummvm-cvs-logs] CVS: scummvm/gui ListWidget.cpp,1.4,1.5 ListWidget.h,1.4,1.5 dialog.cpp,1.17,1.18

Max Horn fingolfin at users.sourceforge.net
Sat Jul 13 05:03:01 CEST 2002


Update of /cvsroot/scummvm/scummvm/gui
In directory usw-pr-cvs1:/tmp/cvs-serv27153

Modified Files:
	ListWidget.cpp ListWidget.h dialog.cpp 
Log Message:
some cleanup

Index: ListWidget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/ListWidget.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ListWidget.cpp	13 Jul 2002 09:19:23 -0000	1.4
+++ ListWidget.cpp	13 Jul 2002 12:02:10 -0000	1.5
@@ -86,7 +86,7 @@
 void ListWidget::handleClick(int x, int y, int button)
 {
 	if (_flags & WIDGET_ENABLED) {
-		_selectedItem = (y / LINE_HEIGHT) + _currentPos;
+		_selectedItem = (y - 2) / LINE_HEIGHT + _currentPos;
 		draw();
 	}
 }
@@ -123,9 +123,7 @@
 		} else
 			buffer = "";
 		buffer += _list[pos];
-		if (_selectedItem == pos)
-			gui->drawString(buffer, _x+5, _y+2 + LINE_HEIGHT * i, _w - 10, gui->_textcolorhi);
-		else
-			gui->drawString(buffer, _x+5, _y+2 + LINE_HEIGHT * i, _w - 10, gui->_textcolor);
+		gui->drawString(buffer, _x+5, _y+2 + LINE_HEIGHT * i, _w - 10,
+							(_selectedItem == pos) ? gui->_textcolorhi : gui->_textcolor);
 	}
 }

Index: ListWidget.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/ListWidget.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ListWidget.h	13 Jul 2002 09:19:23 -0000	1.4
+++ ListWidget.h	13 Jul 2002 12:02:10 -0000	1.5
@@ -46,9 +46,9 @@
 	ListWidget(Dialog *boss, int x, int y, int w, int h);
 	virtual ~ListWidget();
 	
-	void setList(const StringList& list)	{ _list = list; }
-	const StringList& getList()	const		{ return _list; }
-	const int getSelected()	 {return _selectedItem;}
+	void setList(const StringList& list)		{ _list = list; }
+	const StringList& getList()	const			{ return _list; }
+	int getSelected() const						{ return _selectedItem; }
 	void setNumberingMode(int numberingMode)	{ _numberingMode = numberingMode; }
 	
 	virtual void handleClick(int x, int y, int button);

Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- dialog.cpp	13 Jul 2002 09:19:23 -0000	1.17
+++ dialog.cpp	13 Jul 2002 12:02:10 -0000	1.18
@@ -212,9 +212,10 @@
 {
 	switch (cmd) {
 	case kSaveCmd:
+		//printf("Saving game in slot %d\n", _savegameList->getSelected());
 		break;
 	case kLoadCmd:
-		//printf("Saving game in slot %d\n", _savegameList->getSelected());
+		//printf("Loading game in slot %d\n", _savegameList->getSelected());
 		break;
 	case kPlayCmd:
 		close();





More information about the Scummvm-git-logs mailing list