stripped down menu, if in browser
authorClaus Gittinger <cg@exept.de>
Fri, 10 Feb 2006 17:02:00 +0100
changeset 1969 f1763f6f4500
parent 1968 1a8b9416db6e
child 1970 279cc79d6e27
stripped down menu, if in browser
ImageEditor.st
--- a/ImageEditor.st	Fri Feb 10 16:56:33 2006 +0100
+++ b/ImageEditor.st	Fri Feb 10 17:02:00 2006 +0100
@@ -1572,6 +1572,51 @@
          
         )
       )
+!
+
+windowSpecInBrowser
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "
+     UIPainter new openOnClass:ImageEditor andSelector:#windowSpecInBrowser
+     ImageEditor new openInterface:#windowSpecInBrowser
+    "
+
+    <resource: #canvas>
+
+    ^ 
+     #(FullSpec
+        name: windowSpecInBrowser
+        window: 
+       (WindowSpec
+          label: 'Image Editor'
+          name: 'Image Editor'
+          min: (Point 400 320)
+          bounds: (Rectangle 0 0 450 350)
+          menu: menu
+        )
+        component: 
+       (SpecCollection
+          collection: (
+           (MenuPanelSpec
+              name: 'ToolBar1'
+              layout: (LayoutFrame 0 0 0 0 0 1 30 0)
+              menu: menu
+            )
+           (UISubSpecification
+              name: 'SubSpecification1'
+              layout: (LayoutFrame 0 0 30 0 0 1 0 1)
+              majorKey: ImageEditor
+              minorKey: windowSpec
+            )
+           )
+         
+        )
+      )
 ! !
 
 !ImageEditor class methodsFor:'menu specs'!
@@ -1736,6 +1781,7 @@
                   label: 'Next in Sequence'
                   itemValue: nextImageInSequence
                   translateLabel: true
+                  isVisible: notInBrowser
                 )
                (MenuItem
                   label: '-'
@@ -1810,6 +1856,7 @@
                 )
                (MenuItem
                   label: '-'
+                  isVisible: notInBrowser
                 )
                (MenuItem
                   activeHelpKey: fileBrowseClass
@@ -1817,20 +1864,24 @@
                   label: 'Browse Class'
                   itemValue: doBrowseClass
                   translateLabel: true
+                  isVisible: notInBrowser
                 )
                (MenuItem
                   label: 'Inspect Image'
                   itemValue: doInspectImage
                   translateLabel: true
+                  isVisible: notInBrowser
                 )
                (MenuItem
                   label: '-'
+                  isVisible: notInBrowser
                 )
                (MenuItem
                   activeHelpKey: fileExit
                   label: 'Exit'
                   itemValue: closeRequest
                   translateLabel: true
+                  isVisible: notInBrowser
                 )
                )
               nil
@@ -2267,6 +2318,7 @@
          (MenuItem
             label: 'History'
             translateLabel: true
+            isVisible: notInBrowser
             submenuChannel: menuHistory
           )
          (MenuItem
@@ -2945,6 +2997,12 @@
     ^ holder
 ! !
 
+!ImageEditor methodsFor:'aspects-menu item visibility'!
+
+notInBrowser
+    ^ self masterApplication isNil
+! !
+
 !ImageEditor methodsFor:'change & update'!
 
 findColorMapMode
@@ -3312,14 +3370,16 @@
 !ImageEditor methodsFor:'help'!
 
 defaultInfoLabel
-    "returns the default info label"
+    "returns the text shown in the info label, when the mouse is NOT over
+     some widget with a help text."
 
     |resourceClass resourceSelector|
 
     resourceClass := imageEditView resourceClass.
     resourceClass notNil ifTrue:[
+        resourceSelector := imageEditView resourceSelector.
         resourceSelector notNil ifTrue:[
-            ^ resourceClass name, ' >> ', imageEditView resourceSelector
+            ^ resourceClass name, ' >> ', resourceSelector
         ].
     ].
     ^ 'No class and selector defined.'
@@ -3340,9 +3400,17 @@
     (class isNil or:[selector]) isNil ifTrue:[
         imageEditView resourceClass:class.
         imageEditView resourceSelector:selector.
+        imageEditView image:nil.
         ^ self.
     ].
 
+    (imageEditView resourceClass == class
+    and:[ imageEditView resourceSelector == selector ]) ifTrue:[
+        imageEditView modified ifFalse:[
+            ^ self.
+        ].
+    ].
+
     (imageEditView loadFromClass:class selector:selector) notNil ifTrue:[
         self updateAfterImageChange.
     ]