menu reorganized
authorClaus Gittinger <cg@exept.de>
Thu, 12 Feb 2004 16:01:06 +0100
changeset 2867 4d21f141d0c9
parent 2866 9dd71df46f73
child 2868 0cbaeccd6a63
menu reorganized
CodeView.st
Workspace.st
--- a/CodeView.st	Thu Feb 12 16:00:50 2004 +0100
+++ b/CodeView.st	Thu Feb 12 16:01:06 2004 +0100
@@ -183,7 +183,7 @@
                           #Accept #Explain #Format)>
     <resource: #programMenu>
 
-    |m sub|
+    |m sub subsub|
 
     m := super editMenu.
     self sensor ctrlDown ifTrue:[
@@ -198,9 +198,11 @@
          codeViews do support #accept
          ... add it after #inspectIt
         "
-        m addLabels:(resources array:#('-' 'Accept'))
-          selectors:#(nil accept)
-          accelerators:#(nil #Accept)
+        m 
+          addItemList:#(
+                ('-')
+                ('Accept'       accept          Accept)       
+            )
           after:#inspectIt.
 
         (acceptEnabled == false 
@@ -213,16 +215,23 @@
         "
          and add #explain after $gotoLine in the extra menu
         "
-        sub addLabels:(resources array:#('-' 'Explain'))
-            selectors:#(nil explain)
-            accelerators:#(nil Explain)
-            after:#gotoLine.
+        sub 
+          addItemList:#(
+                ('-')
+                ('Explain'       explain          Explain)       
+            )
+          after:#gotoLine.
 
         formatAction notNil ifTrue:[
-            sub addLabels:(resources array:#('Format'))
-                selectors:#(format)
-                accelerators:#(Format)
-                after:#indent.
+            subsub := sub subMenuAt:#tools.
+
+            subsub notNil ifTrue:[
+                subsub
+                  addItemList:#(
+                        ('Format'       format          Format)       
+                    )
+                  after:#indent.
+            ].
         ].
         (self hasSelection not
         or:[explainAction isNil]) ifTrue:[
@@ -269,5 +278,5 @@
 !CodeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.49 2003-04-15 11:57:49 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/CodeView.st,v 1.50 2004-02-12 15:00:58 cg Exp $'
 ! !
--- a/Workspace.st	Thu Feb 12 16:00:50 2004 +0100
+++ b/Workspace.st	Thu Feb 12 16:01:06 2004 +0100
@@ -1023,7 +1023,7 @@
                          )>
     <resource: #programMenu>
 
-    |m sub idx sensor s s2|
+    |m sub subsub idx sensor s s2|
 
     m := super editMenu.
     ((sensor := self sensor) notNil and:[sensor ctrlDown]) ifTrue:[
@@ -1034,36 +1034,32 @@
     ].
 
     sub notNil ifTrue:[
+
         "
-         workspaces support #browse, implementors etc.
-         add them after paste.
+         workspaces support #browse, implementors etc. add them after paste.
         "
-        sub addLabels:(resources array:#(
-                                       '-' 
-                                       'Browse' 
-                                       'Senders of It' 
-                                       'Implementors of It' 
-                                       'References to It' 
-                                       '-' 
-                                       'TimeIt' 
-                                       'SpyOnIt'
-                                       '-' 
-                                       'Comment' 
-                                       'Uncomment' ))
-          selectors:#(nil 
-                      browseIt browseSendersOfIt browseImplementorsOfIt browseReferencesToIt 
-                      nil 
-                      timeIt spyOnIt
-                      nil 
-                      commentSelection uncommentSelection)
-          accelerators:#(nil 
-                         BrowseIt nil ImplementorsOfIt nil 
-                         nil    
-                         nil nil 
-                         nil 
-                         CommentSelection UncommentSelection)
+        sub 
+            addItemList:#(
+                ('-'                                                               )
+                ('Browse'               browseIt                BrowseIt            )
+                ('Senders of It'        browseSendersOfIt                           )
+                ('Implementors of It'   browseImplementorsOfIt  ImplementorsOfIt    )
+                ('References to It'     browseReferencesToIt                        )
+                ('-'                                                                )
+                ('TimeIt'               timeIt                                      )
+                ('SpyOnIt'              spyOnIt                                     ))
           after:#gotoLine.
 
+        subsub := sub subMenuAt:#tools.
+        subsub notNil ifTrue:[
+            subsub
+                addItemList:#(
+                    ('-'                                                                )
+                    ('Comment'              commentSelection        CommentSelection    )
+                    ('Uncomment'            uncommentSelection      UncommentSelection  ))
+              after:#'indent'.
+        ].
+
         self hasSelection ifFalse:[
             sub disableAll:#(browseIt browseImplementorsOfIt browseSendersOfIt browseReferencesToIt timeIt spyOnIt
                               commentSelection uncommentSelection ) 
@@ -1098,9 +1094,12 @@
         idx := m indexOf:#paste.
         idx == 0 ifTrue:[idx := m indexOf:#pasteOrReplace].
         idx ~~ 0 ifTrue:[
-            m addLabels:(resources array:#('-' 'DoIt' 'PrintIt' 'InspectIt'))
-              selectors:#(nil doIt printIt inspectIt)
-              accelerators:#(nil #DoIt #PrintIt #InspectIt)
+            m 
+              addItemList:#(
+                ('-'                                )
+                ('DoIt'         doIt        DoIt     )
+                ('PrintIt'      printIt     PrintIt  )
+                ('InspectIt'    inspectIt   InspectIt))
               after:idx.
             
         ].
@@ -1183,5 +1182,5 @@
 !Workspace class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.135 2003-09-10 15:14:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Workspace.st,v 1.136 2004-02-12 15:01:06 cg Exp $'
 ! !