author | Claus Gittinger <cg@exept.de> |
Tue, 05 Sep 2000 14:44:17 +0200 | |
changeset 1403 | 94f9ec117aa5 |
parent 1220 | 39e5e28042da |
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 |
||
279 | 15 |
VisualPart subclass:#Wrapper |
245 | 16 |
instanceVariableNames:'component' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Graphics-Display Objects' |
|
20 |
! |
|
21 |
||
365 | 22 |
!Wrapper 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 |
" |
|
42 |
abstract superclass for all kinds of wrapping components |
|
43 |
||
365 | 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 VisualPart hierarchy. |
|
47 |
||
48 |
Notice: |
|
49 |
this class was implemented using protocol information |
|
50 |
from alpha testers, from reading PD programs and |
|
51 |
from the Hopkins/Horan book. |
|
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. |
|
56 |
||
245 | 57 |
[author:] |
58 |
Claus Gittinger |
|
59 |
" |
|
60 |
||
61 |
! ! |
|
62 |
||
365 | 63 |
!Wrapper class methodsFor:'instance creation'! |
245 | 64 |
|
65 |
on:aComponent |
|
66 |
^ self new component:aComponent |
|
67 |
||
68 |
"Created: 8.5.1996 / 23:20:46 / cg" |
|
69 |
! ! |
|
70 |
||
71 |
!Wrapper methodsFor:'accessing'! |
|
72 |
||
73 |
component |
|
247 | 74 |
"return the wrappers component" |
75 |
||
245 | 76 |
^ component |
77 |
||
78 |
"Created: 8.5.1996 / 23:17:30 / cg" |
|
247 | 79 |
"Modified: 9.5.1996 / 00:19:58 / cg" |
245 | 80 |
! |
81 |
||
82 |
component:someComponent |
|
247 | 83 |
"set the wrappers component" |
84 |
||
279 | 85 |
component := someComponent. |
86 |
component notNil ifTrue:[ |
|
283 | 87 |
"/ temporary kludge - images are (currently) not |
88 |
"/ inheriting from visualComponent ... |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
89 |
"/ (someComponent respondsTo:#container:) ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
90 |
someComponent container:self. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
91 |
"/ ]. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
92 |
bounds isNil ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
93 |
component bounds notNil ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
94 |
bounds := component bounds |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
95 |
] |
283 | 96 |
] |
279 | 97 |
] |
245 | 98 |
|
99 |
"Created: 8.5.1996 / 23:17:46 / cg" |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
100 |
"Modified: 5.6.1996 / 02:31:40 / cg" |
245 | 101 |
! ! |
102 |
||
103 |
!Wrapper methodsFor:'accessing - bounds'! |
|
104 |
||
105 |
bounds:newBounds |
|
246 | 106 |
"set my bounds - forwarded to the wrapped object" |
107 |
||
321 | 108 |
newBounds ~= bounds ifTrue:[ |
109 |
bounds := newBounds. |
|
110 |
component bounds:newBounds |
|
111 |
]. |
|
245 | 112 |
|
113 |
"Created: 8.5.1996 / 23:18:12 / cg" |
|
321 | 114 |
"Modified: 19.7.1996 / 17:47:34 / cg" |
245 | 115 |
! |
116 |
||
279 | 117 |
newBounds:newBounds containingBounds:containingBounds |
118 |
self bounds:newBounds |
|
119 |
||
120 |
"Created: 26.5.1996 / 16:50:49 / cg" |
|
121 |
! |
|
122 |
||
245 | 123 |
preferredBounds |
246 | 124 |
"return my preferredBounds as the components preferredBounds" |
125 |
||
245 | 126 |
^ component preferredBounds |
127 |
||
128 |
"Created: 8.5.1996 / 23:18:53 / cg" |
|
246 | 129 |
"Modified: 9.5.1996 / 00:10:32 / cg" |
245 | 130 |
! ! |
131 |
||
132 |
!Wrapper methodsFor:'displaying'! |
|
133 |
||
134 |
displayOn:aGC |
|
246 | 135 |
"display myself - forwarded to the wrapped object" |
136 |
||
245 | 137 |
component displayOn:aGC |
138 |
||
139 |
"Created: 8.5.1996 / 23:19:24 / cg" |
|
246 | 140 |
"Modified: 9.5.1996 / 00:10:59 / cg" |
245 | 141 |
! ! |
142 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
143 |
!Wrapper methodsFor:'queries'! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
144 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
145 |
hasBorder |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
146 |
^ false |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
147 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
148 |
"Created: 26.5.1996 / 16:47:37 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
149 |
! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
150 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
151 |
isWrapper |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
152 |
^ true |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
153 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
154 |
"Created: 5.6.1996 / 01:04:30 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
155 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
156 |
|
279 | 157 |
!Wrapper methodsFor:'testing'! |
158 |
||
159 |
containsPoint:aPoint |
|
160 |
^ component containsPoint:aPoint |
|
161 |
||
162 |
"Created: 26.5.1996 / 16:48:00 / cg" |
|
163 |
! |
|
164 |
||
165 |
intersects:aRectangle |
|
166 |
^ component intersects:aRectangle |
|
167 |
||
168 |
"Created: 26.5.1996 / 16:48:52 / cg" |
|
169 |
! ! |
|
170 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
171 |
!Wrapper methodsFor:'view protocol mimicri'! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
172 |
|
321 | 173 |
containerMapped |
174 |
component containerMapped |
|
175 |
||
176 |
"Created: 19.7.1996 / 17:41:31 / cg" |
|
177 |
! |
|
178 |
||
179 |
containerUnmapped |
|
180 |
component containerUnmapped |
|
181 |
||
182 |
"Created: 19.7.1996 / 17:45:10 / cg" |
|
183 |
! |
|
184 |
||
185 |
destroy |
|
186 |
component destroy |
|
187 |
||
188 |
"Created: 19.7.1996 / 17:26:02 / cg" |
|
189 |
! |
|
190 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
191 |
realize |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
192 |
"my container realized itself. Forward this to my component" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
193 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
194 |
component realize. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
195 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
196 |
"Created: 4.6.1996 / 21:29:27 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
197 |
! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
198 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
199 |
removeSubView:aView |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
200 |
component := nil |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
201 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
202 |
"Created: 4.6.1996 / 21:39:50 / cg" |
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
203 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
204 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
205 |
withAllSubViewsDo:aBlock |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
206 |
aBlock value:self. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
207 |
component notNil ifTrue:[ |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
208 |
component withAllSubViewsDo:aBlock |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
209 |
]. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
210 |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
211 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
212 |
|
365 | 213 |
!Wrapper class methodsFor:'documentation'! |
245 | 214 |
|
215 |
version |
|
1220
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
216 |
^ '$Header: /cvs/stx/stx/libview2/Wrapper.st,v 1.10 1999-08-18 19:49:53 cg Exp $' |
245 | 217 |
! ! |