UIPainter.st
changeset 565 8fdeb11c72fd
parent 564 df1f1e84d94a
child 572 ac2a1dd83d28
equal deleted inserted replaced
564:df1f1e84d94a 565:8fdeb11c72fd
   501      
   501      
   502        #(#FullSpec
   502        #(#FullSpec
   503           #'window:' 
   503           #'window:' 
   504            #(#WindowSpec
   504            #(#WindowSpec
   505               #'name:' 'Tree-View'
   505               #'name:' 'Tree-View'
   506               #'layout:' #(#LayoutFrame 6 0 391 0 558 0 916 0)
   506               #'layout:' #(#LayoutFrame 251 0 316 0 803 0 841 0)
   507               #'label:' 'Tree-View'
   507               #'label:' 'Tree-View'
   508               #'min:' #(#Point 10 10)
   508               #'min:' #(#Point 10 10)
   509               #'max:' #(#Point 1160 870)
   509               #'max:' #(#Point 1160 870)
   510               #'bounds:' #(#Rectangle 6 391 559 917)
   510               #'bounds:' #(#Rectangle 251 316 804 842)
   511               #'menu:' #menu
   511               #'menu:' #menu
   512               #'usePreferredExtent:' false
   512               #'usePreferredExtent:' false
   513           )
   513           )
   514           #'component:' 
   514           #'component:' 
   515            #(#SpecCollection
   515            #(#SpecCollection
   662                                                             #'activeHelpKey:' #cancel
   662                                                             #'activeHelpKey:' #cancel
   663                                                             #'label:' 'Cancel'
   663                                                             #'label:' 'Cancel'
   664                                                             #'tabable:' true
   664                                                             #'tabable:' true
   665                                                             #'model:' #cancel
   665                                                             #'model:' #cancel
   666                                                             #'enableChannel:' #modifiedChannel
   666                                                             #'enableChannel:' #modifiedChannel
   667                                                             #'extent:' #(#Point 179 24)
   667                                                             #'extent:' #(#Point 180 24)
   668                                                         )
   668                                                         )
   669                                                          #(#ActionButtonSpec
   669                                                          #(#ActionButtonSpec
   670                                                             #'name:' 'acceptButton'
   670                                                             #'name:' 'acceptButton'
   671                                                             #'activeHelpKey:' #accept
   671                                                             #'activeHelpKey:' #accept
   672                                                             #'label:' 'OK'
   672                                                             #'label:' 'OK'
  1619              #(#MenuItem
  1619              #(#MenuItem
  1620                 #'label:' 'Move Up'
  1620                 #'label:' 'Move Up'
  1621                 #'isButton:' true
  1621                 #'isButton:' true
  1622                 #'value:' #doStepUp
  1622                 #'value:' #doStepUp
  1623                 #'activeHelpKey:' #moveSelectionUp
  1623                 #'activeHelpKey:' #moveSelectionUp
  1624                 #'enabled:' #canMoveOrAlignSelection
  1624                 #'enabled:' #canChangeOrderInContainer
  1625                 #'labelImage:' #(#ResourceRetriever nil #upIcon)
  1625                 #'labelImage:' #(#ResourceRetriever nil #upIcon)
  1626             )
  1626             )
  1627              #(#MenuItem
  1627              #(#MenuItem
  1628                 #'label:' 'Move Down'
  1628                 #'label:' 'Move Down'
  1629                 #'isButton:' true
  1629                 #'isButton:' true
  1630                 #'value:' #doStepDown
  1630                 #'value:' #doStepDown
  1631                 #'activeHelpKey:' #moveSelectionDown
  1631                 #'activeHelpKey:' #moveSelectionDown
  1632                 #'enabled:' #canMoveOrAlignSelection
  1632                 #'enabled:' #canChangeOrderInContainer
  1633                 #'labelImage:' #(#ResourceRetriever nil #downIcon)
  1633                 #'labelImage:' #(#ResourceRetriever nil #downIcon)
  1634             )
  1634             )
  1635              #(#MenuItem
  1635              #(#MenuItem
  1636                 #'label:' 'Move In'
  1636                 #'label:' 'Move In'
  1637                 #'isButton:' true
  1637                 #'isButton:' true
  1934 
  1934 
  1935 ! !
  1935 ! !
  1936 
  1936 
  1937 !UIPainter methodsFor:'aspects'!
  1937 !UIPainter methodsFor:'aspects'!
  1938 
  1938 
       
  1939 canChangeOrderInContainer
       
  1940     "returns a boolean value holder which is true if the component order can be changed within their container.
       
  1941     "
       
  1942     ^ builder booleanValueAspectFor:#canChangeOrderInContainer
       
  1943 !
       
  1944 
  1939 canMoveOrAlignSelection
  1945 canMoveOrAlignSelection
  1940     "returns a boolean value holder which is true in case that any selection exists
  1946     "returns a boolean value holder which is true in case that any selection exists
  1941      and all widgets in the selection can change its layout through to a move or
  1947      and all widgets in the selection can change its layout through to a move or
  1942      align operation
  1948      align operation
  1943     "
  1949     "
  2551         (self confirm:'Accept change made in ' , tabSelection printString , ' section ?') ifTrue:[
  2557         (self confirm:'Accept change made in ' , tabSelection printString , ' section ?') ifTrue:[
  2552             self accept
  2558             self accept
  2553         ]
  2559         ]
  2554     ].
  2560     ].
  2555     self canMoveOrAlignSelection        value:(treeView canMoveOrAlignSelection).
  2561     self canMoveOrAlignSelection        value:(treeView canMoveOrAlignSelection).
       
  2562     self canChangeOrderInContainer      value:(treeView canChangeOrderInContainer).
  2556     self canMoveSelectionIntoContainer  value:(treeView canMoveSelectionIntoContainer).
  2563     self canMoveSelectionIntoContainer  value:(treeView canMoveSelectionIntoContainer).
  2557     self canMoveSelectionOutOfContainer value:(treeView canMoveSelectionOutOfContainer).
  2564     self canMoveSelectionOutOfContainer value:(treeView canMoveSelectionOutOfContainer).
  2558     self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas).
  2565     self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas).
  2559 
  2566 
  2560     treeView isCanvasSelected ifTrue:[
  2567     treeView isCanvasSelected ifTrue:[
  3730     ]
  3737     ]
  3731 ! !
  3738 ! !
  3732 
  3739 
  3733 !UIPainter::TreeView methodsFor:'queries'!
  3740 !UIPainter::TreeView methodsFor:'queries'!
  3734 
  3741 
       
  3742 canChangeOrderInContainer
       
  3743     "returns true if any selection exists and all widgets in the selection
       
  3744      can change their layout through to a move or align operation.
       
  3745     "
       
  3746     |canvas|
       
  3747 
       
  3748     ((selection size ~~ 1) or: [(selection at: 1) == 1]) ifTrue:[
       
  3749         ^ false
       
  3750     ].
       
  3751     ^ true
       
  3752 !
       
  3753 
  3735 canMoveOrAlignSelection
  3754 canMoveOrAlignSelection
  3736     "returns true if any selection exists and all widgets in the selection
  3755     "returns true if any selection exists and all widgets in the selection
  3737      can change their layout through to a move or align operation.
  3756      can change their layout through to a move or align operation.
  3738     "
  3757     "
  3739     |canvas|
  3758     |canvas|