author | Claus Gittinger <cg@exept.de> |
Wed, 18 Aug 1999 21:50:10 +0200 | |
changeset 1220 | 39e5e28042da |
parent 994 | 1b606988c010 |
child 1270 | 774bf14543af |
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 |
||
163 |
borderWidth |
|
164 |
^ 0 |
|
165 |
||
166 |
"Modified: / 6.7.1998 / 13:47:28 / cg" |
|
167 |
! |
|
168 |
||
169 |
layout:newLayout |
|
170 |
||
171 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
172 |
"Created: / 6.7.1998 / 13:48:35 / cg" |
|
173 |
! |
|
174 |
||
175 |
level |
|
176 |
^ 0 |
|
177 |
||
178 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
179 |
"Created: / 6.7.1998 / 13:46:50 / cg" |
|
180 |
! |
|
181 |
||
182 |
level:newLevel |
|
183 |
||
184 |
"Modified: / 6.7.1998 / 13:46:17 / cg" |
|
185 |
"Created: / 6.7.1998 / 13:47:43 / cg" |
|
186 |
! ! |
|
187 |
||
188 |
!VisualComponent methodsFor:'accessing-dimensions'! |
|
274 | 189 |
|
190 |
bottom |
|
191 |
"return my bottom y coordinate" |
|
192 |
||
193 |
^ self bounds bottom |
|
194 |
||
195 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
196 |
"Created: 26.5.1996 / 12:56:12 / cg" |
|
197 |
! |
|
198 |
||
245 | 199 |
bounds |
246 | 200 |
"return my bounds" |
201 |
||
245 | 202 |
^ bounds |
203 |
||
204 |
"Created: 8.5.1996 / 23:35:19 / cg" |
|
246 | 205 |
"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
|
206 |
! |
245 | 207 |
|
246 | 208 |
bounds:aRectangle |
209 |
"set my bounds" |
|
210 |
||
211 |
bounds := aRectangle |
|
245 | 212 |
|
213 |
"Created: 8.5.1996 / 23:36:07 / cg" |
|
246 | 214 |
"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
|
215 |
! |
245 | 216 |
|
274 | 217 |
left |
218 |
"return my left x coordinate" |
|
250 | 219 |
|
274 | 220 |
^ self bounds left |
221 |
||
222 |
"Created: 8.5.1996 / 23:36:07 / cg" |
|
223 |
"Modified: 26.5.1996 / 12:56:22 / cg" |
|
250 | 224 |
! |
225 |
||
245 | 226 |
preferredBounds |
246 | 227 |
"return my preferredBounds" |
228 |
||
323 | 229 |
^ 0@0 extent:100@100 |
245 | 230 |
|
231 |
"Created: 8.5.1996 / 23:36:29 / cg" |
|
323 | 232 |
"Modified: 19.7.1996 / 20:06:28 / cg" |
233 |
! |
|
234 |
||
235 |
preferredExtent |
|
236 |
^ self preferredBounds extent |
|
237 |
||
246 | 238 |
"Modified: 9.5.1996 / 00:13:22 / cg" |
323 | 239 |
"Created: 19.7.1996 / 20:06:19 / cg" |
247 | 240 |
! |
241 |
||
274 | 242 |
right |
243 |
"return my right x coordinate" |
|
244 |
||
245 |
^ self bounds right |
|
247 | 246 |
|
274 | 247 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
248 |
"Created: 26.5.1996 / 12:56:25 / cg" |
|
249 |
! |
|
250 |
||
251 |
top |
|
252 |
"return my top y coordinate" |
|
253 |
||
254 |
^ self bounds top |
|
255 |
||
256 |
"Modified: 9.5.1996 / 00:13:12 / cg" |
|
257 |
"Created: 26.5.1996 / 12:56:15 / cg" |
|
321 | 258 |
! |
259 |
||
260 |
viewRectangle |
|
261 |
^ self bounds |
|
262 |
||
263 |
"Created: 19.7.1996 / 17:24:58 / cg" |
|
245 | 264 |
! ! |
265 |
||
293
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
266 |
!VisualComponent methodsFor:'accessing-mvc'! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
267 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
268 |
model |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
269 |
"return nil - generic components have no model" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
270 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
271 |
^ nil |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
272 |
|
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
273 |
"Created: 5.6.1996 / 14:18:16 / cg" |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
274 |
! ! |
d10ad10d23fa
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
291
diff
changeset
|
275 |
|
265 | 276 |
!VisualComponent methodsFor:'displaying'! |
277 |
||
406 | 278 |
displayOn:aGC |
279 |
"display the receiver on some graphicsContext. |
|
280 |
The sender is repsonsible for restoring the GC's state |
|
281 |
(i.e. it may be left in any undefined state)" |
|
282 |
||
283 |
self subclassResponsibility |
|
284 |
||
285 |
"Modified: 10.2.1997 / 13:53:03 / cg" |
|
286 |
! |
|
287 |
||
288 |
displayOn:aGC at:aPoint |
|
289 |
"display the receiver translated by some amount on some graphicsContext" |
|
290 |
||
265 | 291 |
|oldTranslation| |
292 |
||
293 |
oldTranslation := aGC translation. |
|
406 | 294 |
aGC translateBy:aPoint. |
265 | 295 |
self displayOn:aGC. |
296 |
aGC translation:oldTranslation |
|
297 |
||
406 | 298 |
"Created: 10.2.1997 / 13:47:18 / cg" |
299 |
"Modified: 10.2.1997 / 13:52:53 / cg" |
|
300 |
! |
|
301 |
||
302 |
displayOn:aGC x:x y:y |
|
303 |
"display the receiver translated by some amount on some graphicsContext" |
|
304 |
||
305 |
^ self displayOn:aGC at:(x @ y). |
|
306 |
||
307 |
"Modified: 10.2.1997 / 13:52:57 / cg" |
|
265 | 308 |
! ! |
309 |
||
245 | 310 |
!VisualComponent methodsFor:'event handling'! |
311 |
||
312 |
buttonPress:button x:x y:y |
|
246 | 313 |
"button was pressed over me - ignored here" |
245 | 314 |
|
246 | 315 |
"Modified: 9.5.1996 / 00:14:08 / cg" |
245 | 316 |
! |
317 |
||
318 |
buttonRelease:button x:x y:y |
|
246 | 319 |
"button was released over me - ignored here" |
245 | 320 |
|
321 |
"Created: 8.5.1996 / 23:38:30 / cg" |
|
246 | 322 |
"Modified: 9.5.1996 / 00:14:04 / cg" |
245 | 323 |
! |
324 |
||
321 | 325 |
containerChangedSize |
326 |
||
327 |
"Created: 19.7.1996 / 17:32:19 / cg" |
|
328 |
! |
|
329 |
||
330 |
containerMapped |
|
331 |
||
332 |
"Created: 19.7.1996 / 17:39:27 / cg" |
|
333 |
! |
|
334 |
||
335 |
containerUnmapped |
|
336 |
||
337 |
"Created: 19.7.1996 / 17:44:52 / cg" |
|
338 |
! |
|
339 |
||
340 |
destroy |
|
341 |
||
342 |
"Created: 19.7.1996 / 17:25:46 / cg" |
|
343 |
! |
|
344 |
||
245 | 345 |
keyPress:key x:x y:y |
246 | 346 |
"key was pressed over me - ignored here" |
245 | 347 |
|
348 |
"Created: 8.5.1996 / 23:46:03 / cg" |
|
246 | 349 |
"Modified: 9.5.1996 / 00:14:14 / cg" |
245 | 350 |
! |
351 |
||
352 |
keyRelease:key x:x y:y |
|
246 | 353 |
"key was released over me - ignored here" |
245 | 354 |
|
355 |
"Created: 8.5.1996 / 23:46:07 / cg" |
|
246 | 356 |
"Modified: 9.5.1996 / 00:14:19 / cg" |
994 | 357 |
! |
358 |
||
359 |
mapped |
|
360 |
||
361 |
"Created: / 6.7.1998 / 13:48:46 / cg" |
|
362 |
! |
|
363 |
||
364 |
showFocus:explicit |
|
365 |
||
366 |
"Created: / 6.7.1998 / 13:49:05 / cg" |
|
367 |
! |
|
368 |
||
369 |
showNoFocus:explicit |
|
370 |
||
371 |
"Created: / 6.7.1998 / 13:49:12 / cg" |
|
245 | 372 |
! ! |
373 |
||
374 |
!VisualComponent methodsFor:'initialization'! |
|
375 |
||
376 |
initialize |
|
377 |
||
406 | 378 |
"Modified: 10.2.1997 / 19:28:11 / cg" |
245 | 379 |
! ! |
380 |
||
265 | 381 |
!VisualComponent methodsFor:'queries'! |
382 |
||
994 | 383 |
delegate |
384 |
^ nil |
|
385 |
||
386 |
"Created: / 6.7.1998 / 13:50:10 / cg" |
|
387 |
! |
|
388 |
||
265 | 389 |
heightOn:aGC |
390 |
"return my height, if displayed on aGC; |
|
391 |
I assume that my height is independent of the device, and return |
|
392 |
the bounds height" |
|
393 |
||
394 |
^ self bounds height |
|
395 |
||
396 |
"Modified: 13.5.1996 / 10:15:13 / cg" |
|
397 |
! |
|
398 |
||
290
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
399 |
isBorderedWrapper |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
400 |
^ false |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
401 |
|
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
402 |
"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
|
403 |
! |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
404 |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
405 |
isExternalTopView |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
406 |
^ false |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
407 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
408 |
"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
|
409 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
410 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
411 |
isInputField |
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: 19.7.1996 / 17:50:59 / 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 |
isKeyboardConsumer |
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 |
|
321 | 423 |
isLayoutWrapper |
424 |
^ false |
|
425 |
||
426 |
"Created: 19.7.1996 / 17:50:59 / cg" |
|
427 |
! |
|
428 |
||
994 | 429 |
isRootView |
430 |
^ false |
|
431 |
||
432 |
"Created: / 6.7.1998 / 13:50:01 / cg" |
|
433 |
! |
|
434 |
||
290
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
435 |
isWrapper |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
436 |
^ false |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
437 |
|
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
438 |
"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
|
439 |
! |
d26dc55ac7e4
prepare for components & non-view as superView
Claus Gittinger <cg@exept.de>
parents:
274
diff
changeset
|
440 |
|
265 | 441 |
widthOn:aGC |
442 |
"return my width, if displayed on aGC; |
|
443 |
I assume that my width is independent of the device, and return |
|
444 |
the bounds width" |
|
445 |
||
446 |
^ self bounds width |
|
447 |
||
448 |
"Created: 13.5.1996 / 10:14:44 / cg" |
|
449 |
"Modified: 13.5.1996 / 10:15:17 / cg" |
|
450 |
! ! |
|
451 |
||
247 | 452 |
!VisualComponent methodsFor:'testing'! |
453 |
||
454 |
containsPoint:aPoint |
|
455 |
"return true, if the receiver contains aPoint" |
|
456 |
||
457 |
^ self bounds containsPoint:aPoint |
|
458 |
||
459 |
"Created: 9.5.1996 / 00:21:44 / cg" |
|
460 |
"Modified: 9.5.1996 / 00:22:00 / cg" |
|
461 |
! |
|
462 |
||
463 |
hasBorder |
|
464 |
"return true, if the receiver shows a border" |
|
465 |
||
466 |
^ false |
|
467 |
||
468 |
"Modified: 9.5.1996 / 00:21:29 / cg" |
|
469 |
! |
|
470 |
||
471 |
intersects:aRectangle |
|
472 |
"return true, if the receivers bounds intersects aRectangle" |
|
473 |
||
474 |
^ self bounds intersects:aRectangle |
|
475 |
||
476 |
"Created: 9.5.1996 / 00:21:18 / cg" |
|
477 |
"Modified: 9.5.1996 / 00:22:04 / cg" |
|
478 |
! ! |
|
479 |
||
365 | 480 |
!VisualComponent class methodsFor:'documentation'! |
245 | 481 |
|
482 |
version |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
994
diff
changeset
|
483 |
^ '$Header: /cvs/stx/stx/libview2/VisualComponent.st,v 1.17 1999-08-18 19:50:00 cg Exp $' |
245 | 484 |
! ! |