support of visible/unvisible items
authorca
Fri, 30 Jan 1998 16:14:03 +0100
changeset 539 1116829f5525
parent 538 3d75219adb32
child 540 cf67668c680c
support of visible/unvisible items
MenuEditor.st
--- a/MenuEditor.st	Fri Jan 30 15:59:44 1998 +0100
+++ b/MenuEditor.st	Fri Jan 30 16:14:03 1998 +0100
@@ -23,7 +23,7 @@
 Object subclass:#Item
 	instanceVariableNames:'activeHelpKey enabled label value nameKey indication shortcutKey
 		accessCharacterPos retriever icon iconAndLabel submenuChannel
-		startGroup argument translateLabel isButton'
+		startGroup argument translateLabel isButton isVisible'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:MenuEditor
@@ -136,6 +136,9 @@
 #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.'
 
+#isVisible
+''
+
 #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.'
 
@@ -184,11 +187,11 @@
           #'window:' 
            #(#WindowSpec
               #'name:' 'unnamed canvas'
-              #'layout:' #(#LayoutFrame 170 0 315 0 436 0 633 0)
+              #'layout:' #(#LayoutFrame 219 0 193 0 485 0 511 0)
               #'label:' 'unnamed canvas'
               #'min:' #(#Point 10 10)
               #'max:' #(#Point 1160 870)
-              #'bounds:' #(#Rectangle 170 315 437 634)
+              #'bounds:' #(#Rectangle 219 193 486 512)
               #'usePreferredExtent:' false
           )
           #'component:' 
@@ -705,32 +708,32 @@
                     #'acceptOnTab:' false
                 )
                  #(#LabelSpec
-                    #'name:' 'accessCharLabel'
-                    #'layout:' #(#AlignmentOrigin 217 0 131 0 1 0.5)
-                    #'label:' 'Access Character Position:'
+                    #'name:' 'visibilityLabel'
+                    #'layout:' #(#AlignmentOrigin 107 0 76 0 1 0.5)
+                    #'label:' 'Visibility:'
                     #'adjust:' #right
                     #'resizeForLabel:' true
                 )
                  #(#InputFieldSpec
-                    #'name:' 'accessCharField'
-                    #'layout:' #(#LayoutFrame 220 0 120 0 -5 1.0 142 0)
-                    #'activeHelpKey:' #accessCharaterPos
+                    #'name:' 'isVisibleInputField'
+                    #'layout:' #(#LayoutFrame 110 0 65 0 -5 1.0 87 0)
+                    #'activeHelpKey:' #isVisible
                     #'tabable:' true
-                    #'model:' #accessCharacterPos
-                    #'type:' #numberOrNil
+                    #'model:' #isVisible
+                    #'type:' #symbolOrNil
                     #'acceptOnReturn:' false
                     #'acceptOnTab:' false
                 )
                  #(#LabelSpec
                     #'name:' 'StartGroupLabel'
-                    #'layout:' #(#AlignmentOrigin 107 0 87 0 1 0.5)
+                    #'layout:' #(#AlignmentOrigin 107 0 111 0 1 0.5)
                     #'label:' 'Start Group:'
                     #'adjust:' #right
                     #'resizeForLabel:' true
                 )
                  #(#PopUpListSpec
                     #'name:' 'StartGroupPopUp'
-                    #'layout:' #(#LayoutFrame 110 0 76 0 -5 1.0 98 0)
+                    #'layout:' #(#LayoutFrame 110 0 100 0 -5 1.0 122 0)
                     #'label:' 'PopUpList'
                     #'model:' #startGroup
                     #'menu:' 
@@ -739,6 +742,23 @@
                     )
                     #'useIndex:' false
                 )
+                 #(#LabelSpec
+                    #'name:' 'accessCharLabel'
+                    #'layout:' #(#AlignmentOrigin 217 0 142 0 1 0.5)
+                    #'label:' 'Access Character Position:'
+                    #'adjust:' #right
+                    #'resizeForLabel:' true
+                )
+                 #(#InputFieldSpec
+                    #'name:' 'accessCharField'
+                    #'layout:' #(#LayoutFrame 220 0 131 0 -5 1.0 153 0)
+                    #'activeHelpKey:' #accessCharaterPos
+                    #'tabable:' true
+                    #'model:' #accessCharacterPos
+                    #'type:' #numberOrNil
+                    #'acceptOnReturn:' false
+                    #'acceptOnTab:' false
+                )
               )
           )
       )
@@ -1822,6 +1842,7 @@
         retriever
         iconAndLabel
         icon
+        isVisible
 
      ) do:[:aKey|
         aspects at:aKey put:(holder := ValueHolder new).
@@ -2225,6 +2246,7 @@
         item indication:indication.
         item translateLabel: translateLabel.
         item isButton: isButton.
+        item isVisible: isVisible.
 
         icon notNil ifTrue:[
             rcv := ResourceRetriever new.
@@ -2262,6 +2284,7 @@
         argument           := (aspects at:#argument) value.
         translateLabel     := (aspects at:#translateLabel) value.
         isButton           := (aspects at:#isButton) value.
+        isVisible          := (aspects at:#isVisible) value.
 
         argument isString ifTrue:[
             argument size > 1 ifTrue:[
@@ -2310,6 +2333,7 @@
     submenuChannel     := anItem submenuChannel.
     translateLabel     := anItem translateLabel.
     isButton           := anItem isButton.
+    isVisible          := anItem isVisible.
 
     (((rtv := anItem adornment) notNil)
     and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever])
@@ -2343,11 +2367,13 @@
         (aspects at:#startGroup)           value:startGroup.
         (aspects at:#accessCharacterPos)   value:accessCharacterPos.
         (aspects at:#translateLabel)       value:translateLabel.
-        (aspects at:#isButton)             value:isButton.
         (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:#isVisible)            value:isVisible.
+
 
         argument isSymbol
             ifTrue: [(aspects at:#argument)value:'#', argument]