27 privateIn:UIGalleryView |
27 privateIn:UIGalleryView |
28 ! |
28 ! |
29 |
29 |
30 DropObject subclass:#DropSpec |
30 DropObject subclass:#DropSpec |
31 instanceVariableNames:'' |
31 instanceVariableNames:'' |
32 classVariableNames:'' |
32 classVariableNames:'DisplayObject' |
33 poolDictionaries:'' |
33 poolDictionaries:'' |
34 privateIn:UIGalleryView::Canvas |
34 privateIn:UIGalleryView::Canvas |
35 ! |
35 ! |
36 |
36 |
37 !UIGalleryView class methodsFor:'documentation'! |
37 !UIGalleryView class methodsFor:'documentation'! |
638 !UIGalleryView::Canvas::DropSpec class methodsFor:'instance creation'! |
638 !UIGalleryView::Canvas::DropSpec class methodsFor:'instance creation'! |
639 |
639 |
640 for:aView specification:aSpec |
640 for:aView specification:aSpec |
641 "create drop object for a view derived from a specification |
641 "create drop object for a view derived from a specification |
642 " |
642 " |
643 |point extent root device dO| |
643 |point extent root device| |
644 |
644 |
645 device := aView device. |
645 device := aView device. |
646 root := device rootView. |
646 root := device rootView. |
647 extent := aView extent. |
647 extent := aView extent. |
648 point := device translatePoint:0@0 from:(aView id) to:(root id). |
648 point := device translatePoint:0@0 from:(aView id) to:(root id). |
649 |
649 |
650 dO := nil. |
650 DisplayObject := nil. |
651 |
651 |
652 (point x > 0 and:[point y > 0]) ifTrue:[ |
652 (point x > 0 and:[point y > 0]) ifTrue:[ |
653 point := point + extent. |
653 point := point + extent. |
654 (point x < root width and:[point y < root height]) ifTrue:[ |
654 (point x < root width and:[point y < root height]) ifTrue:[ |
655 aView topView raise. |
655 aView topView raise. |
656 device sync. |
656 device sync. |
657 aView invalidate. |
657 aView invalidate. |
658 aView windowGroup processExposeEvents. |
658 aView windowGroup processExposeEvents. |
659 dO := Image fromView:aView grab:false. |
659 DisplayObject := Image fromView:aView grab:false. |
660 ] |
660 ] |
661 ]. |
661 ]. |
662 dO isNil ifTrue:[ |
662 DisplayObject isNil ifTrue:[ |
663 dO := Form extent:extent depth:1. |
663 DisplayObject := Form extent:extent depth:1. |
664 dO colorMap:(Array with:Color white with:Color black). |
664 DisplayObject colorMap:(Array with:Color white with:Color black). |
665 dO fill:(Color colorId:0). |
665 DisplayObject fill:(Color colorId:0). |
666 dO paint:(Color colorId:1). |
666 DisplayObject paint:(Color colorId:1). |
667 dO displayRectangleX:0 y:0 width:aView extent x height:aView extent y. |
667 DisplayObject displayRectangleX:0 y:0 width:aView extent x height:aView extent y. |
668 ]. |
668 ]. |
669 aSpec class == UISubSpecification ifTrue:[ |
669 aSpec class == UISubSpecification ifTrue:[ |
670 aSpec layout:(LayoutOrigin fromPoint:0@0) |
670 aSpec layout:(LayoutOrigin fromPoint:0@0) |
671 ]. |
671 ]. |
672 ^ self new theObject:aSpec |
672 ^ self new theObject:aSpec |
|
673 |
|
674 "Modified: 26.7.1997 / 20:27:40 / cg" |
673 ! ! |
675 ! ! |
674 |
676 |
675 !UIGalleryView class methodsFor:'documentation'! |
677 !UIGalleryView class methodsFor:'documentation'! |
676 |
678 |
677 version |
679 version |