author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 23 Jan 2017 12:42:33 +0000 | |
branch | jv |
changeset 3855 | 1db7742d33ad |
parent 1789 | f52f0a0d8448 |
permissions | -rw-r--r-- |
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
1 |
" |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
2 |
COPYRIGHT (c) Claus Gittinger / 2006 by eXept Software AG |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
3 |
All Rights Reserved |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
4 |
|
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
5 |
This software is furnished under a license and may be used |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
10 |
hereby transferred. |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
11 |
" |
1789 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
15 |
|
278 | 16 |
BoundedWrapper subclass:#BorderedWrapper |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
17 |
instanceVariableNames:'border inset insideColor borderWidth borderColor level' |
278 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
1789 | 20 |
category:'Compatibility-ST80-Graphics-Display Objects' |
278 | 21 |
! |
22 |
||
365 | 23 |
!BorderedWrapper class methodsFor:'documentation'! |
278 | 24 |
|
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
25 |
copyright |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
26 |
" |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
27 |
COPYRIGHT (c) Claus Gittinger / 2006 by eXept Software AG |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
28 |
All Rights Reserved |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
29 |
|
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
30 |
This software is furnished under a license and may be used |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
31 |
only in accordance with the terms of that license and with the |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
32 |
inclusion of the above copyright notice. This software may not |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
33 |
be provided or otherwise made available to, or used by, any |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
34 |
other person. No title to or ownership of the software is |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
35 |
hereby transferred. |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
36 |
" |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
37 |
! |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
38 |
|
283 | 39 |
documentation |
40 |
" |
|
41 |
a wrapper which controls the layout (origin & extent) |
|
42 |
of its wrapped component and also draws a border around. |
|
43 |
||
44 |
If insideColor is nonNil, the area is cleared to that color, |
|
45 |
making the overall look be opaque. |
|
46 |
||
47 |
Notice: |
|
48 |
this class was implemented using protocol information |
|
365 | 49 |
from alpha testers, from reading PD programs and |
50 |
from the Hopkins/Horan book. |
|
283 | 51 |
- it may not be complete or compatible to the corresponding ST-80 class. |
52 |
If you encounter any incompatibilities, please forward a note |
|
53 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
54 |
||
55 |
[see also:] |
|
56 |
Wrapper TranslatingWrapper GeometricWrapper |
|
57 |
||
58 |
[author:] |
|
59 |
Claus Gittinger |
|
60 |
" |
|
61 |
||
62 |
! |
|
63 |
||
278 | 64 |
examples |
65 |
" |
|
319 | 66 |
a 'no-border' border |
278 | 67 |
[exBegin] |
293
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 |
|
319 | 70 |
t := StandardSystemView extent:250@250. |
71 |
||
72 |
component := ClockView new. |
|
73 |
||
74 |
t addComponent:((BorderedWrapper |
|
75 |
on:component in:(0.1@0.1 corner:0.9@0.9) |
|
76 |
) |
|
77 |
). |
|
78 |
||
79 |
t open |
|
80 |
[exEnd] |
|
81 |
||
82 |
a '2D' border |
|
83 |
[exBegin] |
|
84 |
|t component| |
|
85 |
||
86 |
t := StandardSystemView extent:250@250. |
|
293
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 |
component := ClockView new. |
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 |
t addComponent:((BorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
91 |
on:component in:(0.1@0.1 corner:0.9@0.9)) |
319 | 92 |
borderColor:Color red; |
93 |
borderWidth:2). |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
94 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
95 |
t open |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
96 |
[exEnd] |
319 | 97 |
|
98 |
a '3D' border |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
99 |
[exBegin] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
100 |
|t component| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
101 |
|
319 | 102 |
t := StandardSystemView extent:250@250. |
103 |
||
104 |
component := ClockView new. |
|
105 |
||
106 |
t addComponent:((BorderedWrapper |
|
107 |
on:component in:(0.1@0.1 corner:0.9@0.9)) |
|
108 |
level:2). |
|
109 |
||
110 |
t open |
|
111 |
[exEnd] |
|
112 |
||
113 |
multiple components (absolute & relative sizes): |
|
114 |
[exBegin] |
|
115 |
|t component| |
|
116 |
||
117 |
t := StandardSystemView extent:250@250. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
118 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
119 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
120 |
t addComponent:((BorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
121 |
on:component in:(10@10 corner:100@100)) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
122 |
borderWidth:1; borderColor:Color blue). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
123 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
124 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
125 |
t addComponent:((BorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
126 |
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
|
127 |
borderWidth:1; borderColor:Color red). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
128 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
129 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
130 |
t openAndWait. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
131 |
[exEnd] |
319 | 132 |
|
133 |
multiple components (absolute & relative layouts): |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
134 |
[exBegin] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
135 |
|t component| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
136 |
|
319 | 137 |
t := StandardSystemView extent:250@250. |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
138 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
139 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
140 |
component borderWidth:1; borderColor:Color blue. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
141 |
component layout:((10@10 corner:100@100) asLayout). |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
142 |
t addComponent:component. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
143 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
144 |
component := ClockView new. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
145 |
component borderWidth:1; borderColor:Color red. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
146 |
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
|
147 |
t addComponent:component. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
148 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
149 |
t openAndWait. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
150 |
[exEnd] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
151 |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
152 |
non-view components (scrollable, both with & without insideColor): |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
153 |
[exBegin] |
278 | 154 |
|t s v e component| |
155 |
||
156 |
t := StandardSystemView extent:250@200. |
|
157 |
s := HVScrollableView for:View miniScroller:true in:t. |
|
158 |
s origin:0.0@0.0 corner:1.0@1.0. |
|
159 |
v := s scrolledView. |
|
160 |
||
161 |
e := Rectangle origin:0@0 corner:80@80. |
|
162 |
component := FillingWrapper on:e. |
|
163 |
component foregroundColor:Color red. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
164 |
v addComponent:((BorderedWrapper on:component at:10@10) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
165 |
borderWidth:3; borderColor:Color green darkened). |
278 | 166 |
|
167 |
e := EllipticalArc boundingBox:(0@0 corner:80@80) |
|
168 |
startAngle:0 sweepAngle:360. |
|
169 |
component := StrokingWrapper on:e. |
|
283 | 170 |
component lineWidth:5; foregroundColor:Color yellow. |
171 |
v addComponent:((BorderedWrapper on:component at:50@50) |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
172 |
insideColor:Color blue; |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
173 |
level:1). |
278 | 174 |
|
175 |
e := Arrow from:0@0 to:50@150. |
|
176 |
component := StrokingWrapper on:e. |
|
177 |
component lineWidth:2. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
178 |
v addComponent:((BorderedWrapper on:component at:100@100) level:2). |
278 | 179 |
|
180 |
t open |
|
181 |
[exEnd] |
|
182 |
" |
|
183 |
! ! |
|
184 |
||
365 | 185 |
!BorderedWrapper class methodsFor:'instance creation'! |
278 | 186 |
|
187 |
on:aComponent in:aLayout border:aBorder |
|
188 |
^ (super on:aComponent in:aLayout) border:aBorder |
|
189 |
||
190 |
"Created: 28.5.1996 / 23:15:00 / cg" |
|
386 | 191 |
! |
192 |
||
193 |
on:aComponent in:aLayout level:threeDLevel |
|
194 |
^ (super on:aComponent in:aLayout) level:threeDLevel |
|
195 |
||
196 |
"Created: 25.1.1997 / 16:56:51 / cg" |
|
278 | 197 |
! ! |
198 |
||
199 |
!BorderedWrapper methodsFor:'accessing'! |
|
200 |
||
201 |
border |
|
202 |
"return border" |
|
203 |
||
204 |
^ border |
|
205 |
||
206 |
"Created: 28.5.1996 / 23:15:15 / cg" |
|
207 |
! |
|
208 |
||
209 |
border:something |
|
210 |
"set border" |
|
211 |
||
212 |
border := something. |
|
213 |
||
214 |
"Created: 28.5.1996 / 23:15:15 / cg" |
|
283 | 215 |
! |
216 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
217 |
borderColor:aColor |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
218 |
"set the 2D borderColor" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
219 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
220 |
|v| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
221 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
222 |
borderColor := aColor. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
223 |
(v := self view) notNil ifTrue:[v invalidate] |
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 |
"Modified: 5.6.1996 / 01:20:37 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
226 |
"Created: 5.6.1996 / 01:34:17 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
227 |
! |
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 |
borderWidth |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
230 |
"return the 2D borderWidth" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
231 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
232 |
^ borderWidth |
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 |
"Modified: 5.6.1996 / 01:52:41 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
235 |
"Created: 5.6.1996 / 14:27:28 / cg" |
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 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
238 |
borderWidth:aNumber |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
239 |
"set the 2D borderWidth" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
240 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
241 |
|v| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
242 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
243 |
borderWidth ~~ aNumber ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
244 |
borderWidth := aNumber. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
245 |
bounds notNil ifTrue:[self bounds:bounds]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
246 |
(v := self view) notNil ifTrue:[v invalidate] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
247 |
] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
248 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
249 |
"Created: 5.6.1996 / 01:33:56 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
250 |
"Modified: 5.6.1996 / 01:52:41 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
251 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
252 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
253 |
inset |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
254 |
|i| |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
255 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
256 |
borderWidth notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
257 |
i := borderWidth |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
258 |
] ifFalse:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
259 |
i := 0 |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
260 |
]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
261 |
level notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
262 |
i := i + level abs. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
263 |
]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
264 |
^ i |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
265 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
266 |
"Created: 5.6.1996 / 01:03:25 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
267 |
"Modified: 5.6.1996 / 01:03:47 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
268 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
269 |
|
283 | 270 |
insideColor |
271 |
"return the insideColor" |
|
272 |
||
273 |
^ insideColor |
|
274 |
||
275 |
"Created: 29.5.1996 / 11:09:58 / cg" |
|
276 |
! |
|
277 |
||
278 |
insideColor:aColorOrPixmap |
|
279 |
"set the insideColor" |
|
280 |
||
281 |
insideColor := aColorOrPixmap |
|
282 |
||
283 |
"Created: 29.5.1996 / 11:10:16 / cg" |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
284 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
285 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
286 |
level |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
287 |
"return the 3D level" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
288 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
289 |
^ level |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
290 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
291 |
"Created: 5.6.1996 / 14:27:47 / cg" |
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 |
level:aNumber |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
295 |
"set the 3D level" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
296 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
297 |
|v| |
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 |
level ~~ aNumber ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
300 |
level := aNumber. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
301 |
bounds notNil ifTrue:[self bounds:bounds]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
302 |
(v := self view) notNil ifTrue:[v invalidate] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
303 |
] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
304 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
305 |
"Created: 5.6.1996 / 01:19:41 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
306 |
"Modified: 5.6.1996 / 01:53:00 / cg" |
283 | 307 |
! ! |
308 |
||
278 | 309 |
!BorderedWrapper methodsFor:'displaying'! |
310 |
||
311 |
displayOn:aGC |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
312 |
|bounds x y w h r b tX tY bw| |
278 | 313 |
|
314 |
bounds := self bounds. |
|
386 | 315 |
|
278 | 316 |
x := bounds left rounded. |
317 |
y := bounds top rounded. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
318 |
r := bounds right rounded. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
319 |
b := bounds bottom rounded. |
278 | 320 |
|
283 | 321 |
insideColor notNil ifTrue:[ |
322 |
aGC paint:insideColor. |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
323 |
aGC fillRectangleX:x y:y width:(r-x) height:(b-y) |
283 | 324 |
]. |
325 |
||
326 |
super displayOn:aGC. |
|
327 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
328 |
bw := 0. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
329 |
borderColor notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
330 |
(borderWidth notNil |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
331 |
and:[borderWidth ~~ 0]) ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
332 |
bw := borderWidth. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
333 |
aGC paint:borderColor. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
334 |
0 to:(borderWidth-1) do:[:i | |
386 | 335 |
aGC displayRectangleX:x+i y:y+i width:(r-x-i-i) height:(b-y-i-i). |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
336 |
]. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
337 |
] |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
338 |
]. |
283 | 339 |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
340 |
level notNil ifTrue:[ |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
341 |
"/ drawEdgesForX: draws in deviceCoordinates - have to translate here. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
342 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
343 |
tX := aGC translation x. |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
344 |
tY := aGC translation y. |
278 | 345 |
|
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
346 |
aGC drawEdgesForX:x+tX+bw |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
347 |
y:y+tY+bw |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
348 |
width:(r-x+1-bw-bw) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
349 |
height:(b-y+1-bw-bw) |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
350 |
level:level |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
351 |
shadow:Color black |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
352 |
light:Color white |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
353 |
halfShadow:Color grey |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
354 |
halfLight:Color grey |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
355 |
style:#iris |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
356 |
]. |
278 | 357 |
|
386 | 358 |
"Modified: 27.1.1997 / 11:45:28 / cg" |
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
359 |
! ! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
360 |
|
320 | 361 |
!BorderedWrapper methodsFor:'initialization'! |
362 |
||
363 |
initialize |
|
364 |
super initialize. |
|
365 |
||
366 |
inset := 0. |
|
367 |
insideColor := Color white. |
|
368 |
borderWidth := 0. |
|
369 |
insideColor := Color black. |
|
370 |
level := 0. |
|
371 |
||
372 |
"Created: 19.7.1996 / 17:22:33 / cg" |
|
373 |
! ! |
|
374 |
||
323 | 375 |
!BorderedWrapper methodsFor:'private'! |
376 |
||
377 |
layoutChanged |
|
378 |
|subBounds b| |
|
379 |
||
380 |
component notNil ifTrue:[ |
|
381 |
b := bounds insetBy:self inset. |
|
382 |
||
383 |
layout notNil ifTrue:[ |
|
384 |
subBounds := (layout |
|
385 |
rectangleRelativeTo:b |
|
386 |
preferred:b) rounded. |
|
387 |
] ifFalse:[ |
|
388 |
subBounds := b |
|
389 |
]. |
|
390 |
||
391 |
origin := b origin. |
|
392 |
"/ Transcript show:layout displayString; show:'subbounds: '; showCR:subBounds. |
|
393 |
component bounds:subBounds. |
|
394 |
] |
|
395 |
||
396 |
"Created: 19.7.1996 / 21:25:02 / cg" |
|
397 |
! ! |
|
398 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
399 |
!BorderedWrapper methodsFor:'queries'! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
400 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
401 |
hasBorder |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
402 |
^ true |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
403 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
404 |
"Created: 5.6.1996 / 14:28:38 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
405 |
! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
406 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
407 |
isBorderedWrapper |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
408 |
^ true |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
409 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
410 |
"Created: 5.6.1996 / 14:11:03 / cg" |
278 | 411 |
! ! |
412 |
||
365 | 413 |
!BorderedWrapper class methodsFor:'documentation'! |
278 | 414 |
|
415 |
version |
|
1789 | 416 |
^ '$Header: /cvs/stx/stx/libview2/BorderedWrapper.st,v 1.10 2003-08-18 12:13:55 cg Exp $' |
278 | 417 |
! ! |
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1789
diff
changeset
|
418 |