MenuEditor.st
changeset 2168 8ebed0b2d3c8
parent 2161 1dd6800c1bb3
child 2169 e7b7c5379e4b
equal deleted inserted replaced
2167:d197bd77b607 2168:8ebed0b2d3c8
  1723                 menu := cls perform: aSelector.
  1723                 menu := cls perform: aSelector.
  1724             ].
  1724             ].
  1725 
  1725 
  1726             menu notNil ifTrue:[
  1726             menu notNil ifTrue:[
  1727                 (menu isMemberOf:Menu) ifFalse:[
  1727                 (menu isMemberOf:Menu) ifFalse:[
  1728                     menu := Menu new fromLiteralArrayEncoding:menu
  1728                     menu := Menu decodeFromLiteralArray:menu
  1729                 ].
  1729                 ].
  1730             ]
  1730             ]
  1731         ].
  1731         ].
  1732     ].
  1732     ].
  1733     self buildFromMenu:menu selector:aSelector.
  1733     self buildFromMenu:menu selector:aSelector.
  1734     self clearModified.
  1734     self clearModified.
       
  1735 
       
  1736     "Modified: / 27-03-2007 / 08:45:17 / cg"
  1735 ! !
  1737 ! !
  1736 
  1738 
  1737 !MenuEditor methodsFor:'change & update'!
  1739 !MenuEditor methodsFor:'change & update'!
  1738 
  1740 
  1739 selectedSuperItems
  1741 selectedSuperItems
  3348 !
  3350 !
  3349 
  3351 
  3350 menuItem
  3352 menuItem
  3351      "returns self as a MenuItem
  3353      "returns self as a MenuItem
  3352     "
  3354     "
  3353     ^ MenuItem new fromLiteralArrayEncoding:(menuItem literalArrayEncoding).
  3355     ^ MenuItem decodeFromLiteralArray:(menuItem literalArrayEncoding).
       
  3356 
       
  3357     "Modified: / 27-03-2007 / 08:43:14 / cg"
  3354 !
  3358 !
  3355 
  3359 
  3356 menuItem:aMenuItem
  3360 menuItem:aMenuItem
  3357     "rebuild self from a MenuItem
  3361     "rebuild self from a MenuItem
  3358     "
  3362     "
  4700         menu := aMenu value.
  4704         menu := aMenu value.
  4701 
  4705 
  4702         (menu isNil or:[menu isString]) ifTrue:[
  4706         (menu isNil or:[menu isString]) ifTrue:[
  4703             menu := nil
  4707             menu := nil
  4704         ] ifFalse:[
  4708         ] ifFalse:[
  4705             aMenu isCollection ifTrue:[ menu := Menu new fromLiteralArrayEncoding:aMenu ]
  4709             aMenu isCollection ifTrue:[ menu := Menu decodeFromLiteralArray:aMenu ]
  4706                               ifFalse:[ menu := aMenu ].
  4710                               ifFalse:[ menu := aMenu ].
  4707 
  4711 
  4708             menu numberOfItems == 0 ifTrue:[
  4712             menu numberOfItems == 0 ifTrue:[
  4709                 menu := nil
  4713                 menu := nil
  4710             ].
  4714             ].
  4721             expanded ifTrue:[ self expand ].
  4725             expanded ifTrue:[ self expand ].
  4722         ].
  4726         ].
  4723         isExpanded := expanded.
  4727         isExpanded := expanded.
  4724     ].        
  4728     ].        
  4725     self changed
  4729     self changed
       
  4730 
       
  4731     "Modified: / 27-03-2007 / 08:43:07 / cg"
  4726 !
  4732 !
  4727 
  4733 
  4728 menuItem
  4734 menuItem
  4729     "returns self as a MenuItem
  4735     "returns self as a MenuItem
  4730     "
  4736     "