implement: triggerOnDown
authorca
Mon, 18 Sep 2000 11:56:06 +0200
changeset 1410 ec3abe12f662
parent 1409 176ae89e0b31
child 1411 9daf7add7ea3
implement: triggerOnDown
MenuEditor.st
--- a/MenuEditor.st	Thu Sep 14 18:39:12 2000 +0200
+++ b/MenuEditor.st	Mon Sep 18 11:56:06 2000 +0200
@@ -22,19 +22,19 @@
 	category:'Interface-UIPainter'
 !
 
+SelectionInTreeView subclass:#TreeView
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:MenuEditor
+!
+
 Object subclass:#Item
 	instanceVariableNames:'activeHelpKey enabled label value nameKey indication shortcutKey
 		accessCharacterPos retriever icon iconAndLabel submenuChannel
 		startGroup argument translateLabel isButton isVisible choice
 		choiceValue auxValue hideMenuOnActivated font
-		showBusyCursorWhilePerforming keepLinkedMenu'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:MenuEditor
-!
-
-SelectionInTreeView subclass:#TreeView
-	instanceVariableNames:''
+		showBusyCursorWhilePerforming keepLinkedMenu triggerOnDown'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:MenuEditor
@@ -115,6 +115,7 @@
         label
         accessCharacterPos
         showBusyCursorWhilePerforming
+        triggerOnDown
         font
         argument
         submenuChannel
@@ -256,7 +257,7 @@
 'Opens a dialog to save the menu spec (and the help spec, if modified).'
 
 #hideMenuOnActivated
-'Hide the menu after activation (turn off for checkToggles or radioButtons)'
+'if on, the action is triggered when pressed'
 
 #imageImageAndLabel
 'Toggles display of both image and textual label.'
@@ -277,8 +278,6 @@
 'Keep the linked menu after activation (do not destroy)'
 
 )
-
-    "Modified: / 4.2.2000 / 12:24:53 / cg"
 ! !
 
 !MenuEditor class methodsFor:'image specs'!
@@ -376,7 +375,7 @@
           #name: 'Basics Item'
           #min: #(#Point 10 10)
           #max: #(#Point 1160 870)
-          #bounds: #(#Rectangle 218 175 485 522)
+          #bounds: #(#Rectangle 898 390 1173 751)
         )
         #component: 
        #(#SpecCollection
@@ -430,14 +429,14 @@
            #(#LabelSpec
               #label: 'Action:'
               #name: 'valueLabel'
-              #layout: #(#AlignmentOrigin 107 0 90 0 1 0.5)
+              #layout: #(#AlignmentOrigin 107 0 85 0 1 0.5)
               #activeHelpKey: #basicsAction
               #resizeForLabel: true
               #adjust: #right
             )
            #(#InputFieldSpec
               #name: 'valueField'
-              #layout: #(#LayoutFrame 110 0 79 0 -5 1.0 101 0)
+              #layout: #(#LayoutFrame 110 0 74 0 -5 1.0 96 0)
               #activeHelpKey: #basicsAction
               #tabable: true
               #model: #value
@@ -453,14 +452,14 @@
            #(#LabelSpec
               #label: 'Argument:'
               #name: 'argumentLabel'
-              #layout: #(#AlignmentOrigin 107 0 115 0 1 0.5)
+              #layout: #(#AlignmentOrigin 107 0 110 0 1 0.5)
               #activeHelpKey: #basicsArgument
               #resizeForLabel: true
               #adjust: #right
             )
            #(#InputFieldSpec
               #name: 'argumentField'
-              #layout: #(#LayoutFrame 110 0 104 0 -5 1.0 126 0)
+              #layout: #(#LayoutFrame 110 0 99 0 -5 1.0 121 0)
               #activeHelpKey: #basicsArgument
               #tabable: true
               #model: #argument
@@ -476,14 +475,14 @@
            #(#LabelSpec
               #label: 'Indication:'
               #name: 'indicationLabel'
-              #layout: #(#AlignmentOrigin 107 0 155 0 1 0.5)
+              #layout: #(#AlignmentOrigin 107 0 144 0 1 0.5)
               #activeHelpKey: #basicsIndication
               #resizeForLabel: true
               #adjust: #right
             )
            #(#InputFieldSpec
               #name: 'indicationField'
