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