#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Sat, 02 Mar 2019 11:48:42 +0100
changeset 8653 4d98ee627e6a
parent 8652 5bc99411c4bd
child 8654 07d3251ec28f
#REFACTORING by cg class: SimpleView changed: #activateMenu don't call midlleButtonMenu twice (in case it is constructed)
SimpleView.st
--- a/SimpleView.st	Fri Mar 01 18:32:33 2019 +0100
+++ b/SimpleView.st	Sat Mar 02 11:48:42 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -8457,18 +8455,19 @@
 
     |menu menuPerformer actionSelector prevReceiver wg|
 
-    self middleButtonMenu isNil ifTrue:[
-        "
-         try ST-80 style menus first:
-         if there is a model, and a menuMessage is defined,
-         ask model for the menu and launch that if non-nil.
-        "
+    (menu := self middleButtonMenu) notNil ifTrue:[
+        "/
+        "/ old style static menu
+        "/
+        self activateMenu:menu
+    ] ifFalse:[    
+        "/ try ST-80 style menus first:
+        "/ if there is a model, and a menuMessage is defined,
+        "/ ask model for the menu and launch that if non-nil.
         menu := self yellowButtonMenu.
         menu notNil ifTrue:[
-            "
-             got one, launch the menu. It is supposed
-             to return an actionSelector.
-            "
+            "/ got one, launch the menu. 
+            "/ It is supposed to return an actionSelector.
             menuPerformer := self menuPerformer value.
 
             "/ could be a spec ...
@@ -8507,7 +8506,6 @@
                     menu receiver:self.    "/ really ?
                     menu menuPerformer:menuPerformer.
                 ] ifFalse:[
-                "/ ] ifTrue:[
                     "/ new style menu
                     menu receiver:menuPerformer.
                 ]
@@ -8527,21 +8525,15 @@
             (actionSelector notNil and:[actionSelector isSymbol]) ifTrue:[
                 self dispatchMenuSelection:actionSelector to: menuPerformer.
             ].
-
             menu receiver:prevReceiver.
-
             ^ self
         ].
     ].
 
-    "/
-    "/ old style static menu
-    "/
-    super activateMenu
-
     "Created: / 01-03-1996 / 13:24:18 / cg"
     "Modified: / 14-08-1998 / 18:09:31 / cg"
     "Modified: / 08-03-2018 / 21:51:07 / mawalch"
+    "Modified: / 02-03-2019 / 11:42:51 / Claus Gittinger"
 !
 
 dispatchMenuSelection:menuSelection to:aMenuPerformerOrNil