UIGalleryView.st
changeset 2534 b717cb2e0cb8
parent 2504 8746b7a4d215
child 2542 5cb4a0bdc44c
equal deleted inserted replaced
2533:460098ee1f39 2534:b717cb2e0cb8
   618 ! !
   618 ! !
   619 
   619 
   620 !UIGalleryView::Canvas methodsFor:'selection'!
   620 !UIGalleryView::Canvas methodsFor:'selection'!
   621 
   621 
   622 handlesOf:aComponent do:aOneArgBlock
   622 handlesOf:aComponent do:aOneArgBlock
   623     "evaluate the block on each handle; the argument to the block
   623     "evaluate the block on each handle; the argument to the block is a rectangle"
   624      is a rectangle
   624 
   625     "
   625     |ext|
       
   626 
       
   627     ext := 6@6.
       
   628 
   626     aComponent notNil ifTrue:[
   629     aComponent notNil ifTrue:[
   627         aOneArgBlock value:(aComponent origin       - (2@2) extent:6@6).
   630         aOneArgBlock value:(aComponent origin       - (2@2) extent:ext).
   628         aOneArgBlock value:(aComponent corner       - (1@1) extent:6@6).
   631         aOneArgBlock value:(aComponent corner       - (1@1) extent:ext).
   629         aOneArgBlock value:(aComponent topRight     - (1@2) extent:6@6).
   632         aOneArgBlock value:(aComponent topRight     - (1@2) extent:ext).
   630         aOneArgBlock value:(aComponent bottomLeft   - (2@1) extent:6@6).
   633         aOneArgBlock value:(aComponent bottomLeft   - (2@1) extent:ext).
   631         aOneArgBlock value:(aComponent leftCenter rounded   - (2@0) extent:6@6).
   634         aOneArgBlock value:(aComponent leftCenter rounded   - (2@0) extent:ext).
   632         aOneArgBlock value:(aComponent rightCenter rounded  - (1@0) extent:6@6).
   635         aOneArgBlock value:(aComponent rightCenter rounded  - (1@0) extent:ext).
   633         aOneArgBlock value:(aComponent topCenter rounded    - (0@2) extent:6@6).
   636         aOneArgBlock value:(aComponent topCenter rounded    - (0@2) extent:ext).
   634         aOneArgBlock value:(aComponent bottomCenter rounded - (0@1) extent:6@6).
   637         aOneArgBlock value:(aComponent bottomCenter rounded - (0@1) extent:ext).
   635     ]
   638     ]
   636 !
   639 !
   637 
   640 
   638 redrawSelection
   641 redrawSelection
   639     "redraw all items selected"
   642     "redraw all items selected"
   640 
   643 
   641     (shown and:[selection notNil and:[hiddenCounter == 0]]) ifTrue:[
   644     (shown and:[selection notNil and:[hiddenCounter == 0]]) ifTrue:[
   642         self clippedByChildren:false.
   645         self clippedByChildren:false.
   643 
   646 
   644         self paint:Color black.
       
   645         self handlesOf:selection do:[:aRectangle|
   647         self handlesOf:selection do:[:aRectangle|
   646             self fillRectangle:aRectangle
   648             self paint:Color black.
       
   649             self fillRectangle:aRectangle.
       
   650 
       
   651             self paint:Color white.
       
   652             self displayRectangle:(aRectangle insetBy:-1).
   647         ].
   653         ].
   648         self clippedByChildren:true.
   654         self clippedByChildren:true.
   649     ].
   655     ].
   650 !
   656 !
   651 
   657