code cleanup
authorClaus Gittinger <cg@exept.de>
Tue, 08 Apr 2003 16:44:28 +0200
changeset 1702 ace326bd303f
parent 1701 079827c2760d
child 1703 7cf51b5b6ac5
code cleanup
MenuEditor.st
--- a/MenuEditor.st	Tue Apr 08 14:26:09 2003 +0200
+++ b/MenuEditor.st	Tue Apr 08 16:44:28 2003 +0200
@@ -327,7 +327,7 @@
 'Some additional value - for arbitrary use by the program.'
 
 #detailsEnabled
-'Aspect or binding providing a boolean value holder for the enable-state of the menu item.'
+'Aspect or binding providing a boolean value holder to enable/disable the menu item.'
 
 #detailsStartGroup
 'Specify start of a right-aligned item group.'
@@ -357,7 +357,7 @@
 'Generates aspect methods for defined aspect selectors of the menu.'
 
 #hideMenuOnActivated
-'If on, the menu hides itself after the item was activated.'
+'If on, the menu hides itself after the item was activated (PopUp/PullDown-Menus only).'
 
 #horizontalLayout
 'If on, the submenu organizes its items horizontal insteat of vertical (default).'
@@ -372,7 +372,7 @@
 'Currently existing image resources.'
 
 #imageRetriever
-'Class implementing the image resource method. If no class is given, the current application class will be taken.'
+'Class implementing the image resource method. If unspecified, the application class is taken.'
 
 #imageSelector
 'Selector returning an image (sent to above or the application).'
@@ -381,7 +381,7 @@
 'Keep the linked menu after activation (do not destroy).'
 
 #sendToOriginator
-'Send action-Message to widget (instead of application).'
+'Send action-Message to widget (instead of application); only valid for PopUpMenus.'
 
 #settingsRedefineAspectMethods
 'Toggles the permission to overwrite existing aspect methods.'
@@ -390,7 +390,7 @@
 'If on, a busy cursor is shown while the items action is performing.'
 
 #triggerOnDown
-'If on, the items action is performed on mouse-button press (default is on button-release).'
+'If on, the items action is performed on mouse-button press (default is: on button-release).'
 
 )
 !
@@ -440,162 +440,6 @@
 #fileNew
 'New Spec'
 )
-!
-
-localHelpSpecStrings
-    "This resource specification was automatically generated
-     by the UIHelpTool of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIHelpTool may not be able to read the specification."
-
-    "
-     UIHelpTool openOnClass:MenuEditor    
-    "
-
-    <resource: #help>
-
-    ^ #(
-
-#addDelayedMenu
-'Add a new delayed menu to item.'
-
-#addDelayedSubMenuLink
-'Add a new linked delayed menu to item.'
-
-#addMenuItem
-'Add a new menu item.'
-
-#addMenuSeparator
-'Add a new menu separator.'
-
-#addSubMenu
-'Add a new sub menu.'
-
-#addSubMenuLink
-'Add a new linked sub menu.'
-
-#basicsAction
-'An action selector with 0, 1 (the argument field), or 2 (the selected item) arguments.'
-
-#basicsArgument
-'An optional arg passed with above selector, if it is a 1 or 2 arg selector (enter a Smalltalk literal).'
-
-#basicsChoice
-'Aspect for a boolean holder, block or method, specifying the choices state (RadioButton behavior).'
-
-#basicsChoiceValue
-'That choices value (typically number or symbol).'
-
-#basicsIndication
-'Aspect for boolean holder, block, or method, specifying the indication state (CheckToggle behavior).'
-
-#basicsIsButton
-'Button-like look and behavior.'
-
-#basicsKey
-'Internal key of the item (optional, for programmed accesses).'
-
-#basicsLabel
-'Label of the item.'
-
-#basicsMenu
-'Aspect providing the sub menu to be opened if item is selected (provide spec or valueHolder).'
-
-#basicsMenuArgument
-'An argument passed with the menu selector.'
-
-#basicsNameKey
-'Unique identifier of the item (optional).'
-
-#basicsSelector
-'Selector under which the generated menu spec is saved.'
-
-#basicsSeparatorType
-'List of valid separators.'
-
-#basicsTranslateLabel
-'Translate the label via the classes resource file (internationalization).'
-
-#browseResource
-'Search for methods with image resource.'
-
-#detailsAccelerator
-'Accelerator key to select the menu item from the keyboard (Cmdx or Ctrlx).'
-
-#detailsAccessCharaterPosition
-'Index of the access character position of the textual label (obsolete, VW compatibility).'
-
-#detailsAuxValue
-'Some additional value - for arbitrary use by the program.'
-
-#detailsEnabled
-'Aspect or binding providing a boolean value holder to enable/disable the menu item.'
-
-#detailsStartGroup
-'Specify start of a right-aligned item group.'
-
-#detailsVisibility
-'Boolean, or aspect or binding for a boolean holder controlling the visibility of the menu item.'
-
-#fileLoad
-'Open a dialog to select and load a menu spec from a class.'
-
-#fileNew
-'Create a new menu spec.'
-
-#filePickAMenu
-'Select a menu from an open view and read its specification'
-
-#fileSave
-'Save the menu spec (and the help spec, if modified).'
-
-#fileSaveAs
-'Open a dialog to save the menu spec (and the help spec, if modified).'
-
-#fileShowMenuSpec
-'Opens a Workspace showing the current menu spec.'
-
-#generateAspectMethods
-'Generates aspect methods for defined aspect selectors of the menu.'
-
-#hideMenuOnActivated
-'If on, the menu hides itself after the item was activated (PopUpMenus only).'
-
-#horizontalLayout
-'If on, the submenu organizes its items horizontal insteat of vertical (default).'
-
-#imageImageAndLabel
-'Toggle display of both image and textual label.'
-
-#imageImageEditor
-'Open an Image Editor on the resource method defined by retriever and selector.'
-
-#imageImageList
-'Currently existing image resources.'
-
-#imageRetriever
-'Class implementing the image resource method. If unspecified, the application class is taken.'
-
-#imageSelector
-'Selector returning an image (sent to above or the application).'
-
-#keepLinkedMenu
-'Keep the linked menu after activation (do not destroy).'
-
-#showBusyCursorWhilePerforming
-'If on, a busy cursor is shown while the items action is performing.'
-
-#sendToOriginator
-'Send action-Message to the widget (instead of application).'
-
-#settingsRedefineAspectMethods
-'Toggles the permission to overwrite existing aspect methods.'
-
-#triggerOnDown
-'If on, the items action is performed on mouse-button press (default is: on button-release).'
-
-)
 ! !
 
 !MenuEditor class methodsFor:'image specs'!
