[Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.28,1.29

Max Horn fingolfin at users.sourceforge.net
Tue Jul 22 09:32:01 CEST 2003


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

Modified Files:
	dialog.cpp 
Log Message:
fixed button hotkeys in dialogs with a focused widget (e.g. the F5 save/load dialog)

Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- dialog.cpp	6 Mar 2003 21:45:39 -0000	1.28
+++ dialog.cpp	22 Jul 2003 16:30:00 -0000	1.29
@@ -181,20 +181,20 @@
 	if (_focusedWidget) {
 		if (_focusedWidget->handleKeyDown(ascii, keycode, modifiers))
 			return;
-	} else {
-		// Hotkey handling
-		Widget *w = _firstWidget;
-		ascii = toupper(ascii);
-		while (w) {
-			if (w->_type == kButtonWidget && ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
-				// We first send a mouseDown then a mouseUp.
-				// FIXME: insert a brief delay between both.
-				w->handleMouseDown(0, 0, 1, 1);
-				w->handleMouseUp(0, 0, 1, 1);
-				return;
-			}
-			w = w->_next;
+	}
+
+	// Hotkey handling
+	Widget *w = _firstWidget;
+	ascii = toupper(ascii);
+	while (w) {
+		if (w->_type == kButtonWidget && ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
+			// The hotkey for widget w was pressed. We fake a mouse click into the
+			// button by invoking the appropriate methods.
+			w->handleMouseDown(0, 0, 1, 1);
+			w->handleMouseUp(0, 0, 1, 1);
+			return;
 		}
+		w = w->_next;
 	}
 
 	// ESC closes all dialogs by default





More information about the Scummvm-git-logs mailing list