MenuEditor.st
changeset 953 1aecad8bf33a
parent 943 b9ba76358fbd
child 955 f4f7d2ebd3ce
--- a/MenuEditor.st	Thu Aug 13 20:34:18 1998 +0200
+++ b/MenuEditor.st	Fri Aug 14 17:25:03 1998 +0200
@@ -22,7 +22,8 @@
 Object subclass:#Item
 	instanceVariableNames:'activeHelpKey enabled label value nameKey indication shortcutKey
 		accessCharacterPos retriever icon iconAndLabel submenuChannel
-		startGroup argument translateLabel isButton isVisible'
+		startGroup argument translateLabel isButton isVisible choice
+		choiceValue'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:MenuEditor
@@ -119,6 +120,8 @@
         value
         nameKey
         indication
+        choice
+        choiceValue
         translateLabel
         isButton
         shortcutKey
@@ -129,6 +132,7 @@
         isVisible
      )
 
+    "Modified: / 14.8.1998 / 14:46:36 / cg"
 ! !
 
 !MenuEditor class methodsFor:'help specs'!
@@ -334,11 +338,11 @@
           #window: 
            #(#WindowSpec
               #name: 'Basics Item'
-              #layout: #(#LayoutFrame 473 0 301 0 739 0 619 0)
+              #layout: #(#LayoutFrame 216 0 173 0 482 0 491 0)
               #label: 'Basics Item'
               #min: #(#Point 10 10)
               #max: #(#Point 1160 870)
-              #bounds: #(#Rectangle 473 301 740 620)
+              #bounds: #(#Rectangle 216 173 483 492)
               #usePreferredExtent: false
           )
           #component: 
@@ -357,10 +361,10 @@
                     #layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0)
                     #tabable: true
                     #model: #nameKey
+                    #group: #inputGroup
                     #type: #symbolOrNil
                     #acceptOnReturn: false
                     #acceptOnTab: false
-                    #group: #inputGroup
                 )
                  #(#LabelSpec
                     #name: 'labelLabel'
@@ -375,9 +379,9 @@
                     #activeHelpKey: #basicsLabel
                     #tabable: true
                     #model: #label
+                    #group: #inputGroup
                     #acceptOnReturn: false
                     #acceptOnTab: false
-                    #group: #inputGroup
                 )
                  #(#LabelSpec
                     #name: 'valueLabel'
@@ -392,10 +396,10 @@
                     #activeHelpKey: #basicsAction
                     #tabable: true
                     #model: #value
+                    #group: #inputGroup
                     #type: #symbolOrNil
                     #acceptOnReturn: false
                     #acceptOnTab: false
-                    #group: #inputGroup
                 )
                  #(#LabelSpec
                     #name: 'argumentLabel'
@@ -410,10 +414,10 @@
                     #activeHelpKey: #basicsArgument
                     #tabable: true
                     #model: #argument
+                    #group: #inputGroup
                     #type: #string
                     #acceptOnReturn: false
                     #acceptOnTab: false
-                    #group: #inputGroup
                 )
                  #(#LabelSpec
                     #name: 'indicationLabel'
@@ -426,16 +430,17 @@
                     #name: 'indicationField'
                     #layout: #(#LayoutFrame 110 0 144 0 -5 1.0 166 0)
                     #activeHelpKey: #basicsIndication
+                    #enableChannel: #indicationEnabled
                     #tabable: true
                     #model: #indication
+                    #group: #inputGroup
                     #type: #symbolOrNil
                     #acceptOnReturn: false
                     #acceptOnTab: false
-                    #group: #inputGroup
                 )
                  #(#CheckBoxSpec
                     #name: 'translateLabelCheckBox'
-                    #layout: #(#Point 20 190)
+                    #layout: #(#Point 20 230)
                     #activeHelpKey: #basicsTranslateLabel
                     #tabable: true
                     #model: #translateLabel
@@ -443,17 +448,60 @@
                 )
                  #(#CheckBoxSpec
                     #name: 'isButtonCheckBox'
-                    #layout: #(#Point 20 219)
+                    #layout: #(#Point 20 259)
                     #activeHelpKey: #basicsIsButton
                     #tabable: true
                     #model: #isButton
                     #label: 'Is Button'
                 )
