author | fm |
Wed, 25 Apr 2007 14:17:13 +0200 | |
changeset 2329 | f5a1833995a1 |
parent 2233 | 7245ea01ade1 |
child 2659 | 0583c55f7000 |
permissions | -rw-r--r-- |
245 | 1 |
" |
2 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
1789 | 15 |
"{ Package: 'stx:libview2' }" |
16 |
||
245 | 17 |
Object subclass:#VisualComponent |
406 | 18 |
instanceVariableNames:'bounds' |
245 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
1789 | 21 |
category:'Compatibility-ST80-Graphics-Display Objects' |
245 | 22 |
! |
23 |
||
365 | 24 |
!VisualComponent class methodsFor:'documentation'! |
245 | 25 |
|
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
||
39 |
||
40 |
! |
|
41 |
||
42 |
documentation |
|
43 |
" |
|
246 | 44 |
abstract superclass for all kinds of visual components. |
265 | 45 |
This class and its subclasses (currently) exist mostly for |
46 |
ST-80 compatibility - to provide a home for ported PD classes, |
|
47 |
which depend on the VisualComponent hierarchy. |
|
48 |
||
49 |
Notice: |
|
50 |
this class was implemented using protocol information |
|
365 | 51 |
from alpha testers, from reading PD programs and |
52 |
from the Hopkins/Horan book. |
|
265 | 53 |
- it may not be complete or compatible to the corresponding ST-80 class. |
54 |
If you encounter any incompatibilities, please forward a note |
|
55 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
56 |
This is still being constructed - not yet finished. |
|
245 | 57 |
|
58 |
[author:] |
|
59 |
Claus Gittinger |
|
265 | 60 |
|
61 |
[see also:] |
|
62 |
GeometricWrapper |
|
245 | 63 |
" |
64 |
||
65 |
! ! |
|
66 |
||
365 | 67 |
!VisualComponent class methodsFor:'instance creation'! |
245 | 68 |
|
69 |
new |
|
70 |
^ self basicNew initialize |
|
71 |
! ! |
|
72 |
||
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
73 |
!VisualComponent class methodsFor:'queries'! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
74 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
75 |
defaultFont |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
76 |
^ SimpleView defaultFont |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
77 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
78 |
"Created: / 18.6.1998 / 16:14:22 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
79 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
80 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
81 |
defaultViewBackgroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
82 |
^ SimpleView defaultViewBackgroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
83 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
84 |
"Created: / 18.6.1998 / 16:15:17 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
85 |
! ! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
86 |
|
245 | 87 |
!VisualComponent methodsFor:'accessing'! |
88 |
||
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
89 |
backgroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
90 |
^ Color white |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
91 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
92 |
"Created: / 18.6.1998 / 16:01:00 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
93 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
94 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
95 |
backgroundColor:aColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
96 |
"ignored here" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
97 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
98 |
"Created: / 18.6.1998 / 16:15:28 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
99 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
100 |
|
274 | 101 |
container:someContainer |
102 |
"ignored here" |
|
103 |
||
104 |
"Created: 9.5.1996 / 00:48:54 / cg" |
|
105 |
! |
|
106 |
||
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
107 |
defaultFont |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
108 |
^ SimpleView defaultFont |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
109 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
110 |
"Created: / 18.6.1998 / 16:13:56 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
111 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
112 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
113 |
font:aFont |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
114 |
"ignored here" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
115 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
116 |
"Created: / 18.6.1998 / 16:14:39 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
117 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
118 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
119 |
foregroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
120 |
^ Color black |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
121 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
122 |
"Created: / 18.6.1998 / 16:01:07 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
123 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
124 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
125 |
foregroundColor:aColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
126 |
"ignored here" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
127 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
128 |
"Created: / 18.6.1998 / 16:14:53 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
129 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
130 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
131 |
geometryLayout:aLayout |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
132 |
"ignored here" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
133 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
134 |
"Created: / 18.6.1998 / 16:15:39 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
135 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
136 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
137 |
hiddenOnRealize:aBoolean |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
138 |
"ignored here" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
139 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
140 |
"Created: / 18.6.1998 / 16:13:19 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
141 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
142 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
143 |
id |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
144 |
"ignored here" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
145 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
146 |
^ nil |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
147 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
148 |
"Created: / 18.6.1998 / 16:13:34 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
149 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
150 |
|
274 | 151 |
setParentViewIn:aView |
152 |
"ignored here - for now" |
|
153 |
||
154 |
"Created: 9.5.1996 / 00:19:39 / cg" |
|
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
155 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
156 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
157 |
superView |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
158 |
^ self container |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
159 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
160 |
"Created: / 18.6.1998 / 16:16:07 / cg" |
274 | 161 |
! ! |
162 |
||
994 | 163 |
!VisualComponent methodsFor:'accessing-STX-attributes'! |
164 |
||
1270 | 165 |
application |
166 |
^ self container application |
|
167 |
||
168 |
"Created: / 19.11.1999 / 17:44:38 / cg" |
|
169 |
! |
|
170 |
||
994 | 171 |
borderWidth |
172 |
^ 0 |
|
173 |
||
174 |
"Modified: / 6.7.1998 / 13:47:28 / cg" |
|
175 |
! |
|
176 |
||
1789 | 177 |
borderWidth:aNumber |
178 |
^ 0 |
|
179 |
||
180 |
"Modified: / 6.7.1998 / 13:47:28 / cg" |
|
181 |
! |
|
182 |
||
183 |
canTab:aBoolean |
|
184 |
||
185 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
186 |
"Created: / 6.7.1998 / 13:48:35 / cg" |
|
187 |
! |
|
188 |
||
994 | 189 |
layout:newLayout |
190 |
||
191 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
192 |
"Created: / 6.7.1998 / 13:48:35 / cg" |
|
193 |
! |
|
194 |
||
195 |
level |
|
196 |
^ 0 |
|
197 |
||
198 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
199 |
"Created: / 6.7.1998 / 13:46:50 / cg" |
|
200 |
! |
|
201 |
||
202 |
level:newLevel |
|
203 |
||
204 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
205 |
"Created: / 6.7.1998 / 13:47:43 / cg" |
|
206 |
! ! |
|
207 |
||
208 |
!VisualComponent methodsFor:'accessing-dimensions'! |
|
274 | 209 |
|
210 |
bottom |
|
211 |
"return my bottom y coordinate" |
|
212 |
||
213 |
^ self bounds bottom |
|
214 |
||
215 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
216 |
"Created: 26.5.1996 / 12:56:12 / cg" |
|
217 |
! |
|
218 |
||
245 | 219 |
bounds |
246 | 220 |
"return my bounds" |
221 |
||
245 | 222 |
^ bounds |
223 |
||
224 |
"Created: 8.5.1996 / 23:35:19 / cg" |
|
246 | 225 |
"Modified: 9.5.1996 / 00:12:00 / cg" |
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
226 |
! |
245 | 227 |
|
246 | 228 |
bounds:aRectangle |
229 |
"set my bounds" |
|
230 |
||
231 |
bounds := aRectangle |
|
245 | 232 |
|
233 |
"Created: 8.5.1996 / 23:36:07 / cg" |
|
246 | 234 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
235 |
! |
245 | 236 |
|
274 | 237 |
left |
238 |
"return my left x coordinate" |
|
250 | 239 |
|
274 | 240 |
^ self bounds left |
241 |
||
242 |
"Created: 8.5.1996 / 23:36:07 / cg" |
|
243 |
"Modified: 26.5.1996 / 12:56:22 / cg" |
|
250 | 244 |
! |
245 |
||
2233 | 246 |
origin:newOrigin |
247 |
"move my bounds" |
|
248 |
||
249 |
bounds isNil ifTrue:[ |
|
250 |
self containerChangedSize |
|
251 |
]. |
|
252 |
bounds := newOrigin extent:(bounds extent). |
|
253 |
||
254 |
"Created: 8.5.1996 / 23:36:07 / cg" |
|
255 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
256 |
! |
|
257 |
||
245 | 258 |
preferredBounds |
246 | 259 |
"return my preferredBounds" |
260 |
||
323 | 261 |
^ 0@0 extent:100@100 |
245 | 262 |
|
263 |
"Created: 8.5.1996 / 23:36:29 / cg" |
|
323 | 264 |
"Modified: 19.7.1996 / 20:06:28 / cg" |
265 |
! |
|
266 |
||
267 |
preferredExtent |
|
268 |
^ self preferredBounds extent |
|
269 |
||
246 | 270 |
"Modified: 9.5.1996 / 00:13:22 / cg" |
323 | 271 |
"Created: 19.7.1996 / 20:06:19 / cg" |
247 | 272 |
! |
273 |
||
274 | 274 |
right |
275 |
"return my right x coordinate" |
|
276 |
||
277 |
^ self bounds right |
|
247 | 278 |
|
274 | 279 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
280 |
"Created: 26.5.1996 / 12:56:25 / cg" |
|
281 |
! |
|
282 |
||
283 |
top |
|
284 |
"return my top y coordinate" |
|
285 |
||
286 |
^ self bounds top |
|
287 |
||
288 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
289 |
"Created: 26.5.1996 / 12:56:15 / cg" |
|
321 | 290 |
! |
291 |
||
292 |
viewRectangle |
|
293 |
^ self bounds |
|
294 |
||
295 |
"Created: 19.7.1996 / 17:24:58 / cg" |
|
245 | 296 |
! ! |
297 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
298 |
!VisualComponent methodsFor:'accessing-mvc'! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
299 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
300 |
model |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
301 |
"return nil - generic components have no model" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
302 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
303 |
^ nil |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
304 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
305 |
"Created: 5.6.1996 / 14:18:16 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
306 |
! ! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
307 |
|
2127 | 308 |
!VisualComponent methodsFor:'change & update'! |
309 |
||
310 |
changedPreferredBounds: oldPreferredBoundsOrNil |
|
311 |
"The receiver is notifying any dependents that its preferredBounds has changed." |
|
312 |
||
313 |
self changed: #preferredBounds with: oldPreferredBoundsOrNil |
|
314 |
! ! |
|
315 |
||
265 | 316 |
!VisualComponent methodsFor:'displaying'! |
317 |
||
2210 | 318 |
displayOn:aGCOrStream |
406 | 319 |
"display the receiver on some graphicsContext. |
320 |
The sender is repsonsible for restoring the GC's state |
|
321 |
(i.e. it may be left in any undefined state)" |
|
322 |
||
2210 | 323 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
324 |
"/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
|
325 |
(aGCOrStream isStream or:[aGCOrStream == Transcript]) ifTrue:[ |
|
326 |
self printOn:aGCOrStream. |
|
327 |
^ self |
|
328 |
]. |
|
406 | 329 |
self subclassResponsibility |
330 |
||
2210 | 331 |
"Modified: / 10-02-1997 / 13:53:03 / cg" |
332 |
"Modified: / 11-09-2006 / 15:01:06 / User" |
|
406 | 333 |
! |
334 |
||
335 |
displayOn:aGC at:aPoint |
|
336 |
"display the receiver translated by some amount on some graphicsContext" |
|
337 |
||
265 | 338 |
|oldTranslation| |
339 |
||
340 |
oldTranslation := aGC translation. |
|
406 | 341 |
aGC translateBy:aPoint. |
265 | 342 |
self displayOn:aGC. |
343 |
aGC translation:oldTranslation |
|
344 |
||
406 | 345 |
"Created: 10.2.1997 / 13:47:18 / cg" |
346 |
"Modified: 10.2.1997 / 13:52:53 / cg" |
|
347 |
! |
|
348 |
||
349 |
displayOn:aGC x:x y:y |
|
350 |
"display the receiver translated by some amount on some graphicsContext" |
|
351 |
||
352 |
^ self displayOn:aGC at:(x @ y). |
|
353 |
||
354 |
"Modified: 10.2.1997 / 13:52:57 / cg" |
|
265 | 355 |
! ! |
356 |
||
245 | 357 |
!VisualComponent methodsFor:'event handling'! |
358 |
||
359 |
buttonPress:button x:x y:y |
|
246 | 360 |
"button was pressed over me - ignored here" |
245 | 361 |
|
246 | 362 |
"Modified: 9.5.1996 / 00:14:08 / cg" |
245 | 363 |
! |
364 |
||
365 |
buttonRelease:button x:x y:y |
|
246 | 366 |
"button was released over me - ignored here" |
245 | 367 |
|
368 |
"Created: 8.5.1996 / 23:38:30 / cg" |
|
246 | 369 |
"Modified: 9.5.1996 / 00:14:04 / cg" |
245 | 370 |
! |
371 |
||
321 | 372 |
containerChangedSize |
373 |
||
374 |
"Created: 19.7.1996 / 17:32:19 / cg" |
|
375 |
! |
|
376 |
||
377 |
containerMapped |
|
378 |
||
379 |
"Created: 19.7.1996 / 17:39:27 / cg" |
|
380 |
! |
|
381 |
||
382 |
containerUnmapped |
|
383 |
||
384 |
"Created: 19.7.1996 / 17:44:52 / cg" |
|
385 |
! |
|
386 |
||
387 |
destroy |
|
388 |
||
389 |
"Created: 19.7.1996 / 17:25:46 / cg" |
|
390 |
! |
|
391 |
||
2127 | 392 |
hasKeyboardFocus:aBoolean |
393 |
"notification from the windowGroup that I got the keyboardFocus." |
|
394 |
||
395 |
^ self |
|
396 |
||
397 |
"Created: / 6.7.1998 / 13:49:12 / cg" |
|
398 |
! |
|
399 |
||
245 | 400 |
keyPress:key x:x y:y |
246 | 401 |
"key was pressed over me - ignored here" |
245 | 402 |
|
403 |
"Created: 8.5.1996 / 23:46:03 / cg" |
|
246 | 404 |
"Modified: 9.5.1996 / 00:14:14 / cg" |
245 | 405 |
! |
406 |
||
407 |
keyRelease:key x:x y:y |
|
246 | 408 |
"key was released over me - ignored here" |
245 | 409 |
|
410 |
"Created: 8.5.1996 / 23:46:07 / cg" |
|
246 | 411 |
"Modified: 9.5.1996 / 00:14:19 / cg" |
994 | 412 |
! |
413 |
||
414 |
mapped |
|
415 |
||
416 |
"Created: / 6.7.1998 / 13:48:46 / cg" |
|
417 |
! |
|
418 |
||
419 |
showFocus:explicit |
|
420 |
||
421 |
"Created: / 6.7.1998 / 13:49:05 / cg" |
|
422 |
! |
|
423 |
||
424 |
showNoFocus:explicit |
|
425 |
||
426 |
"Created: / 6.7.1998 / 13:49:12 / cg" |
|
245 | 427 |
! ! |
428 |
||
429 |
!VisualComponent methodsFor:'initialization'! |
|
430 |
||
431 |
initialize |
|
432 |
||
406 | 433 |
"Modified: 10.2.1997 / 19:28:11 / cg" |
245 | 434 |
! ! |
435 |
||
265 | 436 |
!VisualComponent methodsFor:'queries'! |
437 |
||
994 | 438 |
delegate |
439 |
^ nil |
|
440 |
||
441 |
"Created: / 6.7.1998 / 13:50:10 / cg" |
|
442 |
! |
|
443 |
||
265 | 444 |
heightOn:aGC |
445 |
"return my height, if displayed on aGC; |
|
446 |
I assume that my height is independent of the device, and return |
|
447 |
the bounds height" |
|
448 |
||
449 |
^ self bounds height |
|
450 |
||
451 |
"Modified: 13.5.1996 / 10:15:13 / cg" |
|
452 |
! |
|
453 |
||
290
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
454 |
isBorderedWrapper |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
455 |
^ false |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
456 |
|
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
457 |
"Created: 5.6.1996 / 14:11:18 / cg" |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
458 |
! |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
459 |
|
2127 | 460 |
isCursorKeyConsumer |
461 |
^ false |
|
462 |
! |
|
463 |
||
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
464 |
isExternalTopView |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
465 |
^ false |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
466 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
467 |
"Created: / 6.7.1998 / 13:50:01 / cg" |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
468 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
469 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
470 |
isInputField |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
471 |
^ false |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
472 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
473 |
"Created: 19.7.1996 / 17:50:59 / cg" |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
474 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
475 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
476 |
isKeyboardConsumer |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
477 |
^ false |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
478 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
479 |
"Created: 19.7.1996 / 17:50:59 / cg" |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
480 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
481 |
|
321 | 482 |
isLayoutWrapper |
483 |
^ false |
|
484 |
||
485 |
"Created: 19.7.1996 / 17:50:59 / cg" |
|
486 |
! |
|
487 |
||
994 | 488 |
isRootView |
489 |
^ false |
|
490 |
||
491 |
"Created: / 6.7.1998 / 13:50:01 / cg" |
|
492 |
! |
|
493 |
||
290
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
494 |
isWrapper |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
495 |
^ false |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
496 |
|
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
497 |
"Created: 5.6.1996 / 01:04:40 / cg" |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
498 |
! |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
499 |
|
265 | 500 |
widthOn:aGC |
501 |
"return my width, if displayed on aGC; |
|
502 |
I assume that my width is independent of the device, and return |
|
503 |
the bounds width" |
|
504 |
||
505 |
^ self bounds width |
|
506 |
||
507 |
"Created: 13.5.1996 / 10:14:44 / cg" |
|
508 |
"Modified: 13.5.1996 / 10:15:17 / cg" |
|
509 |
! ! |
|
510 |
||
247 | 511 |
!VisualComponent methodsFor:'testing'! |
512 |
||
513 |
containsPoint:aPoint |
|
514 |
"return true, if the receiver contains aPoint" |
|
515 |
||
516 |
^ self bounds containsPoint:aPoint |
|
517 |
||
518 |
"Created: 9.5.1996 / 00:21:44 / cg" |
|
519 |
"Modified: 9.5.1996 / 00:22:00 / cg" |
|
520 |
! |
|
521 |
||
522 |
hasBorder |
|
523 |
"return true, if the receiver shows a border" |
|
524 |
||
525 |
^ false |
|
526 |
||
527 |
"Modified: 9.5.1996 / 00:21:29 / cg" |
|
528 |
! |
|
529 |
||
530 |
intersects:aRectangle |
|
531 |
"return true, if the receivers bounds intersects aRectangle" |
|
532 |
||
533 |
^ self bounds intersects:aRectangle |
|
534 |
||
535 |
"Created: 9.5.1996 / 00:21:18 / cg" |
|
536 |
"Modified: 9.5.1996 / 00:22:04 / cg" |
|
537 |
! ! |
|
538 |
||
365 | 539 |
!VisualComponent class methodsFor:'documentation'! |
245 | 540 |
|
541 |
version |
|
2233 | 542 |
^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.22 2006-09-19 17:22:16 fm Exp $' |
245 | 543 |
! ! |