ShadowView.st
author Claus Gittinger <cg@exept.de>
Fri, 23 Apr 1999 16:53:44 +0200
changeset 2575 ee1eb6c85319
parent 2188 6b013c605bc9
child 2830 edd000e38cf0
permissions -rw-r--r--
comment
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     1
"
6
7ee0cfde237d *** empty log message ***
claus
parents: 5
diff changeset
     2
 COPYRIGHT (c) 1991 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
     3
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     4
48194c26a46c Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
48194c26a46c Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
48194c26a46c Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
48194c26a46c Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
48194c26a46c Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
48194c26a46c Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
48194c26a46c Initial revision
claus
parents:
diff changeset
    11
"
48194c26a46c Initial revision
claus
parents:
diff changeset
    12
135
claus
parents: 86
diff changeset
    13
SimpleView subclass:#ShadowView
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
    14
	instanceVariableNames:'myView shadowLength shadowClr imageUnderShadow'
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
    15
	classVariableNames:''
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
    16
	poolDictionaries:''
626
9f4a3aa6f8e2 class category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    17
	category:'Views-Special'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    18
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    19
1292
130328a7fc1b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
    20
!ShadowView class methodsFor:'documentation'!
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    21
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    22
copyright
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    23
"
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    24
 COPYRIGHT (c) 1991 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
    25
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    26
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    27
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    28
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    30
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    31
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    32
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    33
"
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    34
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    35
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    36
documentation
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    37
"
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    38
    ShadowView exists just to give PopUps and ModalBoxes a shadow. 
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    39
72
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
    40
    If shadowClr is nil, the shadowView reads the screen-contents under 
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
    41
    itself before realization, and uses a greyed version of these pixels
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
    42
    for its background. If shadowClr is non-nil, that color is used
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
    43
    as shadow (can be used for solid-black shadows).
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
    44
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
    45
    The instance variable myView is the view, for which the shadow is for.
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
    46
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
    47
    [author:]
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 274
diff changeset
    48
        Claus Gittinger
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    49
"
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    50
! !
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    51
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    52
!ShadowView methodsFor:'accessing'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    53
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    54
for:aView
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    55
    "set the view I am a shadow for"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    56
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    57
    myView := aView
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    58
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    59
    "Modified: 12.5.1996 / 21:59:17 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    60
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    61
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    62
isPopUpView
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    63
    "return true, since I want to come up without decoration"
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    64
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    65
    ^ true
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    66
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    67
    "Modified: 12.5.1996 / 21:57:23 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    68
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    69
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    70
shadowColor:aColor
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    71
    "set the shadow color"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    72
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    73
    shadowClr := aColor
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    74
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    75
    "Modified: 12.5.1996 / 21:59:25 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    76
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    77
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    78
!ShadowView methodsFor:'event handling'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    79
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    80
redraw
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    81
    "if I have a shadowColor, fill all of myself with it;
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    82
     otherwise, draw the saved image under myself."
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    83
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    84
    |ws hs|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    85
274
30d54aac94a7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    86
    ws := shadowLength x.
30d54aac94a7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
    87
    hs := shadowLength y.
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    88
    shadowClr isNil ifTrue:[
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    89
        imageUnderShadow isNil ifTrue:[^ self].
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    90
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    91
        self copyFrom:imageUnderShadow x:(width - ws) y:0 
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    92
                                     toX:(width - ws) y:0 
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    93
                                   width:ws height:height.
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    94
        self copyFrom:imageUnderShadow x:0 y:(height - hs) 
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    95
                                     toX:0 y:(height - hs) 
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    96
                                   width:width height:hs.
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    97
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    98
    ] ifFalse:[
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
    99
        self paint:shadowClr.
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   100
        self fillRectangleX:(width - ws) y:0 width:ws height:height
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   101
    ]
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   102
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   103
    "Modified: 12.5.1996 / 22:00:05 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   104
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   105
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   106
!ShadowView methodsFor:'initialization'!
48194c26a46c Initial revision
claus
parents:
diff changeset
   107
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   108
create
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   109
    "enable saveUnder of the covered view(s).
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   110
     This may not be supported by all devices - these have to redraw then"
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   111
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   112
    super create.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   113
    self backingStore:false.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   114
    self saveUnder:true
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   115
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   116
    "Modified: 12.5.1996 / 22:00:47 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   117
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   118
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   119
initialize
48194c26a46c Initial revision
claus
parents:
diff changeset
   120
    super initialize.
48194c26a46c Initial revision
claus
parents:
diff changeset
   121
    borderWidth := 0.
72
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
   122
274
30d54aac94a7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   123
    shadowClr := StyleSheet at:#popUpShadowColor.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   124
48194c26a46c Initial revision
claus
parents:
diff changeset
   125
    "the length of the shadow from myView"
48194c26a46c Initial revision
claus
parents:
diff changeset
   126
    shadowLength := (device pixelPerMillimeter * 1.0) rounded
48194c26a46c Initial revision
claus
parents:
diff changeset
   127
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   128
48194c26a46c Initial revision
claus
parents:
diff changeset
   129
realize
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   130
    "realize the shadowView some distance away from myView,
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   131
     get the pixels under the shadow from the screen"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   132