+                 #(#LabelSpec
+                    #name: 'choiceLabel'
+                    #layout: #(#AlignmentOrigin 107 0 180 0 1 0.5)
+                    #label: 'Choice:'
+                    #translateLabel: true
+                    #adjust: #right
+                    #resizeForLabel: true
+                )
+                 #(#InputFieldSpec
+                    #name: 'choiceField'
+                    #layout: #(#LayoutFrame 110 0 169 0 -5 1.0 191 0)
+                    #activeHelpKey: #basicsIndication
+                    #enableChannel: #choiceEnabled
+                    #tabable: true
+                    #model: #choice
+                    #group: #inputGroup
+                    #type: #symbolOrNil
+                    #acceptOnReturn: false
+                    #acceptOnTab: false
+                )
+                 #(#LabelSpec
+                    #name: 'choiceValueLabel'
+                    #layout: #(#AlignmentOrigin 107 0 205 0 1 0.5)
+                    #label: 'Value:'
+                    #translateLabel: true
+                    #adjust: #right
+                    #resizeForLabel: true
+                )
+                 #(#InputFieldSpec
+                    #name: 'choiceValueField'
+                    #layout: #(#LayoutFrame 110 0 194 0 -5 1.0 216 0)
+                    #activeHelpKey: #basicsIndication
+                    #enableChannel: #choiceValueEnabled
+                    #tabable: true
+                    #model: #choiceValue
+                    #group: #inputGroup
+                    #type: #smalltalkObject
+                    #acceptOnReturn: true
+                    #acceptOnTab: true
+                    #acceptOnLeave: true
+                    #acceptOnLostFocus: true
+                    #immediateAccept: false
+                )
               )
           )
       )
 
-    "Modified: / 31.7.1998 / 01:18:03 / cg"
+    "Modified: / 14.8.1998 / 15:43:35 / cg"
 !
 
 basicsLinkSpec
@@ -1987,7 +2035,9 @@
 
     aspects do: [:holder| holder removeDependent:self].
     (node := self treeView selectedNode) notNil ifTrue:[
-        aspects do:[:anAspect| anAspect value:nil ].
+        aspects do:[:anAspect| 
+                        anAspect isBlock ifFalse:[anAspect value:nil]
+                   ].
         item := node contents.
         item toAspects:aspects.
 
@@ -2034,6 +2084,8 @@
     ].
     self updateChannels.
     aspects do: [:holder| holder addDependent:self].
+
+    "Modified: / 14.8.1998 / 14:52:32 / cg"
 !
 
 tabSelection: aSelection
@@ -2058,12 +2110,14 @@
         self helpTool helpKey:(self helpKey).
         helpCanvas raise.
     ] ifFalse:[       
-        aspects do: [:holder| holder release].
+        aspects do: [:holder| holder removeDependent:self].
         specCanvas client:self spec:(self class perform:(slices at:tabSelection) last) builder:builder.
         aspects do: [:holder| holder addDependent:self].
         self updateFonts.
         specCanvas raise.
     ]
+
+    "Modified: / 14.8.1998 / 15:07:06 / cg"
 ! !
 
 !MenuEditor methodsFor:'startup / release'!
@@ -2079,7 +2133,17 @@
     holder list: Item separatorList.
     holder addDependent:self.
 
-    "Modified: / 20.6.1998 / 14:53:26 / cg"
+    aspects at:#indicationEnabled  put:(BlockValue 
+                                            with:[:a | a size == 0]
+                                            argument:(aspects at:#choice)).
+    aspects at:#choiceEnabled      put:(BlockValue
+                                            with:[:a | a size == 0]
+                                            argument:(aspects at:#indication)).
+    aspects at:#choiceValueEnabled put:(BlockValue
+                                            with:[:a | a size > 0]
+                                            argument:(aspects at:#choice)).
+
+    "Modified: / 14.8.1998 / 15:07:58 / cg"
 !
 
 openModalOnMenu: aMenu
@@ -2398,6 +2462,8 @@
         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.
@@ -2424,7 +2490,7 @@
     ].
     isVisible := (aspects at:#isVisible) value.
 
-    "Modified: / 6.6.1998 / 17:20:59 / cg"
+    "Modified: / 14.8.1998 / 15:36:38 / cg"
 !
 
 buildFromMenuItem:anItem
@@ -2438,14 +2504,16 @@
     (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.
@@ -2468,6 +2536,8 @@
             label := rtv labelText.
         ]
     ]
+
+    "Modified: / 14.8.1998 / 15:37:20 / cg"
 ! !
 
 !MenuEditor::Item methodsFor:'conversion'!
@@ -2491,6 +2561,8 @@
         item startGroup:startGroup.
         item value:value.
         item indication:indication.
+        item choice:choice.
+        item choiceValue:choiceValue.
         item translateLabel: translateLabel.
         item isButton: isButton.
 
@@ -2505,6 +2577,8 @@
         ]
     ].
     ^item
+
+    "Modified: / 14.8.1998 / 15:36:35 / cg"
 !
 
 toAspects:aspects
@@ -2524,6 +2598,8 @@
         (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.
@@ -2540,6 +2616,7 @@
     ].
     (aspects at:#isVisible) value:isVisible.
 
+    "Modified: / 14.8.1998 / 15:37:29 / cg"
 ! !
 
 !MenuEditor::Item methodsFor:'queries'!