UIGalleryView.st
changeset 806 4faf081e981d
parent 720 7f228c9cde2e
child 897 43f9bdc12ae4
equal deleted inserted replaced
805:99e70b6c02e5 806:4faf081e981d
   675 !UIGalleryView::Canvas::DropSpec class methodsFor:'instance creation'!
   675 !UIGalleryView::Canvas::DropSpec class methodsFor:'instance creation'!
   676 
   676 
   677 for:aView specification:aSpec
   677 for:aView specification:aSpec
   678     "create drop object for a view derived from a specification
   678     "create drop object for a view derived from a specification
   679     "
   679     "
   680     |point extent root device|
   680     |point extent root device inst displayObject|
   681 
   681 
   682     device := aView device.
   682     device := aView device.
   683     root   := device rootView.
   683     root   := device rootView.
   684     extent := aView extent.
   684     extent := aView extent.
   685     point  := device translatePoint:0@0 from:(aView id) to:(root id).
   685     point  := device translatePoint:0@0 from:(aView id) to:(root id).
   686 
       
   687     DisplayObject := nil.
       
   688 
   686 
   689     (point x > 0 and:[point y > 0]) ifTrue:[
   687     (point x > 0 and:[point y > 0]) ifTrue:[
   690         point := point + extent.
   688         point := point + extent.
   691         (point x < root width and:[point y < root height]) ifTrue:[
   689         (point x < root width and:[point y < root height]) ifTrue:[
   692             aView topView raise.
   690             aView topView raise.
   693             device sync.
   691             device sync.
   694             aView invalidate.
   692             aView invalidate.
   695             aView windowGroup processExposeEvents.
   693             aView windowGroup processExposeEvents.
   696             DisplayObject := Image fromView:aView grab:false.
   694             displayObject := Image fromView:aView grab:false.
   697         ]
   695         ]
   698     ].
   696     ].
   699     DisplayObject isNil ifTrue:[
   697     displayObject isNil ifTrue:[
   700         DisplayObject := Form extent:extent depth:1.
   698         displayObject := Form extent:extent depth:1.
   701         DisplayObject colorMap:(Array with:Color white with:Color black).
   699         displayObject colorMap:(Array with:Color white with:Color black).
   702         DisplayObject fill:(Color colorId:0).
   700         displayObject fill:(Color colorId:0).
   703         DisplayObject paint:(Color colorId:1).
   701         displayObject paint:(Color colorId:1).
   704         DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y.
   702         displayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y.
   705     ].
   703     ].
   706     aSpec class == UISubSpecification ifTrue:[
   704     aSpec class == UISubSpecification ifTrue:[
   707         aSpec layout:(LayoutOrigin fromPoint:0@0)
   705         aSpec layout:(LayoutOrigin fromPoint:0@0)
   708     ].
   706     ].
   709   ^ self new theObject:aSpec
   707 
   710 
   708     inst := self new.
   711     "Modified: 26.7.1997 / 20:27:40 / cg"
   709     inst displayObject:displayObject.
       
   710     inst theObject:aSpec.
       
   711   ^ inst.
   712 ! !
   712 ! !
   713 
   713 
   714 !UIGalleryView class methodsFor:'documentation'!
   714 !UIGalleryView class methodsFor:'documentation'!
   715 
   715 
   716 version
   716 version