72
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
   133
    |root shW shH right bot kludge clr1 clr0 org blackIs0|
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   134
48194c26a46c Initial revision
claus
parents:
diff changeset
   135
    myView notNil ifTrue:[
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   136
        self origin:(myView origin + (myView borderWidth * 2) + shadowLength) 
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   137
             extent:(myView extent).
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   138
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   139
        shadowClr isNil ifTrue:[
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   140
            "
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   141
             get the pixels under the shadow 
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   142
             (copy from root-view into the 'imageUnderShadow'-form)
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   143
            "
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   144
            imageUnderShadow := Form width:width height:height depth:device depth on:device.
1727
c2140507ab19 oops - X needs clippedByChildren:false.
Claus Gittinger <cg@exept.de>
parents: 1722
diff changeset
   145
            imageUnderShadow clippedByChildren:false.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   146
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   147
            shW := shadowLength x.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   148
            shH := shadowLength y.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   149
            right := width - shW.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   150
            bot := height - shH.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   151
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   152
            root := device rootView.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   153
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   154
            clr0 := Color colorId:0.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   155
            clr1 := Color colorId:1.
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
   156
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   157
            kludge := device depth == 1.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   158
            blackIs0 := (device blackpixel == 0).
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   159
            (kludge and:[blackIs0]) ifTrue:[
1727
c2140507ab19 oops - X needs clippedByChildren:false.
Claus Gittinger <cg@exept.de>
parents: 1722
diff changeset
   160
                imageUnderShadow foreground:clr0 background:clr1.
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   161
            ].
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
   162
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   163
            org := self origin.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   164
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   165
            imageUnderShadow copyFrom:root x:(org x + right) y:org y 
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   166
                                         toX:right y:0 width:shW height:height.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   167
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   168
            imageUnderShadow copyFrom:root x:org x y:(org y + bot) 
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   169
                                         toX:0 y:bot width:width height:shH.
72
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
   170
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   171
            "
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   172
             grey out the image (by oring-in a grey pattern)
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   173
             (sometimes we are lucky, and can do it with one raster-op)
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   174
            "
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   175
            (kludge and:[blackIs0]) ifFalse:[
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   176
                imageUnderShadow foreground:clr0 background:(Color colorId:-1).
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   177
                imageUnderShadow mask:(Form mediumGreyFormOn:device).
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   178
                imageUnderShadow function:#and.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   179
                imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   180
                imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   181
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   182
                blackIs0 ifFalse:[
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   183
                    imageUnderShadow foreground:(Color black on:device) background:clr0.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   184
                    imageUnderShadow function:#or.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   185
                    imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   186
                    imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   187
                ]
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   188
            ] ifTrue:[
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   189
                imageUnderShadow foreground:clr1 background:clr0.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   190
                imageUnderShadow mask:(Form mediumGreyFormOn:device).
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   191
                imageUnderShadow function:#or.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   192
                imageUnderShadow fillRectangleX:right y:0 width:shW height:height.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   193
                imageUnderShadow fillRectangleX:0 y:bot width:width height:shH.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   194
            ].
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   195
        ].
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   196
        super realize.
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   197
        self raise
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   198
    ]
743
64c9b71b3cc4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 729
diff changeset
   199
1727
c2140507ab19 oops - X needs clippedByChildren:false.
Claus Gittinger <cg@exept.de>
parents: 1722
diff changeset
   200
    "Modified: 12.5.1997 / 21:38:04 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   201
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   202
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   203
recreate
72
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
   204
    shadowClr notNil ifTrue:[
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
   205
	shadowClr := shadowClr on:device
3e84121988c3 *** empty log message ***
claus
parents: 54
diff changeset
   206
    ].
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   207
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   208
    "the length of the shadow from myView"
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   209
    shadowLength := (device pixelPerMillimeter * 1.0) rounded.
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   210
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   211
    super recreate.
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   212
    self backingStore:false.
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   213
    self saveUnder:true
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   214
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   215
642
aa4108a9abe0 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 626
diff changeset
   216
unmap
2575
ee1eb6c85319 comment
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   217
    "unmap the view - the view stays created (but invisible), and can be remapped again later.
ee1eb6c85319 comment
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   218
     relase the saved image of the covered view"
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   219
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   220
    imageUnderShadow := nil.
642
aa4108a9abe0 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 626
diff changeset
   221
    super unmap.
aa4108a9abe0 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 626
diff changeset
   222
aa4108a9abe0 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 626
diff changeset
   223
    "Modified: 3.5.1996 / 23:45:23 / stefan"
676
c51fc273f1cb commentary
Claus Gittinger <cg@exept.de>
parents: 642
diff changeset
   224
    "Modified: 12.5.1996 / 22:01:17 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   225
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   226
1292
130328a7fc1b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 950
diff changeset
   227
!ShadowView class methodsFor:'documentation'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   228
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   229
version
2575
ee1eb6c85319 comment
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   230
    ^ '$Header: /cvs/stx/stx/libview/ShadowView.st,v 1.28 1999-04-23 14:53:44 cg Exp $'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   231
! !