no separate save of help keys
authortz
Thu, 22 Jan 1998 20:06:18 +0100
changeset 455 117dcae8b5e0
parent 454 8b016ffd83ce
child 456 e2bbb3f9c5fd
no separate save of help keys
MenuEditor.st
--- a/MenuEditor.st	Thu Jan 22 19:40:24 1998 +0100
+++ b/MenuEditor.st	Thu Jan 22 20:06:18 1998 +0100
@@ -129,22 +129,35 @@
 
   ^ super helpSpec addPairsFrom:#(
 
+#aboutSTX
+'Open an InfoBox about running ST/X.'
+
+#aboutThisAppliaction
+'Open an InfoBox about release and author.'
+
 #accessCharaterPos
-'The index of the access character position
-into the textual label (optional).'
+'The index of the access character position into the textual label (optional).'
 
 #argument
-'An argument passed to the value method, if the value 
-selector is a one- or two-arg selector (i.e. ends with '':'').
-The argument is passed as a string.'
+'An argument passed to the value method, if the value  selector is a one- or two-arg selector (i.e. ends with '':''). The argument is passed as a string.'
 
 #enbled
-'This enabled field specifies the name of the aspect (-method or binding)
-in your application, which returns a value holder holding a boolean,
-a block which evaluates to either true or false, a selector which returns
-either true or false or simply true or false. The value, true or false,
-specifies whether  the respective field can be selected, a value of true,
-or not, a value of false.'
+'This enabled field specifies the name of the aspect (-method or binding) in your application, which returns a value holder holding a boolean, a block which evaluates to either true or false, a selector which returns either true or false or simply true or false. The value, true or false, specifies whether  the respective field can be selected, a value of true, or not, a value of false.'
+
+#fileExit
+'Exit current application.'
+
+#helpClassDocumentation
+'Open a HTML-browser with a class documentation for the current application.'
+
+#helpProgrammersGuide
+'Open a HTML-browser with a programmers guide.'
+
+#helpShowHelp
+'Toggle on/off displaying help texts.'
+
+#helpTutorial
+'Open a HTML-browser with tutorial for beginners.'
 
 #icon
 'Selector which returns an image to be displayed.'
@@ -153,29 +166,19 @@
 'Boolean flag to specify that both image and textual label shall be shown.'
 
 #indication
-'This indication field specifies the name of the aspect (-method or binding)
-in your application, a value holder holding a boolean, a block which evaluates
-to either true or false, a selector which returns either true or false or
-simply true or false. The value, true or false, specifies whether the shown
-indicator is switched on or off.'
+'This indication field specifies the name of the aspect (-method or binding) in your application, a value holder holding a boolean, a block which evaluates to either true or false, a selector which returns either true or false or simply true or false. The value, true or false, specifies whether the shown indicator is switched on or off.'
 
 #label
-'The label of the item. If the ''retriever/selector'' is set, 
-and returns an image, the image is used as the displayed label. 
-Dependent on the state of the ''Image & Label'' flag, both
-the image and the label are shown.'
+'The label of the item. If the ''retriever/selector'' is set,  and returns an image, the image is used as the displayed label.  Dependent on the state of the ''Image & Label'' flag, both the image and the label are shown.'
 
 #menuSelector
-'The name of the selector under which the generated 
-menu should be installed and is accessable.'
+'The name of the selector under which the generated  menu should be installed and is accessable.'
 
 #nameKey
 'An unique identifier of the item (optional)'
 
 #retriever
-'The name of the class, which implements the image selector. 
-This selector is specified by ''selector''. If no class is given, 
-the current application should implement the specified image selector.'
+'The name of the class, which implements the image selector.  This selector is specified by ''selector''. If no class is given,  the current application should implement the specified image selector.'
 
 #seperatorList
 'The list of valid separators'
@@ -184,15 +187,10 @@
 'The key to be pressed, to select the menu item from the keyboard (accelerator key).'
 
 #submenuChannel
-'A value holder, which provides the submenu (Menu) to be opened
-if the item is selected. Useful if the items submenu is to be 
-changed dynamically.'
+'A value holder, which provides the submenu (Menu) to be opened if the item is selected. Useful if the items submenu is to be  changed dynamically.'
 
 #value
-'An action which can be either a block or a selector. Depending on the number
-of arguments to the action, the action will be called with the respective arguments.
-There can either zero, one or two arguments. The first argument to the action is the
-argument derived from the argument field and the second argument the selected item.'
+'An action which can be either a block or a selector. Depending on the number of arguments to the action, the action will be called with the respective arguments. There can either zero, one or two arguments. The first argument to the action is the argument derived from the argument field and the second argument the selected item.'
 
 )
 ! !
@@ -313,11 +311,6 @@
                           #'value:' #doInstallSpec
                       )
                        #(#MenuItem
-                          #'label:' 'Save Help Spec'
-                          #'value:' #doInstallHelp
-                          #'enabled:' #isStandAlone
-                      )
-                       #(#MenuItem
                           #'label:' '-'
                       )
                        #(#MenuItem
@@ -1377,6 +1370,13 @@
     self helpTool dictionary:aDictionary
 ! !
 
+!MenuEditor methodsFor:'active help'!
+
+defaultInfoLabel
+
+    ^(specClass ? 'No class defined') printString, ' << ', self treeView selectorName
+! !
+
 !MenuEditor methodsFor:'aspects'!
 
 aspectFor:aKey
@@ -1714,7 +1714,7 @@
         aClass isString ifTrue: [className := aClass].
         message := className, ' ', aSelector.
         self addToHistory: message -> #loadFromMessage:.
-        self valueOfInfoLabel value: className, ' << ', aSelector
+        self valueOfInfoLabel value: self defaultInfoLabel
     ].
 
     self treeView selection: 2.
@@ -1940,14 +1940,6 @@
     self loadFromInClassesOf: #Object
 !
 
-doInstallHelp
-    "install help text
-    "
-    self isStandAlone ifTrue:[
-        self helpTool installHelpSpecInto:(self specClass)
-    ]
-!
-
 doInstallSpec
     |cls selector treeView menu spec mthd category code|
 
@@ -2002,11 +1994,9 @@
     code := code withCRs.
     (ReadStream on:code) fileIn.
 
-    "(cls compiledMethodAt:selector) isNil ifTrue:[
-        code := self class generateCodeFor:cls menuSelector:selector.
-        code := code withCRs.
-        (ReadStream on:code) fileIn.
-    ]."
+    self isStandAlone ifTrue:[
+        self helpTool installHelpSpecInto:(self specClass)
+    ].
     didInstall := true.
     isModified := false.