better menu
authorClaus Gittinger <cg@exept.de>
Tue, 24 Jan 2006 17:27:21 +0100
changeset 6491 d02c41c57d02
parent 6490 bf40a970fe9a
child 6492 9c446e709216
better menu
ContextInspectorView.st
InspectorView.st
OrderedCollectionInspectorView.st
SetInspectorView.st
--- a/ContextInspectorView.st	Tue Jan 24 17:24:13 2006 +0100
+++ b/ContextInspectorView.st	Tue Jan 24 17:27:21 2006 +0100
@@ -364,44 +364,66 @@
 
 !ContextInspectorView methodsFor:'initialization'!
 
+initialize
+    super initialize.
+    showingTemporaries := false.
+
+! !
+
+!ContextInspectorView methodsFor:'menu'!
+
 fieldMenu
     "return a popUpMenu for the left (fields) pane"
 
     <resource: #programMenu >
 
-    |items m|
+    |items m sel|
+
+    items := #(
+                   ('Copy Name or Key'      #doCopyKey)
+                   ('-')
+                   ('Inspect'               #doInspect)
+                   ('BasicInspect'          #doBasicInspect)
+                   ('Inspect Hierarchical'  #doNewInspect)
+                   ('-')
+                   ('Browse'                #browse)
+              ).
+
+    sel := self selection.
+
+    (sel isBlock or:[sel isContext]) ifTrue:[
+        items := items , #(
+                       ('Browse Blocks Home'           #browseHome)
+              ).
+    ].
+    (sel isKindOf:Filename) ifTrue:[
+        items := items , #(
+                   ('Open Filebrowser'  #openFileBrowser)
+                  ).
+    ].
+    items := items , #(
+               ('-')
+              ).
 
     showingTemporaries ifFalse:[
-        items := #(
-                        ('Inspect'          #doInspect)
-                        ('BasicInspect'     #doBasicInspect)
-                        ('-')
-                        ('Browse'               #browse)
-                        ('Browse blocks home'   #browseHome)
-                        ('-')
-                        ('Show temporaries' #showTemporaries)
+        items := items , #(
+                       ('Show Temporaries'      #showTemporaries)
                   )
     ] ifTrue:[
-        items := #(
-                        ('Inspect'          #doInspect)
-                        ('BasicInspect'     #doBasicInspect)
-                        ('-')
-                        ('Browse'               #browse)
-                        ('Browse blocks home'   #browseHome)
-                        ('-')
-                        ('Hide temporaries' #hideTemporaries)
+        items := items , #(
+                       ('Hide temporaries'      #hideTemporaries)
                   )
     ].
 
     showHex ifTrue:[
         items := items , #(
                         ('-')
-                        ('Decimal integers'  #toggleHex               )
+                        ('Decimal Integers'  #toggleHex               )
                           )
     ] ifFalse:[
         items := items , #(
                         ('-')
-                        ('Hex integers'      #toggleHex               )
+                        ('Hex Integers'      #toggleHex               )
                           )
     ].
     m := PopUpMenu
@@ -411,19 +433,16 @@
     selectionIndex isNil ifTrue:[
         m disableAll:#(doInspect doBasicInspect browse browseHome)
     ] ifFalse:[
-        self selection isBlock ifFalse:[
+        sel isBlock ifFalse:[
             m disable:#browseHome
-        ]
+        ].
+        sel class hasImmediateInstances ifTrue:[
+            m disableAll:#(showReferences doNewInspect)
+        ].
     ].
     ^ m
 
     "Modified: / 16.11.2001 / 13:02:35 / cg"
-!
-
-initialize
-    super initialize.
-    showingTemporaries := false.
-
 ! !
 
 !ContextInspectorView methodsFor:'private'!
@@ -624,5 +643,5 @@
 !ContextInspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.61 2005-10-18 09:11:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.62 2006-01-24 16:27:16 cg Exp $'
 ! !
--- a/InspectorView.st	Tue Jan 24 17:24:13 2006 +0100
+++ b/InspectorView.st	Tue Jan 24 17:27:21 2006 +0100
@@ -535,6 +535,7 @@
               ).
 
     sel := self selection.
+
     (sel isBlock or:[sel isContext]) ifTrue:[
         items := items , #(
                        ('Browse Blocks Home'           #browseHome)
@@ -623,7 +624,7 @@
     inspectHistory size == 0 ifTrue:[
         m disable:#doBack
     ].
-    self selection class hasImmediateInstances ifTrue:[
+    sel class hasImmediateInstances ifTrue:[
         m disableAll:#(showReferences doNewInspect)
     ].
     sel inspectorClass == self class ifFalse:[
@@ -1793,5 +1794,5 @@
 !InspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.159 2005-08-04 09:59:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.160 2006-01-24 16:27:21 cg Exp $'
 ! !
--- a/OrderedCollectionInspectorView.st	Tue Jan 24 17:24:13 2006 +0100
+++ b/OrderedCollectionInspectorView.st	Tue Jan 24 17:27:21 2006 +0100
@@ -45,24 +45,7 @@
 
 ! !
 
-!OrderedCollectionInspectorView methodsFor:'private'!
-
-baseInspectedObjectClass
-    (inspectedObject class inheritsFrom:OrderedCollection) ifFalse:[
-        ^ Object
-    ].
-    ^ OrderedCollection
-!
-
-defaultLabel
-    ^ 'Contents'
-
-    "
-     (OrderedCollection with:1 with:2 with:3) inspect
-    "
-
-    "Modified: 28.6.1996 / 16:06:24 / cg"
-!
+!OrderedCollectionInspectorView methodsFor:'menu'!
 
 fieldMenu
     "return the menu for the field-list"
@@ -136,6 +119,25 @@
     ^ m
 
     "Modified: / 21.5.1998 / 13:32:09 / cg"
+! !
+
+!OrderedCollectionInspectorView methodsFor:'private'!
+
+baseInspectedObjectClass
+    (inspectedObject class inheritsFrom:OrderedCollection) ifFalse:[
+        ^ Object
+    ].
+    ^ OrderedCollection
+!
+
+defaultLabel
+    ^ 'Contents'
+
+    "
+     (OrderedCollection with:1 with:2 with:3) inspect
+    "
+
+    "Modified: 28.6.1996 / 16:06:24 / cg"
 !
 
 indexList 
@@ -181,5 +183,5 @@
 !OrderedCollectionInspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/OrderedCollectionInspectorView.st,v 1.36 2005-06-21 16:01:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/OrderedCollectionInspectorView.st,v 1.37 2006-01-24 16:27:13 cg Exp $'
 ! !
--- a/SetInspectorView.st	Tue Jan 24 17:24:13 2006 +0100
+++ b/SetInspectorView.st	Tue Jan 24 17:27:21 2006 +0100
@@ -52,7 +52,7 @@
 "
 ! !
 
-!SetInspectorView methodsFor:'initialization'!
+!SetInspectorView methodsFor:'menu'!
 
 fieldMenu
     <resource: #programMenu >
@@ -184,5 +184,5 @@
 !SetInspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/SetInspectorView.st,v 1.21 2005-06-21 16:02:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/SetInspectorView.st,v 1.22 2006-01-24 16:27:18 cg Exp $'
 ! !