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