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