author | Claus Gittinger <cg@exept.de> |
Wed, 05 Jun 1996 17:31:20 +0200 | |
changeset 293 | d10ad10d23fa |
parent 283 | f28c462b9d13 |
child 319 | a1967838e91b |
permissions | -rw-r--r-- |
278 | 1 |
BoundedWrapper subclass:#BorderedWrapper |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
2 |
instanceVariableNames:'border inset insideColor borderWidth borderColor level' |
278 | 3 |
classVariableNames:'' |
4 |
poolDictionaries:'' |
|
5 |
category:'Graphics-Display Objects' |
|
6 |
! |
|
7 |
||
8 |
!BorderedWrapper class methodsFor:'documentation'! |
|
9 |
||
283 | 10 |
documentation |
11 |
" |
|
12 |
a wrapper which controls the layout (origin & extent) |
|
13 |
of its wrapped component and also draws a border around. |
|
14 |
||
15 |
If insideColor is nonNil, the area is cleared to that color, |
|
16 |
making the overall look be opaque. |
|
17 |
||
18 |
Notice: |
|
19 |
this class was implemented using protocol information |
|
20 |
from alpha testers and from the Hopkins/Horan book. |
|
21 |
- it may not be complete or compatible to the corresponding ST-80 class. |
|
22 |
If you encounter any incompatibilities, please forward a note |
|
23 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
24 |
||
25 |
[see also:] |
|
26 |
Wrapper TranslatingWrapper GeometricWrapper |
|
27 |
||
28 |
[author:] |
|
29 |
Claus Gittinger |
|
30 |
" |
|
31 |
||
32 |
! |
|
33 |
||
278 | 34 |
examples |
35 |
" |
|
36 |
[exBegin] |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
37 |
|t component| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
38 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
39 |
t := StandardSystemView extent:250@200. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
40 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
41 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
42 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
43 |
t addComponent:((BorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
44 |
on:component in:(0.1@0.1 corner:0.9@0.9)) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
45 |
insideColor:Color blue). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
46 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
47 |
t open |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
48 |
[exEnd] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
49 |
[exBegin] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
50 |
|t component| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
51 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
52 |
t := StandardSystemView extent:250@200. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
53 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
54 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
55 |
t addComponent:((BorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
56 |
on:component in:(10@10 corner:100@100)) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
57 |
borderWidth:1; borderColor:Color blue). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
58 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
59 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
60 |
t addComponent:((BorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
61 |
on:component in:(0.5@0.5 corner:1.0@1.0)) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
62 |
borderWidth:1; borderColor:Color red). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
63 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
64 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
65 |
t openAndWait. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
66 |
[exEnd] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
67 |
[exBegin] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
68 |
|t component| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
69 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
70 |
t := StandardSystemView extent:250@200. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
71 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
72 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
73 |
component borderWidth:1; borderColor:Color blue. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
74 |
component layout:((10@10 corner:100@100) asLayout). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
75 |
t addComponent:component. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
76 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
77 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
78 |
component borderWidth:1; borderColor:Color red. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
79 |
component layout:((0.5@0.5 corner:1.0@1.0) asLayout). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
80 |
t addComponent:component. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
81 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
82 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
83 |
t openAndWait. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
84 |
[exEnd] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
85 |
[exBegin] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
86 |
|t component| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
87 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
88 |
t := StandardSystemView extent:250@200. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
89 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
90 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
91 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
92 |
t addComponent:((BorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
93 |
on:component in:(0.1@0.1 corner:0.9@0.9)) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
94 |
level:1). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
95 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
96 |
t open |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
97 |
[exEnd] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
98 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
99 |
[exBegin] |
278 | 100 |
|t s v e component| |
101 |
||
102 |
t := StandardSystemView extent:250@200. |
|
103 |
s := HVScrollableView for:View miniScroller:true in:t. |
|
104 |
s origin:0.0@0.0 corner:1.0@1.0. |
|
105 |
v := s scrolledView. |
|
106 |
||
107 |
e := Rectangle origin:0@0 corner:80@80. |
|
108 |
component := FillingWrapper on:e. |
|
109 |
component foregroundColor:Color red. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
110 |
v addComponent:((BorderedWrapper on:component at:10@10) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
111 |
borderWidth:3; borderColor:Color green darkened). |
278 | 112 |
|
113 |
e := EllipticalArc boundingBox:(0@0 corner:80@80) |
|
114 |
startAngle:0 sweepAngle:360. |
|
115 |
component := StrokingWrapper on:e. |
|
283 | 116 |
component lineWidth:5; foregroundColor:Color yellow. |
117 |
v addComponent:((BorderedWrapper on:component at:50@50) |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
118 |
insideColor:Color blue; |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
119 |
level:1). |
278 | 120 |
|
121 |
e := Arrow from:0@0 to:50@150. |
|
122 |
component := StrokingWrapper on:e. |
|
123 |
component lineWidth:2. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
124 |
v addComponent:((BorderedWrapper on:component at:100@100) level:2). |
278 | 125 |
|
126 |
t open |
|
127 |
[exEnd] |
|
128 |
" |
|
129 |
! ! |
|
130 |
||
131 |
!BorderedWrapper class methodsFor:'instance creation'! |
|
132 |
||
133 |
on:aComponent in:aLayout border:aBorder |
|
134 |
^ (super on:aComponent in:aLayout) border:aBorder |
|
135 |
||
136 |
"Created: 28.5.1996 / 23:15:00 / cg" |
|
137 |
! ! |
|
138 |
||
139 |
!BorderedWrapper methodsFor:'accessing'! |
|
140 |
||
141 |
border |
|
142 |
"return border" |
|
143 |
||
144 |
^ border |
|
145 |
||
146 |
"Created: 28.5.1996 / 23:15:15 / cg" |
|
147 |
! |
|
148 |
||
149 |
border:something |
|
150 |
"set border" |
|
151 |
||
152 |
border := something. |
|
153 |
||
154 |
"Created: 28.5.1996 / 23:15:15 / cg" |
|
283 | 155 |
! |
156 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
157 |
borderColor:aColor |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
158 |
"set the 2D borderColor" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
159 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
160 |
|v| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
161 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
162 |
borderColor := aColor. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
163 |
(v := self view) notNil ifTrue:[v invalidate] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
164 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
165 |
"Modified: 5.6.1996 / 01:20:37 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
166 |
"Created: 5.6.1996 / 01:34:17 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
167 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
168 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
169 |
borderWidth |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
170 |
"return the 2D borderWidth" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
171 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
172 |
^ borderWidth |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
173 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
174 |
"Modified: 5.6.1996 / 01:52:41 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
175 |
"Created: 5.6.1996 / 14:27:28 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
176 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
177 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
178 |
borderWidth:aNumber |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
179 |
"set the 2D borderWidth" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
180 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
181 |
|v| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
182 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
183 |
borderWidth ~~ aNumber ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
184 |
borderWidth := aNumber. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
185 |
bounds notNil ifTrue:[self bounds:bounds]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
186 |
(v := self view) notNil ifTrue:[v invalidate] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
187 |
] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
188 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
189 |
"Created: 5.6.1996 / 01:33:56 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
190 |
"Modified: 5.6.1996 / 01:52:41 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
191 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
192 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
193 |
inset |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
194 |
|i| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
195 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
196 |
borderWidth notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
197 |
i := borderWidth |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
198 |
] ifFalse:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
199 |
i := 0 |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
200 |
]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
201 |
level notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
202 |
i := i + level abs. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
203 |
]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
204 |
^ i |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
205 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
206 |
"Created: 5.6.1996 / 01:03:25 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
207 |
"Modified: 5.6.1996 / 01:03:47 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
208 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
209 |
|
283 | 210 |
insideColor |
211 |
"return the insideColor" |
|
212 |
||
213 |
^ insideColor |
|
214 |
||
215 |
"Created: 29.5.1996 / 11:09:58 / cg" |
|
216 |
! |
|
217 |
||
218 |
insideColor:aColorOrPixmap |
|
219 |
"set the insideColor" |
|
220 |
||
221 |
insideColor := aColorOrPixmap |
|
222 |
||
223 |
"Created: 29.5.1996 / 11:10:16 / cg" |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
224 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
225 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
226 |
level |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
227 |
"return the 3D level" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
228 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
229 |
^ level |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
230 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
231 |
"Created: 5.6.1996 / 14:27:47 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
232 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
233 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
234 |
level:aNumber |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
235 |
"set the 3D level" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
236 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
237 |
|v| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
238 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
239 |
level ~~ aNumber ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
240 |
level := aNumber. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
241 |
bounds notNil ifTrue:[self bounds:bounds]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
242 |
(v := self view) notNil ifTrue:[v invalidate] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
243 |
] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
244 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
245 |
"Created: 5.6.1996 / 01:19:41 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
246 |
"Modified: 5.6.1996 / 01:53:00 / cg" |
283 | 247 |
! ! |
248 |
||
249 |
!BorderedWrapper methodsFor:'accessing - bounds'! |
|
250 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
251 |
bounds:newBounds |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
252 |
|v| |
283 | 253 |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
254 |
bounds := newBounds. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
255 |
component bounds:(newBounds insetBy:self inset). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
256 |
(v := self view) notNil ifTrue:[v invalidate] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
257 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
258 |
"Created: 5.6.1996 / 00:52:49 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
259 |
"Modified: 5.6.1996 / 02:35:30 / cg" |
278 | 260 |
! ! |
261 |
||
262 |
!BorderedWrapper methodsFor:'displaying'! |
|
263 |
||
264 |
displayOn:aGC |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
265 |
|bounds x y w h r b tX tY bw| |
278 | 266 |
|
267 |
bounds := self bounds. |
|
268 |
x := bounds left rounded. |
|
269 |
y := bounds top rounded. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
270 |
r := bounds right rounded. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
271 |
b := bounds bottom rounded. |
278 | 272 |
|
283 | 273 |
insideColor notNil ifTrue:[ |
274 |
aGC paint:insideColor. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
275 |
aGC fillRectangleX:x y:y width:(r-x) height:(b-y) |
283 | 276 |
]. |
277 |
||
278 |
super displayOn:aGC. |
|
279 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
280 |
bw := 0. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
281 |
borderColor notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
282 |
(borderWidth notNil |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
283 |
and:[borderWidth ~~ 0]) ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
284 |
bw := borderWidth. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
285 |
aGC paint:borderColor. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
286 |
0 to:(borderWidth-1) do:[:i | |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
287 |
aGC displayRectangleX:x+i y:y+i width:(r-x-i-i+1) height:(b-y-i-i+1). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
288 |
"/ aGC displayLineFromX:x+i y:y+i toX:r-i y:y+i. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
289 |
"/ aGC displayLineFromX:(r-i) y:y+i toX:(r-i) y:b-i. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
290 |
"/ aGC displayLineFromX:x+i y:b-i toX:(r-1-i) y:b-i. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
291 |
"/ aGC displayLineFromX:(x+i) y:y+i+1 toX:(x+i) y:b-1-i. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
292 |
]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
293 |
] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
294 |
]. |
283 | 295 |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
296 |
level notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
297 |
"/ drawEdgesForX: draws in deviceCoordinates - have to translate here. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
298 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
299 |
tX := aGC translation x. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
300 |
tY := aGC translation y. |
278 | 301 |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
302 |
aGC drawEdgesForX:x+tX+bw |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
303 |
y:y+tY+bw |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
304 |
width:(r-x+1-bw-bw) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
305 |
height:(b-y+1-bw-bw) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
306 |
level:level |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
307 |
shadow:Color black |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
308 |
light:Color white |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
309 |
halfShadow:Color grey |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
310 |
halfLight:Color grey |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
311 |
style:#iris |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
312 |
]. |
278 | 313 |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
314 |
"Modified: 5.6.1996 / 02:25:45 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
315 |
! ! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
316 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
317 |
!BorderedWrapper methodsFor:'queries'! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
318 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
319 |
hasBorder |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
320 |
^ true |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
321 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
322 |
"Created: 5.6.1996 / 14:28:38 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
323 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
324 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
325 |
isBorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
326 |
^ true |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
327 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
328 |
"Created: 5.6.1996 / 14:11:03 / cg" |
278 | 329 |
! ! |
330 |
||
331 |
!BorderedWrapper class methodsFor:'documentation'! |
|
332 |
||
333 |
version |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
334 |
^ '$Header: /cvs/stx/stx/libview2/BorderedWrapper.st,v 1.3 1996-06-05 15:30:29 cg Exp $' |
278 | 335 |
! ! |