# HG changeset patch # User ca # Date 1034439034 -7200 # Node ID 3fac80dbb0b38c7b2db93626af37f57951c1b17b # Parent 766547778a3446ac1655b2a372affe6fe63c8c02 allow delayedMenus on toggles too diff -r 766547778a34 -r 3fac80dbb0b3 MenuEditor.st --- a/MenuEditor.st Wed Oct 09 16:43:54 2002 +0200 +++ b/MenuEditor.st Sat Oct 12 18:10:34 2002 +0200 @@ -3356,7 +3356,6 @@ #name: 'indicationLabel' #layout: #(#AlignmentOrigin 107 0 138 0 1 0.5) #activeHelpKey: #basicsIndication - #visibilityChannel: #hasNoDelayedMenuValue #resizeForLabel: true #adjust: #right ) @@ -3364,7 +3363,6 @@ #name: 'indicationField' #layout: #(#LayoutFrame 110 0 127 0 -5 1.0 149 0) #activeHelpKey: #basicsIndication - #visibilityChannel: #hasNoDelayedMenuValue #enableChannel: #indicationEnabled #tabable: true #model: #indication @@ -3382,7 +3380,6 @@ #name: 'choiceLabel' #layout: #(#AlignmentOrigin 107 0 163 0 1 0.5) #activeHelpKey: #basicsChoice - #visibilityChannel: #hasNoDelayedMenuValue #translateLabel: true #resizeForLabel: true #adjust: #right @@ -3391,7 +3388,6 @@ #name: 'choiceField' #layout: #(#LayoutFrame 110 0 152 0 -5 1.0 174 0) #activeHelpKey: #basicsChoice - #visibilityChannel: #hasNoDelayedMenuValue #enableChannel: #choiceEnabled #tabable: true #model: #choice @@ -3409,7 +3405,6 @@ #name: 'choiceValueLabel' #layout: #(#AlignmentOrigin 107 0 188 0 1 0.5) #activeHelpKey: #basicsChoiceValue - #visibilityChannel: #hasNoDelayedMenuValue #translateLabel: true #resizeForLabel: true #adjust: #right @@ -3418,7 +3413,6 @@ #name: 'choiceValueField' #layout: #(#LayoutFrame 110 0 177 0 -5 1.0 199 0) #activeHelpKey: #basicsChoiceValue - #visibilityChannel: #hasNoDelayedMenuValue #enableChannel: #choiceValueEnabled #tabable: true #model: #choiceValue @@ -3471,7 +3465,7 @@ #name: 'triggerOnDown' #layout: #(#Point 20 313) #activeHelpKey: #triggerOnDown - #visibilityChannel: #hasNoDelayedMenuValue + #enableChannel: #hasNoDelayedMenuValue #tabable: true #model: #triggerOnDown #translateLabel: true @@ -3536,13 +3530,8 @@ ^ nil ]. "/ reset values not setable if a delayed menu is configured - - menuItem choice:nil. - menuItem indication:nil. - menuItem choiceValue:nil. menuItem triggerOnDown:false. - - anItem argument:(menuItem argument). + anItem argument:(menuItem argument). isExpanded := false. anItem parent:self. @@ -3563,15 +3552,30 @@ menuItem argument:aValue. ^ self ]. + aKey == #triggerOnDown ifTrue:[ + self hasDelayedMenu ifTrue:[ + menuItem triggerOnDown:false + ] ifFalse:[ + menuItem triggerOnDown:aValue + ]. + ^ self. + ]. super aspectAt:aKey put:aValue. ! toAspects:aspects "write values to aspects " + |hasDelayedMenu| + super toAspects:aspects. - (aspects at:#hasNoDelayedMenuValue) value:(self hasDelayedMenu not). + hasDelayedMenu := self hasDelayedMenu. + (aspects at:#hasNoDelayedMenuValue) value:(hasDelayedMenu not). + + hasDelayedMenu ifTrue:[ + (aspects at:#triggerOnDown) value:false + ]. ! ! !MenuEditor::ItemAction methodsFor:'displaying'! @@ -3610,11 +3614,9 @@ !MenuEditor::ItemAction methodsFor:'queries - operation'! canAddDelayedMenu - "returns true if a delayed menu can be added; - no delayed menu exists and the indication or choice is unspecified + "returns true if a delayed menu can be added " - self hasDelayedMenu ifTrue:[ ^ false ]. - ^ (menuItem indication isNil and:[menuItem choice isNil]) + ^ self hasDelayedMenu not ! ! !MenuEditor::ItemLinkedMenu class methodsFor:'defaults'!