[Scummvm-cvs-logs] SF.net SVN: scummvm: [27050] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Jun 2 14:01:09 CEST 2007


Revision: 27050
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27050&view=rev
Author:   fingolfin
Date:     2007-06-02 05:01:09 -0700 (Sat, 02 Jun 2007)

Log Message:
-----------
Make InfoDialog::setInfoText a bit more useful, by making it public & reusable

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/dialogs.cpp
    scummvm/trunk/engines/scumm/dialogs.h

Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp	2007-06-02 09:07:29 UTC (rev 27049)
+++ scummvm/trunk/engines/scumm/dialogs.cpp	2007-06-02 12:01:09 UTC (rev 27050)
@@ -749,21 +749,28 @@
 
 InfoDialog::InfoDialog(ScummEngine *scumm, int res)
 : ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w
-	setInfoText(queryResString(res));
+
+	_message = queryResString(res);
+
+	// Width and height are dummy
+	_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
 }
 
 InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
 : ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w
-	setInfoText(message);
-}
 
-void InfoDialog::setInfoText(const String& message) {
 	_message = message;
 
 	// Width and height are dummy
 	_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
 }
 
+void InfoDialog::setInfoText(const String& message) {
+	_message = message;
+	_text->setLabel(_message);
+	//reflowLayout(); // FIXME: Should we call this here? Depends on the usage patterns, I guess...
+}
+
 void InfoDialog::reflowLayout() {
 	const int screenW = g_system->getOverlayWidth();
 	const int screenH = g_system->getOverlayHeight();

Modified: scummvm/trunk/engines/scumm/dialogs.h
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.h	2007-06-02 09:07:29 UTC (rev 27049)
+++ scummvm/trunk/engines/scumm/dialogs.h	2007-06-02 12:01:09 UTC (rev 27050)
@@ -165,6 +165,8 @@
 	// from resources
 	InfoDialog(ScummEngine *scumm, int res);
 
+	void setInfoText(const String& message);
+
 	virtual void handleMouseDown(int x, int y, int button, int clickCount) {
 		setResult(0);
 		close();
@@ -177,7 +179,6 @@
 	virtual void reflowLayout();
 
 protected:
-	void setInfoText (const String& message);
 
 	// Query a string from the resources
 	const String queryResString(int stringno);


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