[Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.25,1.26 dialog.h,1.15,1.16

Max Horn fingolfin at users.sourceforge.net
Fri Jul 26 13:39:07 CEST 2002


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

Modified Files:
	dialog.cpp dialog.h 
Log Message:
make sure the mouse over widget and the focused widget are informed when the dialog is closed

Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- dialog.cpp	26 Jul 2002 00:41:06 -0000	1.25
+++ dialog.cpp	26 Jul 2002 20:38:55 -0000	1.26
@@ -57,6 +57,24 @@
 	}
 }
 
+void Dialog::open()
+{
+	_gui->openDialog(this);
+}
+
+void Dialog::close()
+{
+	if (_mouseWidget) {
+		_mouseWidget->handleMouseLeft(0);
+		_mouseWidget = 0;
+	}
+	if (_focusedWidget) {
+		_focusedWidget->lostFocus();
+		_focusedWidget = 0;
+	}
+	_gui->closeTopDialog();
+}
+
 void Dialog::draw()
 {
 	Widget *w = _firstWidget;
@@ -218,13 +236,6 @@
 		w = w->_next;
 	}
 	return w;
-}
-
-void Dialog::close()
-{
-	_mouseWidget = 0;
-	_focusedWidget = 0;
-	_gui->closeTopDialog();
 }
 
 void Dialog::addResText(int x, int y, int w, int h, int resID)

Index: dialog.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- dialog.h	26 Jul 2002 00:41:07 -0000	1.15
+++ dialog.h	26 Jul 2002 20:38:55 -0000	1.16
@@ -54,6 +54,9 @@
 		{}
 	virtual ~Dialog();
 
+	virtual void open();
+	virtual void close();
+
 	virtual void draw();
 
 	virtual void handleTickle(); // Called periodically (in every guiloop() )
@@ -71,7 +74,6 @@
 
 protected:
 	Widget* findWidget(int x, int y); // Find the widget at pos x,y if any
-	void close();
 
 	void addResText(int x, int y, int w, int h, int resID);
 	void addButton(int x, int y, int w, int h, const char *label, uint32 cmd, char hotkey);





More information about the Scummvm-git-logs mailing list