author | HG Automerge |
Thu, 22 Dec 2016 23:11:31 +0000 | |
branch | jv |
changeset 3815 | 021778442c82 |
parent 3660 | 3d468b4f2577 |
child 3879 | e897abcffbfc |
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" |
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 |
|
245 | 86 |
!VisualComponent methodsFor:'accessing'! |
87 |
||
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
88 |
backgroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
89 |
^ Color white |
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 |
"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
|
92 |
! |
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 |
backgroundColor:aColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
95 |
"ignored here" |
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 |
"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
|
98 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
99 |
|
274 | 100 |
container:someContainer |
101 |
"ignored here" |
|
102 |
||
103 |
"Created: 9.5.1996 / 00:48:54 / cg" |
|
104 |
! |
|
105 |
||
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
106 |
defaultFont |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
107 |
^ SimpleView defaultFont |
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 |
"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
|
110 |
! |
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 |
font:aFont |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
113 |
"ignored here" |
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 |
"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
|
116 |
! |
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 |
foregroundColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
119 |
^ Color black |
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 |
"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
|
122 |
! |
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 |
foregroundColor:aColor |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
125 |
"ignored here" |
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:14:53 / 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 |
|
2659 | 130 |
geometryLayout |
131 |
"ignored here" |
|
132 |
||
133 |
^ nil |
|
134 |
! |
|
135 |
||
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
136 |
geometryLayout:aLayout |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
137 |
"ignored here" |
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:15:39 / cg" |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
140 |
! |
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 |
hiddenOnRealize:aBoolean |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
143 |
"ignored here" |
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 |
"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
|
146 |
! |
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 |
id |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
149 |
"ignored here" |
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 |
^ nil |
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 |
"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
|
154 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
155 |
|
274 | 156 |
setParentViewIn:aView |
157 |
"ignored here - for now" |
|
158 |
||
159 |
"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
|
160 |
! |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
161 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
162 |
superView |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
163 |
^ self container |
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
164 |
|
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
165 |
"Created: / 18.6.1998 / 16:16:07 / cg" |
274 | 166 |
! ! |
167 |
||
994 | 168 |
!VisualComponent methodsFor:'accessing-STX-attributes'! |
169 |
||
1270 | 170 |
application |
171 |
^ self container application |
|
172 |
||
173 |
"Created: / 19.11.1999 / 17:44:38 / cg" |
|
174 |
! |
|
175 |
||
994 | 176 |
borderWidth |
177 |
^ 0 |
|
178 |
||
179 |
"Modified: / 6.7.1998 / 13:47:28 / cg" |
|
180 |
! |
|
181 |
||
1789 | 182 |
borderWidth:aNumber |
183 |
^ 0 |
|
184 |
||
185 |
"Modified: / 6.7.1998 / 13:47:28 / cg" |
|
186 |
! |
|
187 |
||
188 |
canTab:aBoolean |
|
189 |
||
190 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
191 |
"Created: / 6.7.1998 / 13:48:35 / cg" |
|
192 |
! |
|
193 |
||
2659 | 194 |
layout |
195 |
^ self geometryLayout |
|
196 |
! |
|
994 | 197 |
|
2659 | 198 |
layout:newLayout |
199 |
self geometryLayout:newLayout |
|
994 | 200 |
! |
201 |
||
202 |
level |
|
203 |
^ 0 |
|
204 |
||
205 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
206 |
"Created: / 6.7.1998 / 13:46:50 / cg" |
|
207 |
! |
|
208 |
||
209 |
level:newLevel |
|
210 |
||
211 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
212 |
"Created: / 6.7.1998 / 13:47:43 / cg" |
|
2659 | 213 |
! |
214 |
||
215 |
name |
|
216 |
^ self printString |
|
217 |
! |
|
218 |
||
219 |
realized |
|
3281 | 220 |
"return true, if the receiver is realized. |
221 |
Realized means that it has been mapped (i.e. made visible) on |
|
222 |
the display (as opposed to being only created and possibly invisible)" |
|
223 |
||
2659 | 224 |
^ true |
225 |
! |
|
226 |
||
227 |
viewBackground |
|
228 |
^ self backgroundColor |
|
994 | 229 |
! ! |
230 |
||
231 |
!VisualComponent methodsFor:'accessing-dimensions'! |
|
274 | 232 |
|
233 |
bottom |
|
234 |
"return my bottom y coordinate" |
|
235 |
||
236 |
^ self bounds bottom |
|
237 |
||
238 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
239 |
"Created: 26.5.1996 / 12:56:12 / cg" |
|
240 |
! |
|
241 |
||
245 | 242 |
bounds |
246 | 243 |
"return my bounds" |
244 |
||
2659 | 245 |
frame isNil ifTrue:[ |
246 |
self computeBoundingBox. |
|
247 |
]. |
|
248 |
^ frame |
|
962
e6ccfc7fb22e
added more dummy methods to allow visualComponents to be
Claus Gittinger <cg@exept.de>
parents:
406
diff
changeset
|
249 |
! |
245 | 250 |
|
246 | 251 |
bounds:aRectangle |
252 |
"set my bounds" |
|
253 |
||
2664 | 254 |
self assert:aRectangle notNil. |
2659 | 255 |
frame := aRectangle |
256 |
! |
|
245 | 257 |
|
2682 | 258 |
defaultExtent |
259 |
^ 50@50 |
|
260 |
! |
|
261 |
||
2659 | 262 |
extent:anExtent |
263 |
"set my extent" |
|
264 |
||
2669 | 265 |
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
|
266 |
! |
245 | 267 |
|
274 | 268 |
left |
269 |
"return my left x coordinate" |
|
250 | 270 |
|
274 | 271 |
^ self bounds left |
272 |
||
273 |
"Created: 8.5.1996 / 23:36:07 / cg" |
|
274 |
"Modified: 26.5.1996 / 12:56:22 / cg" |
|
250 | 275 |
! |
276 |
||
2233 | 277 |
origin:newOrigin |
2669 | 278 |
"move my origin" |
2233 | 279 |
|
2682 | 280 |
|oldFrame| |
281 |
||
282 |
oldFrame := self frame. |
|
283 |
oldFrame isNil ifTrue:[ |
|
284 |
oldFrame := 0@0 extent:(self defaultExtent). |
|
285 |
]. |
|
286 |
||
287 |
frame := newOrigin copy extent:(oldFrame extent). |
|
2233 | 288 |
|
289 |
"Created: 8.5.1996 / 23:36:07 / cg" |
|
290 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
291 |
! |
|
292 |
||
245 | 293 |
preferredBounds |
246 | 294 |
"return my preferredBounds" |
295 |
||
323 | 296 |
^ 0@0 extent:100@100 |
245 | 297 |
|
298 |
"Created: 8.5.1996 / 23:36:29 / cg" |
|
323 | 299 |
"Modified: 19.7.1996 / 20:06:28 / cg" |
300 |
! |
|
301 |
||
302 |
preferredExtent |
|
303 |
^ self preferredBounds extent |
|
304 |
||
246 | 305 |
"Modified: 9.5.1996 / 00:13:22 / cg" |
323 | 306 |
"Created: 19.7.1996 / 20:06:19 / cg" |
247 | 307 |
! |
308 |
||
274 | 309 |
right |
310 |
"return my right x coordinate" |
|
311 |
||
312 |
^ self bounds right |
|
247 | 313 |
|
274 | 314 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
315 |
"Created: 26.5.1996 / 12:56:25 / cg" |
|
316 |
! |
|
317 |
||
318 |
top |
|
319 |
"return my top y coordinate" |
|
320 |
||
321 |
^ self bounds top |
|
322 |
||
323 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
324 |
"Created: 26.5.1996 / 12:56:15 / cg" |
|
321 | 325 |
! |
326 |
||
327 |
viewRectangle |
|
328 |
^ self bounds |
|
329 |
||
330 |
"Created: 19.7.1996 / 17:24:58 / cg" |
|
245 | 331 |
! ! |
332 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
333 |
!VisualComponent methodsFor:'accessing-mvc'! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
334 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
335 |
model |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
336 |
"return nil - generic components have no model" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
337 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
338 |
^ nil |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
339 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
340 |
"Created: 5.6.1996 / 14:18:16 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
341 |
! ! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
342 |
|
2127 | 343 |
!VisualComponent methodsFor:'change & update'! |
344 |
||
345 |
changedPreferredBounds: oldPreferredBoundsOrNil |
|
346 |
"The receiver is notifying any dependents that its preferredBounds has changed." |
|
347 |
||
348 |
self changed: #preferredBounds with: oldPreferredBoundsOrNil |
|
349 |
! ! |
|
350 |
||
265 | 351 |
!VisualComponent methodsFor:'displaying'! |
352 |
||
2210 | 353 |
displayOn:aGCOrStream |
406 | 354 |
"display the receiver on some graphicsContext. |
355 |
The sender is repsonsible for restoring the GC's state |
|
356 |
(i.e. it may be left in any undefined state)" |
|
357 |
||
2210 | 358 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
359 |
"/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
|
3358 | 360 |
(aGCOrStream isStream) ifTrue:[ |
2210 | 361 |
self printOn:aGCOrStream. |
362 |
^ self |
|
363 |
]. |
|
406 | 364 |
self subclassResponsibility |
365 |
||
2210 | 366 |
"Modified: / 10-02-1997 / 13:53:03 / cg" |
367 |
"Modified: / 11-09-2006 / 15:01:06 / User" |
|
406 | 368 |
! |
369 |
||
370 |
displayOn:aGC at:aPoint |
|
371 |
"display the receiver translated by some amount on some graphicsContext" |
|
372 |
||
265 | 373 |
|oldTranslation| |
374 |
||
375 |
oldTranslation := aGC translation. |
|
406 | 376 |
aGC translateBy:aPoint. |
265 | 377 |
self displayOn:aGC. |
378 |
aGC translation:oldTranslation |
|
379 |
||
406 | 380 |
"Created: 10.2.1997 / 13:47:18 / cg" |
381 |
"Modified: 10.2.1997 / 13:52:53 / cg" |
|
382 |
! |
|
383 |
||
384 |
displayOn:aGC x:x y:y |
|
385 |
"display the receiver translated by some amount on some graphicsContext" |
|
386 |
||
387 |
^ self displayOn:aGC at:(x @ y). |
|
388 |
||
389 |
"Modified: 10.2.1997 / 13:52:57 / cg" |
|
265 | 390 |
! ! |
391 |
||
245 | 392 |
!VisualComponent methodsFor:'event handling'! |
393 |
||
394 |
buttonPress:button x:x y:y |
|
246 | 395 |
"button was pressed over me - ignored here" |
245 | 396 |
|
246 | 397 |
"Modified: 9.5.1996 / 00:14:08 / cg" |
245 | 398 |
! |
399 |
||
400 |
buttonRelease:button x:x y:y |
|
246 | 401 |
"button was released over me - ignored here" |
245 | 402 |
|
403 |
"Created: 8.5.1996 / 23:38:30 / cg" |
|
246 | 404 |
"Modified: 9.5.1996 / 00:14:04 / cg" |
245 | 405 |
! |
406 |
||
321 | 407 |
containerChangedSize |
408 |
||
409 |
"Created: 19.7.1996 / 17:32:19 / cg" |
|
410 |
! |
|
411 |
||
412 |
containerMapped |
|
413 |
||
414 |
"Created: 19.7.1996 / 17:39:27 / cg" |
|
415 |
! |
|
416 |
||
417 |
containerUnmapped |
|
418 |
||
419 |
"Created: 19.7.1996 / 17:44:52 / cg" |
|
420 |
! |
|
421 |
||
422 |
destroy |
|
423 |
||
424 |
"Created: 19.7.1996 / 17:25:46 / cg" |
|
425 |
! |
|
426 |
||
2127 | 427 |
hasKeyboardFocus:aBoolean |
428 |
"notification from the windowGroup that I got the keyboardFocus." |
|
429 |
||
430 |
^ self |
|
431 |
||
432 |
"Created: / 6.7.1998 / 13:49:12 / cg" |
|
433 |
! |
|
434 |
||
245 | 435 |
keyPress:key x:x y:y |
246 | 436 |
"key was pressed over me - ignored here" |
245 | 437 |
|
438 |
"Created: 8.5.1996 / 23:46:03 / cg" |
|
246 | 439 |
"Modified: 9.5.1996 / 00:14:14 / cg" |
245 | 440 |
! |
441 |
||
442 |
keyRelease:key x:x y:y |
|
246 | 443 |
"key was released over me - ignored here" |
245 | 444 |
|
445 |
"Created: 8.5.1996 / 23:46:07 / cg" |
|
246 | 446 |
"Modified: 9.5.1996 / 00:14:19 / cg" |
994 | 447 |
! |
448 |
||
449 |
mapped |
|
450 |
||
451 |
"Created: / 6.7.1998 / 13:48:46 / cg" |
|
452 |
! |
|
453 |
||
454 |
showFocus:explicit |
|
455 |
||
456 |
"Created: / 6.7.1998 / 13:49:05 / cg" |
|
457 |
! |
|
458 |
||
459 |
showNoFocus:explicit |
|
460 |
||
461 |
"Created: / 6.7.1998 / 13:49:12 / cg" |
|
245 | 462 |
! ! |
463 |
||
464 |
!VisualComponent methodsFor:'initialization'! |
|
465 |
||
466 |
initialize |
|
467 |
||
406 | 468 |
"Modified: 10.2.1997 / 19:28:11 / cg" |
2932 | 469 |
! |
470 |
||
471 |
resize |
|
472 |
self extent:(self preferredExtent) |
|
473 |
||
474 |
"Created: / 25-07-2011 / 17:24:08 / cg" |
|
245 | 475 |
! ! |
476 |
||
265 | 477 |
!VisualComponent methodsFor:'queries'! |
478 |
||
994 | 479 |
delegate |
480 |
^ nil |
|
481 |
||
482 |
"Created: / 6.7.1998 / 13:50:10 / cg" |
|
483 |
! |
|
484 |
||
265 | 485 |
heightOn:aGC |
486 |
"return my height, if displayed on aGC; |
|
487 |
I assume that my height is independent of the device, and return |
|
488 |
the bounds height" |
|
489 |
||
490 |
^ self bounds height |
|
491 |
||
492 |
"Modified: 13.5.1996 / 10:15:13 / cg" |
|
493 |
! |
|
494 |
||
290
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
495 |
isBorderedWrapper |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
496 |
^ false |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
497 |
|
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
498 |
"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
|
499 |
! |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
500 |
|
2127 | 501 |
isCursorKeyConsumer |
3438 | 502 |
"return true, if the receiver can be controlled by cursor keys; |
503 |
i.e. it can handle some keyboard input, |
|
504 |
isCursorKeyConsumer are potential candidates for getting the keyboard |
|
505 |
focus initially within dialogBoxes, or when the focus-follows-pointer |
|
506 |
mode is off." |
|
507 |
||
2127 | 508 |
^ false |
509 |
! |
|
510 |
||
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
511 |
isExternalTopView |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
512 |
^ false |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
513 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
514 |
"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
|
515 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
516 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
517 |
isInputField |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
518 |
^ false |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
519 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
520 |
"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
|
521 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
522 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
523 |
isKeyboardConsumer |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
524 |
^ false |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
525 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
526 |
"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
|
527 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
528 |
|
321 | 529 |
isLayoutWrapper |
530 |
^ false |
|
531 |
||
532 |
"Created: 19.7.1996 / 17:50:59 / cg" |
|
533 |
! |
|
534 |
||
994 | 535 |
isRootView |
536 |
^ false |
|
537 |
||
538 |
"Created: / 6.7.1998 / 13:50:01 / cg" |
|
539 |
! |
|
540 |
||
2667 | 541 |
isTransparentBox |
542 |
^ false |
|
543 |
||
544 |
"Created: 19.7.1996 / 17:50:59 / cg" |
|
545 |
! |
|
546 |
||
290
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
547 |
isWrapper |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
548 |
^ false |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
549 |
|
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
550 |
"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
|
551 |
! |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
552 |
|
265 | 553 |
widthOn:aGC |
554 |
"return my width, if displayed on aGC; |
|
555 |
I assume that my width is independent of the device, and return |
|
556 |
the bounds width" |
|
557 |
||
558 |
^ self bounds width |
|
559 |
||
560 |
"Created: 13.5.1996 / 10:14:44 / cg" |
|
561 |
"Modified: 13.5.1996 / 10:15:17 / cg" |
|
562 |
! ! |
|
563 |
||
247 | 564 |
!VisualComponent methodsFor:'testing'! |
565 |
||
566 |
containsPoint:aPoint |
|
567 |
"return true, if the receiver contains aPoint" |
|
568 |
||
569 |
^ self bounds containsPoint:aPoint |
|
570 |
||
571 |
"Created: 9.5.1996 / 00:21:44 / cg" |
|
572 |
"Modified: 9.5.1996 / 00:22:00 / cg" |
|
573 |
! |
|
574 |
||
575 |
hasBorder |
|
576 |
"return true, if the receiver shows a border" |
|
577 |
||
578 |
^ false |
|
579 |
||
580 |
"Modified: 9.5.1996 / 00:21:29 / cg" |
|
581 |
! |
|
582 |
||
583 |
intersects:aRectangle |
|
3617 | 584 |
"return true, if the receiver's bounds intersects aRectangle" |
247 | 585 |
|
586 |
^ self bounds intersects:aRectangle |
|
587 |
||
588 |
"Created: 9.5.1996 / 00:21:18 / cg" |
|
589 |
"Modified: 9.5.1996 / 00:22:04 / cg" |
|
590 |
! ! |
|
591 |
||
365 | 592 |
!VisualComponent class methodsFor:'documentation'! |
245 | 593 |
|
594 |
version |
|
3617 | 595 |
^ '$Header$' |
3660 | 596 |
! |
597 |
||
598 |
version_CVS |
|
599 |
^ '$Header$' |
|
245 | 600 |
! ! |
3281 | 601 |