-              #layout: #(#LayoutFrame 110 0 144 0 -5 1.0 166 0)
+              #layout: #(#LayoutFrame 110 0 133 0 -5 1.0 155 0)
               #activeHelpKey: #basicsIndication
               #enableChannel: #indicationEnabled
               #tabable: true
@@ -501,7 +500,7 @@
            #(#LabelSpec
               #label: 'Choice:'
               #name: 'choiceLabel'
-              #layout: #(#AlignmentOrigin 107 0 180 0 1 0.5)
+              #layout: #(#AlignmentOrigin 107 0 169 0 1 0.5)
               #activeHelpKey: #basicsChoice
               #translateLabel: true
               #resizeForLabel: true
@@ -509,7 +508,7 @@
             )
            #(#InputFieldSpec
               #name: 'choiceField'
-              #layout: #(#LayoutFrame 110 0 169 0 -5 1.0 191 0)
+              #layout: #(#LayoutFrame 110 0 158 0 -5 1.0 180 0)
               #activeHelpKey: #basicsChoice
               #enableChannel: #choiceEnabled
               #tabable: true
@@ -527,7 +526,7 @@
            #(#LabelSpec
               #label: 'Value:'
               #name: 'choiceValueLabel'
-              #layout: #(#AlignmentOrigin 107 0 205 0 1 0.5)
+              #layout: #(#AlignmentOrigin 107 0 194 0 1 0.5)
               #activeHelpKey: #basicsChoiceValue
               #translateLabel: true
               #resizeForLabel: true
@@ -535,7 +534,7 @@
             )
            #(#InputFieldSpec
               #name: 'choiceValueField'
-              #layout: #(#LayoutFrame 110 0 194 0 -5 1.0 216 0)
+              #layout: #(#LayoutFrame 110 0 183 0 -5 1.0 205 0)
               #activeHelpKey: #basicsChoiceValue
               #enableChannel: #choiceValueEnabled
               #tabable: true
@@ -553,7 +552,7 @@
            #(#CheckBoxSpec
               #label: 'Translate Label'
               #name: 'translateLabelCheckBox'
-              #layout: #(#Point 20 230)
+              #layout: #(#Point 20 218)
               #activeHelpKey: #basicsTranslateLabel
               #tabable: true
               #model: #translateLabel
@@ -561,7 +560,7 @@
            #(#CheckBoxSpec
               #label: 'Is Button'
               #name: 'isButtonCheckBox'
-              #layout: #(#Point 20 255)
+              #layout: #(#Point 20 243)
               #activeHelpKey: #basicsIsButton
               #tabable: true
               #model: #isButton
@@ -569,7 +568,7 @@
            #(#CheckBoxSpec
               #label: 'Hide Menu after Activation'
               #name: 'hideMenuOnActivated'
-              #layout: #(#Point 20 280)
+              #layout: #(#Point 20 267)
               #activeHelpKey: #hideMenuOnActivated
               #tabable: true
               #model: #hideMenuOnActivated
@@ -577,12 +576,21 @@
            #(#CheckBoxSpec
               #label: 'BusyCursor while Active'
               #name: 'showBusyCursorWhilePerforming'
-              #layout: #(#Point 20 305)
+              #layout: #(#Point 20 291)
               #activeHelpKey: #hideMenuOnActivated
               #tabable: true
               #model: #showBusyCursorWhilePerforming
               #translateLabel: true
             )
+           #(#CheckBoxSpec
+              #label: 'Trigger On Down'
+              #name: 'triggerOnDown'
+              #layout: #(#Point 20 315)
+              #activeHelpKey: #hideMenuOnActivated
+              #tabable: true
+              #model: #triggerOnDown
+              #translateLabel: true
+            )
            )
          
         )
@@ -2693,357 +2701,6 @@
     modified := true.
 ! !
 