@@ -1873,8 +1717,6 @@
 !
 
 update:something with:aParameter from:changedObject
-    "Invoked when an object that I depend upon sends a change notification.
-    "
     notifyDisabledCounter ~~ 0 ifTrue:[ ^ self ].
 
     changedObject == selectionHolder ifTrue:[ ^ self selectionChanged ].
@@ -2073,7 +1915,7 @@
 !
 
 doDrop:aContext
-    "drop the DropContext into the hierachical list of items
+    "drop the dropContext into the hierachical list of items
     "
     |done item|
 
@@ -2087,7 +1929,7 @@
 
     done := false.
 
-    self addAndSelect:[
+    self addAndSelectValueOf:[
         done := true.
         aContext dropObjects collect:[:el| Item menuItem:(el theObject) ]
     ].
@@ -2261,7 +2103,7 @@
 
 !MenuEditor methodsFor:'private'!
 
-addAndSelect:aNoneArgBlockOrItem
+addAndSelectValueOf:aBlockOrItem
     "add an item(s) derived from the block; test if add operation
      is enabled. On success the new item(s) are returned otherwise nil.
     "
@@ -2282,7 +2124,7 @@
         index := index + 1.
         intoItem := intoItem parent.
     ].
-    newItem := aNoneArgBlockOrItem value.
+    newItem := aBlockOrItem value.
 
     newItem ifNotNil:[
         selectionHolder setValue:nil.
@@ -2619,35 +2461,36 @@
 doCreateItem
     "create a new Item
     "
-    self addAndSelect:[ ActionItem new translateLabel:true ].
+    self addAndSelectValueOf:[ ActionItem new translateLabel:true ].
 !
 
 doCreateLinkedMenu
     "create a new Linked Menu
     "
-    self addAndSelect:[ LinkedMenuItem new ].
+    self addAndSelectValueOf:[ LinkedMenuItem new ].
 !
 
 doCreateMenu
     "create a new Menu
     "
-    self addAndSelect:[ |item|
-        item := RegularMenuItem new.
-        item expand.
-        item
-    ].
+    self addAndSelectValueOf:
+        [ |item|
+            item := RegularMenuItem new.
+            item expand.
+            item
+        ].
 !
 
 doCreateSep
     "create a new Separator Item
     "
-    self addAndSelect:[ SeparatorItem new ].
+    self addAndSelectValueOf:[ SeparatorItem new ].
 !
 
 doCreateStandardEditMenu
     "create a standart edit menu
     "
-    self addAndSelect:[
+    self addAndSelectValueOf:[
         RegularMenuItem menu:(self class standardEditMenu) labeled:'Edit' translateLabel:true
     ].
 !
@@ -2655,7 +2498,7 @@
 doCreateStandardFileMenu
     "create a standart file menu
     "
-    self addAndSelect:[
+    self addAndSelectValueOf:[
         RegularMenuItem menu:(self class standardFileMenu) labeled:'File' translateLabel:true
     ].
 !
@@ -2665,7 +2508,7 @@
     "
     |item|
 
-    self addAndSelect:[
+    self addAndSelectValueOf:[
         item := RegularMenuItem menu:(self class standardHelpMenu) labeled:'Help' translateLabel:true.
         item aspectAt:#startGroup put:#right.
         item
@@ -2758,7 +2601,7 @@
     ].
     loMenuItems isEmpty ifTrue:[ ^ self ].
 
-    self addAndSelect:[
+    self addAndSelectValueOf:[
         loMenuItems collect:[:el| Item menuItem:el ]
     ].
 ! !
@@ -4775,8 +4618,6 @@
 !
 
 update:what with:aPara from:aModel
-    "Invoked when an object that I depend upon sends a change notification."
-
     |item|
 
     self modifiedChannel value:true.