must accept an inputField before
authorClaus Gittinger <cg@exept.de>
Thu, 19 Aug 2004 12:09:08 +0200
changeset 2007 014e4bfe31f1
parent 2006 83d2e7259fcf
child 2008 bc367a4d7d6a
must accept an inputField before closing
KeyboardProcessor.st
--- a/KeyboardProcessor.st	Thu Aug 19 11:07:52 2004 +0200
+++ b/KeyboardProcessor.st	Thu Aug 19 12:09:08 2004 +0200
@@ -193,7 +193,7 @@
      (which lead to Accept & Cancel resp.)
      Finally, menu-shortcuts are handled."
 
-    |key rawKey topView wg app view action focusView|
+    |key rawKey topView wg app view action explicitFocusView focusView|
 
     view := event view.
 
@@ -232,14 +232,18 @@
         topView isModal ifTrue:[
             (key == #Return and:[returnIsOKInDialog ? true]) ifTrue:[
                 (wg notNil 
-                and:[(focusView := wg explicitFocusView) isNil
-                      or:[ focusView isKeyboardConsumer not 
-                          or:[ focusView isInputField ] ]
-                ])  ifTrue:[
-                    (wg focusView notNil
-                    and:[wg focusView isTextView]) ifTrue:[
-                        "/ modalBox with a TextView
-                        ^ false
+                and:[(explicitFocusView := wg explicitFocusView) isNil
+                      or:[ explicitFocusView isKeyboardConsumer not 
+                      or:[ explicitFocusView isInputField ] ]
+                ]) ifTrue:[
+                    ((focusView := wg focusView) notNil and:[focusView isTextView]) ifTrue:[
+                        focusView isInputField ifFalse:[
+                            "/ modalBox with a TextView
+                            ^ false
+                        ].
+                        focusView isAcceptOnReturn ifTrue:[
+                            focusView accept
+                        ].
                     ].
 
                     self requestGlobalAutoAccept ifFalse:[^ true].
@@ -331,5 +335,5 @@
 !KeyboardProcessor class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/KeyboardProcessor.st,v 1.34 2004-08-19 09:07:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/KeyboardProcessor.st,v 1.35 2004-08-19 10:09:08 cg Exp $'
 ! !