MenuPanel.st
changeset 6110 6c133049a6f2
parent 6093 677f63c83293
child 6116 7cd3c708293e
--- a/MenuPanel.st	Sun Aug 11 19:49:56 2019 +0200
+++ b/MenuPanel.st	Wed Aug 14 16:04:55 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1997 by eXept Software AG
               All Rights Reserved
@@ -3663,7 +3665,7 @@
                           #Tab #FocusNext #FocusPrevious
                           #CursorLeft #CursorRight )>
 
-    |menu menusSuperMenu sensor|
+    |activeMenu menusSuperMenu sensor|
 
     sensor := self sensor.
 
@@ -3678,17 +3680,25 @@
         self stopScrollActivity.
     ].
 
-       (key == #Tab
-    or:[key == #FocusNext
-    or:[key == #FocusPrevious]]) ifTrue:[
+    "/ the activeMenu is either self or the currently open sub(sub) menu
+    activeMenu := self detectGrabMenu.
+    menusSuperMenu := activeMenu superMenu.
+
+    (key == #Tab
+      or:[key == #FocusNext
+      or:[key == #FocusPrevious]]
+    ) ifTrue:[
+        key == #Tab ifTrue:[
+            superMenu isNil ifTrue:[
+                self handleCursorKey:#CursorRight.
+                ^ self.
+            ]
+        ].
         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:[
@@ -3701,9 +3711,9 @@
         ^ self
     ].
 
-    menu isViewWrapper ifFalse:[
+    activeMenu isViewWrapper ifFalse:[
         sensor compressKeyPressEventsWithKey:key.
-        menu handleKeyPress:key.
+        activeMenu handleKeyPress:key.
         ^ self
     ].
     menusSuperMenu == self ifFalse:[^ self].
@@ -4256,6 +4266,12 @@
         self handleReturnPressed.
         ^ true.
     ].
+    "/ (key == #Tab) ifTrue:[
+    "/     superMenu isNil ifTrue:[
+    "/         self handleCursorKey:#CursorRight.
+    "/         ^ true
+    "/     ].
+    "/ ].
     key isCharacter ifTrue:[
 "/            selection notNil ifTrue:[
 "/                inMenu := self
@@ -4292,7 +4308,7 @@
 !
 
 handleReturnPressed
-    "any key is pressed"
+    "return (or space) key is pressed"
 
     |sensor subm item|
 
@@ -5246,7 +5262,7 @@
      we have non translated sub menus (when using them later for viewing).
      Problem expecco Menu 'View' was somethimes untranslated and somethimes not.
      Dependent if this code was called before the user did open (instantiate) the menu via the application.
-     May also the shortcuts itself could vary when translated 'Open &File' -> 'Datei &öffnen' ????"
+     May also the shortcuts itself could vary when translated 'Open &File' -> 'Datei &öffnen' ????"
     Menu::NeedResourcesQuery answer:true do:[
 "/    Menu::NeedResourcesQuery answer:false do:[
         [true] whileTrue:[