[Scummvm-cvs-logs] CVS: scummvm/gui launcher.cpp,1.79,1.80 chooser.h,1.8,1.9 chooser.cpp,1.10,1.11

Max Horn fingolfin at users.sourceforge.net
Fri Nov 28 13:57:02 CET 2003


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

Modified Files:
	launcher.cpp chooser.h chooser.cpp 
Log Message:
reuse SaveLoadChooser in main dialog -> this means the SaveLoadChooser remembers the scroll position -> improved user experience

Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- launcher.cpp	18 Nov 2003 23:47:08 -0000	1.79
+++ launcher.cpp	28 Nov 2003 21:56:14 -0000	1.80
@@ -428,7 +428,8 @@
 			for (idx = 0; idx < candidates.size(); idx++)
 				list.push_back(candidates[idx].description);
 			
-			ChooserDialog dialog("Pick the game:", list);
+			ChooserDialog dialog("Pick the game:");
+			dialog.setList(list);
 			idx = dialog.runModal();
 		}
 		if (0 <= idx && idx < candidates.size()) {

Index: chooser.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/chooser.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- chooser.h	10 Nov 2003 23:40:48 -0000	1.8
+++ chooser.h	28 Nov 2003 21:56:14 -0000	1.9
@@ -42,7 +42,9 @@
 	ButtonWidget	*_chooseButton;
 
 public:
-	ChooserDialog(const String &title, const StringList &list, const String &buttonLabel = "Choose", int height = 140);
+	ChooserDialog(const String &title, const String &buttonLabel = "Choose", int height = 140);
+
+	void setList(const StringList& list);
 
 	virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
 };

Index: chooser.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/chooser.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- chooser.cpp	10 Nov 2003 23:40:48 -0000	1.10
+++ chooser.cpp	28 Nov 2003 21:56:14 -0000	1.11
@@ -29,7 +29,7 @@
 	kChooseCmd = 'Chos'
 };
 
-ChooserDialog::ChooserDialog(const String &title, const StringList& list, const String &buttonLabel, int height)
+ChooserDialog::ChooserDialog(const String &title, const String &buttonLabel, int height)
 	: Dialog(8, (200 - height) / 2, 320 - 2 * 8, height) {
 	// Headline
 	new StaticTextWidget(this, 10, 6, _w - 2 * 10, kLineHeight, title, kTextAlignCenter);
@@ -37,12 +37,15 @@
 	// Add choice list
 	_list = new ListWidget(this, 10, 18, _w - 2 * 10, _h - 14 - 24 - 10);
 	_list->setNumberingMode(kListNumberingOff);
-	_list->setList(list);
 	
 	// Buttons
 	addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
 	_chooseButton = addButton(_w-(kButtonWidth + 10), _h - 24, buttonLabel, kChooseCmd, 0);
 	_chooseButton->setEnabled(false);
+}
+
+void ChooserDialog::setList(const StringList& list) {
+	_list->setList(list);
 }
 
 void ChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {





More information about the Scummvm-git-logs mailing list