-!MenuEditor::Item class methodsFor:'constants'!
-
-separatorList
-    "get the list of available separator types"
-
-    ^#('blank' 'single line' 'double line')
-!
-
-separatorSlices
-    "get the list of menu spec values of the corresponding separator types"
-
-   ^ #(
-        ( #blank        ''  )
-        ( #single       '-' )
-        ( #double       '=' )
-      )
-! !
-
-!MenuEditor::Item class methodsFor:'documentation'!
-
-documentation
-"
-    implements the contents assigned to a TreeItem. An instance
-    is associated with one item and keeps all its information
-
-    [see also:]
-        TreeItem
-        MenuEditor
-
-    [author:]
-        Claus Atzkern
-"
-
-
-! !
-
-!MenuEditor::Item methodsFor:'accessing'!
-
-activeHelpKey
-    "get the help key of the menu item"
-
-    ^activeHelpKey
-!
-
-activeHelpKey:aKey
-    "set the help key of the menu item"
-
-    activeHelpKey := aKey
-!
-
-label
-    "get the value of the menu item"
-
-    ^label
-!
-
-label:something
-    "set the value of the menu item"
-
-    label := something ? '-'
-!
-
-separatorType
-    "get the separator type assigned to item or nil"
-
-    label size > 1 
-    ifFalse:
-    [
-        label size  == 0  ifTrue:[^#blank].
-        label first == $- ifTrue:[^#single].
-        label first == $= ifTrue:[^#double].
-    ].    
-    ^nil
-
-!
-
-startGroup:aSymbolOrNil
-    "set the startGroup attribute"
-
-    startGroup := aSymbolOrNil
-
-    "Created: / 23.8.1998 / 15:56:03 / cg"
-!
-
-submenuChannel
-    "return the value of the instance variable 'submenuChannel' (automatically generated)"
-
-    ^submenuChannel
-!
-
-submenuChannel:aChannel
-    "get the submenuChannel"
-
-    submenuChannel := aChannel
-!
-
-translateLabel:aBoolean
-    "set/clear the translate to national-language flag"
-
-    translateLabel := aBoolean
-
-    "Created: / 6.6.1998 / 17:23:33 / cg"
-!
-
-value:aSymbol
-    "set the value attribute"
-
-    value := aSymbol
-
-    "Created: / 23.8.1998 / 16:02:10 / cg"
-! !
-
-!MenuEditor::Item methodsFor:'building'!
-
-buildFromAspects:aspects
-    "read the values of the aspects into my values"
-
-    |name|
-    self isSeparator 
-    ifFalse:
-    [
-        name  := label.
-        label := (aspects at:#label) value.
-
-        (label isNil or:[self isSeparator]) ifTrue:[
-            (aspects at:#label) value:(label := name)
-        ].
-
-        enabled            := (aspects at:#enabled) value.
-        value              := (aspects at:#value) value.
-        nameKey            := (aspects at:#nameKey) value.
-        indication         := (aspects at:#indication) value.
-        choice             := (aspects at:#choice) value.
-        choiceValue        := (aspects at:#choiceValue) value.
-        shortcutKey        := (aspects at:#shortcutKey) value.
-        startGroup         := (aspects at:#startGroup) value.
-        accessCharacterPos := (aspects at:#accessCharacterPos) value.
-        showBusyCursorWhilePerforming := (aspects at:#showBusyCursorWhilePerforming) value.
-        keepLinkedMenu     := (aspects at:#keepLinkedMenu) value ? false.
-        font               := (aspects at:#font) value.
-        argument           := (aspects at:#argument) value.
-        translateLabel     := (aspects at:#translateLabel) value.
-        isButton           := (aspects at:#isButton) value.
-        auxValue           := (aspects at:#auxValue) value.
-
-        argument isString ifTrue:[
-            argument size > 1 ifTrue:[
-                (argument at:1) == $# ifTrue:[
-                    argument := (argument copyFrom:2) asSymbol
-                ]
-            ]
-        ].
-        submenuChannel    := (aspects at:#submenuChannel) value.
-        retriever         := (aspects at:#retriever) value.
-        icon              := (aspects at:#icon) value.
-        iconAndLabel      := (aspects at:#iconAndLabel) value.
-    ]
-    ifTrue:
-    [
-        name  := (aspects at:#seperatorSelection) selectionIndex.
-        label := (self class separatorSlices at:name) last.
-    ].
-    isVisible := (aspects at:#isVisible) value.
-    hideMenuOnActivated := (aspects at:#hideMenuOnActivated) value.
-
-    "Modified: / 14.8.1998 / 15:36:38 / cg"
-!
-
-buildFromMenuItem:anItem
-    "read the attributes of anItem into my values"
-
-    |rtv|
-
-    self label:(anItem rawLabel).
-    activeHelpKey := anItem activeHelpKey.
-
-    (enabled := anItem enabled) isSymbol ifFalse:[
-        enabled := nil
-    ].
-    (value := anItem value) isSymbol ifFalse:[
-        value := nil.
-    ].
-    (indication := anItem indication) isSymbol ifFalse:[
-        indication := nil
-    ].
-    (choice := anItem choice) isSymbol ifFalse:[
-        choice := nil
-    ].
-    choiceValue         := anItem choiceValue.
-    nameKey             := anItem nameKey.
-    shortcutKey         := anItem shortcutKeyCharacter.
-    startGroup          := anItem startGroup.
-    accessCharacterPos  := anItem accessCharacterPosition.
-    showBusyCursorWhilePerforming  := anItem showBusyCursorWhilePerforming.
-    keepLinkedMenu      := anItem keepLinkedMenu.
-    font                := anItem font.
-    argument            := anItem argument.
-
-    submenuChannel      := anItem submenuChannel.
-    translateLabel      := anItem translateLabel.
-    isButton            := anItem isButton.
-    isVisible           := anItem isVisible.
-    hideMenuOnActivated := anItem hideMenuOnActivated.
-    auxValue            := anItem auxValue.
-
-    (((rtv := anItem adornment) notNil)
-    and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever])
-    ifTrue:
-    [
-        retriever := rtv className.
-        icon      := rtv selector.
-        (iconAndLabel := rtv labelText notNil) ifTrue:[
-            label := rtv labelText.
-        ]
-    ]
-
-    "Modified: / 29.9.1998 / 11:18:25 / cg"
-! !
-
-!MenuEditor::Item methodsFor:'conversion'!
-
-asMenuItem
-    "converts self to a menu item"
-
-    |item rcv|
-
-    item := MenuItem labeled:label.
-    item isVisible:isVisible.
-    item hideMenuOnActivated:hideMenuOnActivated.
-
-    self isSeparator ifFalse:[    
-        item activeHelpKey:activeHelpKey.
-        item enabled:enabled.
-        item accessCharacterPosition:accessCharacterPos.
-        item showBusyCursorWhilePerforming:showBusyCursorWhilePerforming.
-        item keepLinkedMenu:keepLinkedMenu.
-        item font:font.
-        item argument:argument.
-        item submenuChannel:submenuChannel.
-        item nameKey:nameKey.
-        item shortcutKeyCharacter:shortcutKey.
-        item startGroup:startGroup.
-        item value:value.
-        item indication:indication.
-        item choice:choice.
-        item choiceValue:choiceValue.
-        item translateLabel: translateLabel.
-        item isButton: isButton.
-        item auxValue: auxValue.
-
-        icon notNil ifTrue:[
-            rcv := ResourceRetriever new.
-            rcv className:retriever.
-            rcv selector:icon.
-            iconAndLabel == true ifTrue:[
-                rcv labelText:label
-            ].
-            item labelImage:rcv
-        ]
-    ].
-    ^item
-
-    "Modified: / 14.8.1998 / 15:36:35 / cg"
-!
-
-toAspects:aspects
-    "put my values into the values of aspects"
-
-    |type|
-    (type := self separatorType) notNil ifTrue: [
-        type := self class separatorSlices findFirst:[:el| el first == type ].
-        (aspects at:#seperatorSelection) selectionIndex:type.
-    ] ifFalse: [
-        (aspects at:#label)                value:label.
-        (aspects at:#enabled)              value:enabled.
-        (aspects at:#value)                value:value.
-        (aspects at:#nameKey)              value:nameKey.
-        (aspects at:#indication)           value:indication.
-        (aspects at:#choice)               value:choice.
-        (aspects at:#choiceValue)          value:choiceValue.
-        (aspects at:#shortcutKey)          value:shortcutKey.
-        (aspects at:#startGroup)           value:startGroup.
-        (aspects at:#accessCharacterPos)   value:accessCharacterPos.
-        (aspects at:#showBusyCursorWhilePerforming)   value:showBusyCursorWhilePerforming.
-        (aspects at:#keepLinkedMenu)       value:(keepLinkedMenu ? false).
-        (aspects at:#font)                 value:font.
-        (aspects at:#translateLabel)       value:translateLabel.
-        (aspects at:#submenuChannel)       value:submenuChannel.
-        (aspects at:#retriever)            value:retriever.
-        (aspects at:#icon)                 value:icon.
-        (aspects at:#iconAndLabel)         value:iconAndLabel.
-        (aspects at:#isButton)             value:isButton.
-        (aspects at:#auxValue)             value:auxValue.
-
-        (aspects at:#argument)
-            value:(argument isSymbol
-                        ifTrue: ['#', argument] 
-                        ifFalse:[argument]).
-    ].
-    (aspects at:#isVisible) value:isVisible.
-    (aspects at:#hideMenuOnActivated) value:(hideMenuOnActivated ? true).
-
-    "Modified: / 14.8.1998 / 15:37:29 / cg"
-! !
-
-!MenuEditor::Item methodsFor:'queries'!
-
-iconFor: aNode
-    "get the icon of the menu item for the tree view"
-
-    (aNode hasChildren or: [aNode parent isNil])
-    ifTrue:
-    [
-        ^MenuEditor submenuImage
-    ]
-    ifFalse:
-    [
-        submenuChannel notNil 
-        ifTrue:
-        [
-            ^MenuEditor linkSubmenuImage
-        ]
-        ifFalse:
-        [
-            self isSeparator 
-                ifTrue:  [^MenuEditor menuSeparatorImage]
-                ifFalse: [^MenuEditor menuItemImage]
-        ]
-    ]
-!
-
-isSeparator
-    "return true if item is a seperator"
-
-    ^self separatorType notNil
-!
-
-treeViewLabel
-    "get the label of the menu item for the tree view"
-
-    ^label
-" asBoldText, 
-        (value notNil ifTrue: [': [', 
-                value ,
-                (argument isString ifTrue: [' ', (Text string: argument emphasis: #italic)] ifFalse: ['']),
-                 ']'] ifFalse: [''])
-
-
-"
-! !
-
 !MenuEditor::TreeView class methodsFor:'documentation'!
 
 documentation
@@ -3542,6 +3199,361 @@
     app updateChannels
 ! !
 
+!MenuEditor::Item class methodsFor:'constants'!
+
+separatorList
+    "get the list of available separator types"
+
+    ^#('blank' 'single line' 'double line')
+!
+
+separatorSlices
+    "get the list of menu spec values of the corresponding separator types"
+
+   ^ #(
+        ( #blank        ''  )
+        ( #single       '-' )
+        ( #double       '=' )
+      )
+! !
+
+!MenuEditor::Item class methodsFor:'documentation'!
+
+documentation
+"
+    implements the contents assigned to a TreeItem. An instance
+    is associated with one item and keeps all its information
+
+    [see also:]
+        TreeItem
+        MenuEditor
+
+    [author:]
+        Claus Atzkern
+"
+
+
+! !
+
+!MenuEditor::Item methodsFor:'accessing'!
+
+activeHelpKey
+    "get the help key of the menu item"
+
+    ^activeHelpKey
+!
+
+activeHelpKey:aKey
+    "set the help key of the menu item"
+
+    activeHelpKey := aKey
+!
+
+label
+    "get the value of the menu item"
+
+    ^label
+!
+
+label:something
+    "set the value of the menu item"
+
+    label := something ? '-'
+!
+
+separatorType
+    "get the separator type assigned to item or nil"
+
+    label size > 1 
+    ifFalse:
+    [
+        label size  == 0  ifTrue:[^#blank].
+        label first == $- ifTrue:[^#single].
+        label first == $= ifTrue:[^#double].
+    ].    
+    ^nil
+
+!
+
+startGroup:aSymbolOrNil
+    "set the startGroup attribute"
+
+    startGroup := aSymbolOrNil
+
+    "Created: / 23.8.1998 / 15:56:03 / cg"
+!
+
+submenuChannel
+    "return the value of the instance variable 'submenuChannel' (automatically generated)"
+
+    ^submenuChannel
+!
+
+submenuChannel:aChannel
+    "get the submenuChannel"
+
+    submenuChannel := aChannel
+!
+
+translateLabel:aBoolean
+    "set/clear the translate to national-language flag"
+
+    translateLabel := aBoolean
+
+    "Created: / 6.6.1998 / 17:23:33 / cg"
+!
+
+value:aSymbol
+    "set the value attribute"
+
+    value := aSymbol
+
+    "Created: / 23.8.1998 / 16:02:10 / cg"
+! !
+
+!MenuEditor::Item methodsFor:'building'!
+
+buildFromAspects:aspects
+    "read the values of the aspects into my values"
+
+    |name|
+    self isSeparator 
+    ifFalse:
+    [
+        name  := label.
+        label := (aspects at:#label) value.
+
+        (label isNil or:[self isSeparator]) ifTrue:[
+            (aspects at:#label) value:(label := name)
+        ].
+
+        enabled            := (aspects at:#enabled) value.
+        value              := (aspects at:#value) value.
+        nameKey            := (aspects at:#nameKey) value.
+        indication         := (aspects at:#indication) value.
+        choice             := (aspects at:#choice) value.
+        choiceValue        := (aspects at:#choiceValue) value.
+        shortcutKey        := (aspects at:#shortcutKey) value.
+        startGroup         := (aspects at:#startGroup) value.
+        accessCharacterPos := (aspects at:#accessCharacterPos) value.
+        showBusyCursorWhilePerforming := (aspects at:#showBusyCursorWhilePerforming) value.
+        triggerOnDown      := (aspects at:#triggerOnDown) value.
+        keepLinkedMenu     := (aspects at:#keepLinkedMenu) value ? false.
+        font               := (aspects at:#font) value.
+        argument           := (aspects at:#argument) value.
+        translateLabel     := (aspects at:#translateLabel) value.
+        isButton           := (aspects at:#isButton) value.
+        auxValue           := (aspects at:#auxValue) value.
+
+        argument isString ifTrue:[
+            argument size > 1 ifTrue:[
+                (argument at:1) == $# ifTrue:[
+                    argument := (argument copyFrom:2) asSymbol
+                ]
+            ]
+        ].
+        submenuChannel    := (aspects at:#submenuChannel) value.
+        retriever         := (aspects at:#retriever) value.
+        icon              := (aspects at:#icon) value.
+        iconAndLabel      := (aspects at:#iconAndLabel) value.
+    ]
+    ifTrue:
+    [
+        name  := (aspects at:#seperatorSelection) selectionIndex.
+        label := (self class separatorSlices at:name) last.
+    ].
+    isVisible := (aspects at:#isVisible) value.
+    hideMenuOnActivated := (aspects at:#hideMenuOnActivated) value.
+
+    "Modified: / 14.8.1998 / 15:36:38 / cg"
+!
+
+buildFromMenuItem:anItem
+    "read the attributes of anItem into my values"
+
+    |rtv|
+
+    self label:(anItem rawLabel).
+    activeHelpKey := anItem activeHelpKey.
+
+    (enabled := anItem enabled) isSymbol ifFalse:[
+        enabled := nil
+    ].
+    (value := anItem value) isSymbol ifFalse:[
+        value := nil.
+    ].
+    (indication := anItem indication) isSymbol ifFalse:[
+        indication := nil
+    ].
+    (choice := anItem choice) isSymbol ifFalse:[
+        choice := nil
+    ].
+    choiceValue         := anItem choiceValue.
+    nameKey             := anItem nameKey.
+    shortcutKey         := anItem shortcutKeyCharacter.
+    startGroup          := anItem startGroup.
+    accessCharacterPos  := anItem accessCharacterPosition.
+    showBusyCursorWhilePerforming  := anItem showBusyCursorWhilePerforming.
+    triggerOnDown       := anItem triggerOnDown.
+    keepLinkedMenu      := anItem keepLinkedMenu.
+    font                := anItem font.
+    argument            := anItem argument.
+
+    submenuChannel      := anItem submenuChannel.
+    translateLabel      := anItem translateLabel.
+    isButton            := anItem isButton.
+    isVisible           := anItem isVisible.
+    hideMenuOnActivated := anItem hideMenuOnActivated.
+    auxValue            := anItem auxValue.
+
+    (((rtv := anItem adornment) notNil)
+    and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever])
+    ifTrue:
+    [
+        retriever := rtv className.
+        icon      := rtv selector.
+        (iconAndLabel := rtv labelText notNil) ifTrue:[
+            label := rtv labelText.
+        ]
+    ]
+
+    "Modified: / 29.9.1998 / 11:18:25 / cg"
+! !
+
+!MenuEditor::Item methodsFor:'conversion'!
+
+asMenuItem
+    "converts self to a menu item"
+
+    |item rcv|
+
+    item := MenuItem labeled:label.
+    item isVisible:isVisible.
+    item hideMenuOnActivated:hideMenuOnActivated.
+
+    self isSeparator ifFalse:[    
+        item activeHelpKey:activeHelpKey.
+        item enabled:enabled.
+        item accessCharacterPosition:accessCharacterPos.
+        item showBusyCursorWhilePerforming:showBusyCursorWhilePerforming.
+        item triggerOnDown:triggerOnDown.
+        item keepLinkedMenu:keepLinkedMenu.
+        item font:font.
+        item argument:argument.
+        item submenuChannel:submenuChannel.
+        item nameKey:nameKey.
+        item shortcutKeyCharacter:shortcutKey.
+        item startGroup:startGroup.
+        item value:value.
+        item indication:indication.
+        item choice:choice.
+        item choiceValue:choiceValue.
+        item translateLabel: translateLabel.
+        item isButton: isButton.
+        item auxValue: auxValue.
+
+        icon notNil ifTrue:[
+            rcv := ResourceRetriever new.
+            rcv className:retriever.
+            rcv selector:icon.
+            iconAndLabel == true ifTrue:[
+                rcv labelText:label
+            ].
+            item labelImage:rcv
+        ]
+    ].
+    ^item
+
+    "Modified: / 14.8.1998 / 15:36:35 / cg"
+!
+
+toAspects:aspects
+    "put my values into the values of aspects"
+
+    |type|
+    (type := self separatorType) notNil ifTrue: [
+        type := self class separatorSlices findFirst:[:el| el first == type ].
+        (aspects at:#seperatorSelection) selectionIndex:type.
+    ] ifFalse: [
+        (aspects at:#label)                value:label.
+        (aspects at:#enabled)              value:enabled.
+        (aspects at:#value)                value:value.
+        (aspects at:#nameKey)              value:nameKey.
+        (aspects at:#indication)           value:indication.
+        (aspects at:#choice)               value:choice.
+        (aspects at:#choiceValue)          value:choiceValue.
+        (aspects at:#shortcutKey)          value:shortcutKey.
+        (aspects at:#startGroup)           value:startGroup.
+        (aspects at:#accessCharacterPos)   value:accessCharacterPos.
+        (aspects at:#showBusyCursorWhilePerforming)   value:showBusyCursorWhilePerforming.
+        (aspects at:#triggerOnDown)        value:triggerOnDown.
+        (aspects at:#keepLinkedMenu)       value:(keepLinkedMenu ? false).
+        (aspects at:#font)                 value:font.
+        (aspects at:#translateLabel)       value:translateLabel.
+        (aspects at:#submenuChannel)       value:submenuChannel.
+        (aspects at:#retriever)            value:retriever.
+        (aspects at:#icon)                 value:icon.
+        (aspects at:#iconAndLabel)         value:iconAndLabel.
+        (aspects at:#isButton)             value:isButton.
+        (aspects at:#auxValue)             value:auxValue.
+
+        (aspects at:#argument)
+            value:(argument isSymbol
+                        ifTrue: ['#', argument] 
+                        ifFalse:[argument]).
+    ].
+    (aspects at:#isVisible) value:isVisible.
+    (aspects at:#hideMenuOnActivated) value:(hideMenuOnActivated ? true).
+
+    "Modified: / 14.8.1998 / 15:37:29 / cg"
+! !
+
+!MenuEditor::Item methodsFor:'queries'!
+
+iconFor: aNode
+    "get the icon of the menu item for the tree view"
+
+    (aNode hasChildren or: [aNode parent isNil])
+    ifTrue:
+    [
+        ^MenuEditor submenuImage
+    ]
+    ifFalse:
+    [
+        submenuChannel notNil 
+        ifTrue:
+        [
+            ^MenuEditor linkSubmenuImage
+        ]
+        ifFalse:
+        [
+            self isSeparator 
+                ifTrue:  [^MenuEditor menuSeparatorImage]
+                ifFalse: [^MenuEditor menuItemImage]
+        ]
+    ]
+!
+
+isSeparator
+    "return true if item is a seperator"
+
+    ^self separatorType notNil
+!
+
+treeViewLabel
+    "get the label of the menu item for the tree view"
+
+    ^label
+" asBoldText, 
+        (value notNil ifTrue: [': [', 
+                value ,
+                (argument isString ifTrue: [' ', (Text string: argument emphasis: #italic)] ifFalse: ['']),
+                 ']'] ifFalse: [''])
+
+
+"
+! !
+
 !MenuEditor class methodsFor:'documentation'!
 
 version