--- a/ShadowV.st Sun May 12 21:58:58 1996 +0200
+++ b/ShadowV.st Sun May 12 22:02:04 1996 +0200
@@ -35,7 +35,8 @@
documentation
"
- just to give PopUps and ModalBoxes a shadow.
+ ShadowView exists just to give PopUps and ModalBoxes a shadow.
+
If shadowClr is nil, the shadowView reads the screen-contents under
itself before realization, and uses a greyed version of these pixels
for its background. If shadowClr is non-nil, that color is used
@@ -51,56 +52,68 @@
!ShadowView methodsFor:'accessing'!
for:aView
- "set the view I am for"
+ "set the view I am a shadow for"
myView := aView
+
+ "Modified: 12.5.1996 / 21:59:17 / cg"
!
isPopUpView
+ "return true, since I want to come up without decoration"
+
^ true
+
+ "Modified: 12.5.1996 / 21:57:23 / cg"
!
shadowColor:aColor
- "to set the shadow color"
+ "set the shadow color"
shadowClr := aColor
+
+ "Modified: 12.5.1996 / 21:59:25 / cg"
! !
!ShadowView methodsFor:'event handling'!
redraw
- "fill all of myself with black"
+ "if I have a shadowColor, fill all of myself with it;
+ otherwise, draw the saved image under myself."
|ws hs|
ws := shadowLength x.
hs := shadowLength y.
shadowClr isNil ifTrue:[
- imageUnderShadow isNil ifTrue:[^ self].
+ imageUnderShadow isNil ifTrue:[^ self].
-"
- self foreground:(Color colorId:-1) background:(Color colorId:0).
- self function:#copy.
-"
- self copyFrom:imageUnderShadow x:(width - ws) y:0
- toX:(width - ws) y:0
- width:ws height:height.
- self copyFrom:imageUnderShadow x:0 y:(height - hs)
- toX:0 y:(height - hs)
- width:width height:hs.
+ self copyFrom:imageUnderShadow x:(width - ws) y:0
+ toX:(width - ws) y:0
+ width:ws height:height.
+ self copyFrom:imageUnderShadow x:0 y:(height - hs)
+ toX:0 y:(height - hs)
+ width:width height:hs.
] ifFalse:[
- self paint:shadowClr.
- self fillRectangleX:(width - ws) y:0 width:ws height:height
+ self paint:shadowClr.
+ self fillRectangleX:(width - ws) y:0 width:ws height:height
]
+
+ "Modified: 12.5.1996 / 22:00:05 / cg"
! !
!ShadowView methodsFor:'initialization'!
create
+ "enable saveUnder of the covered view(s).
+ This may not be supported by all devices - these have to redraw then"
+
super create.
self backingStore:false.
self saveUnder:true
+
+ "Modified: 12.5.1996 / 22:00:47 / cg"
!
initialize
@@ -200,14 +213,17 @@
!
unmap
+ "relase the saved image of the covered view"
+
imageUnderShadow := nil.
super unmap.
"Modified: 3.5.1996 / 23:45:23 / stefan"
+ "Modified: 12.5.1996 / 22:01:17 / cg"
! !
!ShadowView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Attic/ShadowV.st,v 1.17 1996-05-03 23:05:49 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Attic/ShadowV.st,v 1.18 1996-05-12 20:02:04 cg Exp $'
! !
--- a/ShadowView.st Sun May 12 21:58:58 1996 +0200
+++ b/ShadowView.st Sun May 12 22:02:04 1996 +0200
@@ -35,7 +35,8 @@
documentation
"
- just to give PopUps and ModalBoxes a shadow.
+ ShadowView exists just to give PopUps and ModalBoxes a shadow.
+
If shadowClr is nil, the shadowView reads the screen-contents under
itself before realization, and uses a greyed version of these pixels
for its background. If shadowClr is non-nil, that color is used
@@ -51,56 +52,68 @@
!ShadowView methodsFor:'accessing'!
for:aView
- "set the view I am for"
+ "set the view I am a shadow for"
myView := aView
+
+ "Modified: 12.5.1996 / 21:59:17 / cg"
!
isPopUpView
+ "return true, since I want to come up without decoration"
+
^ true
+
+ "Modified: 12.5.1996 / 21:57:23 / cg"
!
shadowColor:aColor
- "to set the shadow color"
+ "set the shadow color"
shadowClr := aColor
+
+ "Modified: 12.5.1996 / 21:59:25 / cg"
! !
!ShadowView methodsFor:'event handling'!
redraw
- "fill all of myself with black"
+ "if I have a shadowColor, fill all of myself with it;
+ otherwise, draw the saved image under myself."
|ws hs|
ws := shadowLength x.
hs := shadowLength y.
shadowClr isNil ifTrue:[
- imageUnderShadow isNil ifTrue:[^ self].
+ imageUnderShadow isNil ifTrue:[^ self].
-"
- self foreground:(Color colorId:-1) background:(Color colorId:0).
- self function:#copy.
-"
- self copyFrom:imageUnderShadow x:(width - ws) y:0
- toX:(width - ws) y:0
- width:ws height:height.
- self copyFrom:imageUnderShadow x:0 y:(height - hs)
- toX:0 y:(height - hs)
- width:width height:hs.
+ self copyFrom:imageUnderShadow x:(width - ws) y:0
+ toX:(width - ws) y:0
+ width:ws height:height.
+ self copyFrom:imageUnderShadow x:0 y:(height - hs)
+ toX:0 y:(height - hs)
+ width:width height:hs.
] ifFalse:[
- self paint:shadowClr.
- self fillRectangleX:(width - ws) y:0 width:ws height:height
+ self paint:shadowClr.
+ self fillRectangleX:(width - ws) y:0 width:ws height:height
]
+
+ "Modified: 12.5.1996 / 22:00:05 / cg"
! !
!ShadowView methodsFor:'initialization'!
create
+ "enable saveUnder of the covered view(s).
+ This may not be supported by all devices - these have to redraw then"
+
super create.
self backingStore:false.
self saveUnder:true
+
+ "Modified: 12.5.1996 / 22:00:47 / cg"
!
initialize
@@ -200,14 +213,17 @@
!
unmap
+ "relase the saved image of the covered view"
+
imageUnderShadow := nil.
super unmap.
"Modified: 3.5.1996 / 23:45:23 / stefan"
+ "Modified: 12.5.1996 / 22:01:17 / cg"
! !
!ShadowView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/ShadowView.st,v 1.17 1996-05-03 23:05:49 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/ShadowView.st,v 1.18 1996-05-12 20:02:04 cg Exp $'
! !