--- a/ShadowView.st Tue May 28 20:22:41 1996 +0200
+++ b/ShadowView.st Tue May 28 20:31:04 1996 +0200
@@ -133,70 +133,72 @@
|root shW shH right bot kludge clr1 clr0 org blackIs0|
myView notNil ifTrue:[
- self origin:(myView origin + (myView borderWidth * 2) + shadowLength)
- extent:(myView extent).
+ self origin:(myView origin + (myView borderWidth * 2) + shadowLength)
+ extent:(myView extent).
- shadowClr isNil ifTrue:[
- "
- get the pixels under the shadow
- (copy from root-view into the 'imageUnderShadow'-form)
- "
- imageUnderShadow := Form width:width height:height depth:device depth on:device.
- imageUnderShadow initGC.
- device setClipByChildren:false in:imageUnderShadow gcId.
+ shadowClr isNil ifTrue:[
+ "
+ get the pixels under the shadow
+ (copy from root-view into the 'imageUnderShadow'-form)
+ "
+ imageUnderShadow := Form width:width height:height depth:device depth on:device.
+ imageUnderShadow initGC.
+ device setClipByChildren:false in:imageUnderShadow gcId.
- shW := shadowLength x.
- shH := shadowLength y.
- right := width - shW.
- bot := height - shH.
+ shW := shadowLength x.
+ shH := shadowLength y.
+ right := width - shW.
+ bot := height - shH.
- root := device rootView.
+ root := device rootView.
+
+ clr0 := Color colorId:0.
+ clr1 := Color colorId:1.
- clr0 := Color colorId:0.
- clr1 := Color colorId:1.
+ kludge := device depth == 1.
+ blackIs0 := (device blackpixel == 0).
+ (kludge and:[blackIs0]) ifTrue:[
+ imageUnderShadow foreground:clr0 background:clr1.
+ ].
- kludge := root device depth == 1.
- blackIs0 := (root device blackpixel == 0).
- (kludge and:[blackIs0]) ifTrue:[
- imageUnderShadow foreground:clr0 background:clr1.
- ].
+ org := self origin.
- org := self origin.
+ imageUnderShadow copyFrom:root x:(org x + right) y:org y
+ toX:right y:0 width:shW height:height.
- imageUnderShadow copyFrom:root x:(org x + right) y:org y
- toX:right y:0 width:shW height:height.
-
- imageUnderShadow copyFrom:root x:org x y:(org y + bot)
- toX:0 y:bot width:width height:shH.
+ imageUnderShadow copyFrom:root x:org x y:(org y + bot)
+ toX:0 y:bot width:width height:shH.
- "
- grey out the image (by oring-in a grey pattern)
- (sometimes we are lucky, and can do it with one raster-op)
- "
- (kludge and:[blackIs0]) ifFalse:[
- imageUnderShadow foreground:clr0 background:(Color colorId:-1).
- imageUnderShadow mask:(Form mediumGreyFormOn:device).
- imageUnderShadow function:#and.
- imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
- imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
+ "
+ grey out the image (by oring-in a grey pattern)
+ (sometimes we are lucky, and can do it with one raster-op)
+ "
+ (kludge and:[blackIs0]) ifFalse:[
+ imageUnderShadow foreground:clr0 background:(Color colorId:-1).
+ imageUnderShadow mask:(Form mediumGreyFormOn:device).
+ imageUnderShadow function:#and.
+ imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
+ imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
- blackIs0 ifFalse:[
- imageUnderShadow foreground:(Color black on:device) background:clr0.
- imageUnderShadow function:#or.
- imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
- imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
- ]
- ] ifTrue:[
- imageUnderShadow foreground:clr1 background:clr0.
- imageUnderShadow mask:(Form mediumGreyFormOn:device).
- imageUnderShadow function:#or.
- imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
- imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
- ].
- ].
- super realize.
- self raise
+ blackIs0 ifFalse:[
+ imageUnderShadow foreground:(Color black on:device) background:clr0.
+ imageUnderShadow function:#or.
+ imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
+ imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
+ ]
+ ] ifTrue:[
+ imageUnderShadow foreground:clr1 background:clr0.
+ imageUnderShadow mask:(Form mediumGreyFormOn:device).
+ imageUnderShadow function:#or.
+ imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
+ imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
+ ].
+ ].
+ super realize.
+ self raise
]
+
+ "Modified: 28.5.1996 / 20:24:34 / cg"
!
recreate
@@ -225,5 +227,5 @@
!ShadowView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/ShadowView.st,v 1.19 1996-05-28 16:28:09 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/ShadowView.st,v 1.20 1996-05-28 18:31:04 cg Exp $'
! !