MenuPanel.st
changeset 5578 68aef50b064e
parent 5573 1be3b54eeb1d
child 5619 657eee4bfe48
--- a/MenuPanel.st	Wed Aug 16 22:44:40 2017 +0200
+++ b/MenuPanel.st	Thu Aug 17 10:12:44 2017 +0200
@@ -3547,8 +3547,8 @@
     "any key is pressed"
 
     <resource: #keyboard (#Escape
-			  #Tab #FocusNext #FocusPrevious
-			  #CursorLeft #CursorRight )>
+                          #Tab #FocusNext #FocusPrevious
+                          #CursorLeft #CursorRight )>
 
     |menu menusSuperMenu sensor|
 
@@ -3559,47 +3559,53 @@
 "/    ].
 
     self scrollActivity isActive ifTrue:[
-	key ~~ #Escape ifTrue:[
-	    ^ self
-	].
-	self scrollActivity stop
+        key ~~ #Escape ifTrue:[
+            ^ self
+        ].
+        self scrollActivity stop
     ].
 
        (key == #Tab
     or:[key == #FocusNext
     or:[key == #FocusPrevious]]) ifTrue:[
-	self accept:nil.
-	^ super keyPress:key x:x y:y
+        self accept:nil.
+        super keyPress:key x:x y:y.
+        ^ self
     ].
 
     menu := self detectGrabMenu.
     menusSuperMenu := menu superMenu.
 
     (key == #Escape) ifTrue:[
-	"/ must hide the active menu
-	menusSuperMenu notNil ifTrue:[
-	    "/ hide active menu but keep the grab
-	    menusSuperMenu selection hideSubmenu
-	] ifFalse:[
-	    "/ hide active menu and ungrab
-	    self accept:nil
-	].
-	^ self
+        "/ must hide the active menu
+        menusSuperMenu notNil ifTrue:[
+            "/ hide active menu but keep the grab
+            menusSuperMenu selection hideSubmenu
+        ] ifFalse:[
+            "/ hide active menu and ungrab
+            self accept:nil
+        ].
+        ^ self
     ].
 
     menu isViewWrapper ifFalse:[
-	sensor compressKeyPressEventsWithKey:key.
-	menu handleKeyPress:key.
-	^ self
+        sensor compressKeyPressEventsWithKey:key.
+        menu handleKeyPress:key.
+        ^ self
     ].
     menusSuperMenu == self ifFalse:[^ self].
 
     "/ allow cursor movement
     (key == #CursorLeft or:[key == #CursorRight]) ifTrue:[
-	(self containsPoint:x@y) ifTrue:[
-	    self handleKeyPress:key.
-	]
-    ].
+        (self containsPoint:x@y) ifTrue:[
+            self handleKeyPress:key.
+            ^ self
+        ]
+    ].
+
+    super keyPress:key x:x y:y
+
+    "Modified: / 17-08-2017 / 09:05:43 / cg"
 !
 
 mapped
@@ -3686,13 +3692,14 @@
 
     |view x y p syntheticEvent menu|
 
-    ev isDamage ifTrue:[
-        ^ super dispatchEvent:ev withFocusOn:focusView delegate:false.
-    ].
     device isNil ifTrue:[
         "/ 'MenuPanel - leftover event ignored' infoPrintCR.
         ^ self
     ].
+    ev isDamage ifTrue:[
+        super dispatchEvent:ev withFocusOn:focusView delegate:false.
+        ^ self.
+    ].
 
     (superMenu isNil and:[ev isButtonPressEvent]) ifTrue:[
         focusView ~~ self ifTrue:[prevFocusView := focusView].
@@ -3708,7 +3715,8 @@
     ].
 
     ((x := ev x) isNil or:[(y := ev y) isNil]) ifTrue:[
-        ^ super dispatchEvent:ev withFocusOn:focusView delegate:false.
+        super dispatchEvent:ev withFocusOn:focusView delegate:false.
+        ^ self
     ].
 
     implicitGrabView notNil ifTrue:[
@@ -3729,7 +3737,8 @@
 
     (menu isNil or:[menu isViewWrapper not]) ifTrue:[
         self clearImplicitGrab.
-        ^ super dispatchEvent:ev withFocusOn:focusView delegate:false
+        super dispatchEvent:ev withFocusOn:focusView delegate:false.
+        ^ self    
     ].
 
     p := menu translateGrabPoint:(x@y).
@@ -3771,8 +3780,8 @@
     ev y:p y.
     view dispatchEvent:ev withFocusOn:focusView delegate:false.
 
-    "Modified: / 10-10-2001 / 13:54:47 / cg"
     "Modified (comment): / 15-03-2017 / 19:45:52 / stefan"
+    "Modified: / 17-08-2017 / 09:26:47 / cg"
 !
 
 handleButtonMotion:state atPoint:motionPoint