delegated keyboardMessages get nil as x/y
authorClaus Gittinger <cg@exept.de>
Mon, 04 Mar 1996 23:31:36 +0100
changeset 490 1d2ed059a063
parent 489 97c51a9ec661
child 491 246d832196af
delegated keyboardMessages get nil as x/y
KeybdFwd.st
KeyboardForwarder.st
SimpleView.st
--- a/KeybdFwd.st	Mon Mar 04 21:35:29 1996 +0100
+++ b/KeybdFwd.st	Mon Mar 04 23:31:36 1996 +0100
@@ -305,7 +305,7 @@
      forward the event (i.e. after I returned true on handlesKeyPress:.
      Take care of cyclic delegation (via a kludge-test for negative coordinate)."
 
-    x < 0 ifTrue:[
+    x isNil ifTrue:[
         "
          already delegated ... ignore
         "
@@ -317,17 +317,17 @@
     ].
 
     destination notNil ifTrue:[
-        destination keyPress:key x:-1 y:-1 view:aView.
+        destination keyPress:key x:nil y:nil view:aView.
     ] ifFalse:[
         destinationView notNil ifTrue:[
             WindowEvent
                 sendEvent:#keyPress:x:y:
-                arguments:(Array with:key with:-1 with:-1)
+                arguments:(Array with:key with:nil with:nil)
                 view:destinationView
         ]
     ]
 
-    "Modified: 4.2.1996 / 20:35:52 / cg"
+    "Modified: 4.3.1996 / 22:18:37 / cg"
 !
 
 keyRelease:key x:x y:y view:aView
@@ -422,5 +422,5 @@
 !KeyboardForwarder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/KeybdFwd.st,v 1.11 1996-02-04 19:40:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/KeybdFwd.st,v 1.12 1996-03-04 22:31:36 cg Exp $'
 ! !
--- a/KeyboardForwarder.st	Mon Mar 04 21:35:29 1996 +0100
+++ b/KeyboardForwarder.st	Mon Mar 04 23:31:36 1996 +0100
@@ -305,7 +305,7 @@
      forward the event (i.e. after I returned true on handlesKeyPress:.
      Take care of cyclic delegation (via a kludge-test for negative coordinate)."
 
-    x < 0 ifTrue:[
+    x isNil ifTrue:[
         "
          already delegated ... ignore
         "
@@ -317,17 +317,17 @@
     ].
 
     destination notNil ifTrue:[
-        destination keyPress:key x:-1 y:-1 view:aView.
+        destination keyPress:key x:nil y:nil view:aView.
     ] ifFalse:[
         destinationView notNil ifTrue:[
             WindowEvent
                 sendEvent:#keyPress:x:y:
-                arguments:(Array with:key with:-1 with:-1)
+                arguments:(Array with:key with:nil with:nil)
                 view:destinationView
         ]
     ]
 
-    "Modified: 4.2.1996 / 20:35:52 / cg"
+    "Modified: 4.3.1996 / 22:18:37 / cg"
 !
 
 keyRelease:key x:x y:y view:aView
@@ -422,5 +422,5 @@
 !KeyboardForwarder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.11 1996-02-04 19:40:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/KeyboardForwarder.st,v 1.12 1996-03-04 22:31:36 cg Exp $'
 ! !
--- a/SimpleView.st	Mon Mar 04 21:35:29 1996 +0100
+++ b/SimpleView.st	Mon Mar 04 23:31:36 1996 +0100
@@ -3484,35 +3484,40 @@
      Otherwise, forward it to the superview, if there is any."
 
     components notNil ifTrue:[
-	components do:[:aComponent |
-	    |thisFrame|
-
-	    thisFrame := aComponent frame.
-	    (thisFrame containsPointX:x y:y) ifTrue:[
-		aComponent keyPress:key x:x - thisFrame left
-					y:y - thisFrame top.
-		^ self
-	    ]
-	]
+        components do:[:aComponent |
+            |thisFrame|
+
+            thisFrame := aComponent frame.
+            (thisFrame containsPointX:x y:y) ifTrue:[
+                aComponent keyPress:key x:x - thisFrame left
+                                        y:y - thisFrame top.
+                ^ self
+            ]
+        ]
+    ].
+
+    key == #CmdM ifTrue:[
+        ^ self activateMenu.
     ].
 
-    x >= 0 ifTrue:[
-	superView notNil ifTrue:[
-	    WindowEvent
-		sendEvent:#keyPress:x:y:
-		arguments:(Array with:key with:0 with:0)
-		view:superView
-	] ifFalse:[
-	    super keyPress:key x:x y:y
-	]
+    x isNil ifTrue:[
+        "/ already redelegated, but nowhere handled
+        superView notNil ifTrue:[
+            superView keyPress:key x:nil y:nil.
+        ].
+        ^ self
+    ].
+
+    superView notNil ifTrue:[
+        WindowEvent
+            sendEvent:#keyPress:x:y:
+            arguments:(Array with:key with:0 with:0)
+            view:superView
     ] ifFalse:[
-	"/ already redelegated, but nowhere handled
-	superView notNil ifTrue:[
-	    superView keyPress:key x:-1 y:-1
-	]
+        super keyPress:key x:x y:y
     ]
 
-    "Modified: 1.2.1996 / 22:40:16 / cg"
+    "Modified: 4.3.1996 / 22:20:36 / cg"
 !
 
 mapped
@@ -5963,6 +5968,6 @@
 !SimpleView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.63 1996-03-04 20:34:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.64 1996-03-04 22:31:09 cg Exp $'
 ! !
 SimpleView initialize!