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