author | Claus Gittinger <cg@exept.de> |
Wed, 03 Dec 2003 12:48:56 +0100 | |
changeset 1869 | c6800c75b7d0 |
parent 1789 | f52f0a0d8448 |
child 2209 | e5c8505b8530 |
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 |
||
1789 | 15 |
"{ Package: 'stx:libview2' }" |
16 |
||
279 | 17 |
VisualPart subclass:#Wrapper |
245 | 18 |
instanceVariableNames:'component' |
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
1789 | 21 |
category:'Compatibility-ST80-Graphics-Display Objects' |
245 | 22 |
! |
23 |
||
365 | 24 |
!Wrapper class methodsFor:'documentation'! |
245 | 25 |
|
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1996 by Claus Gittinger |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
||
39 |
||
40 |
! |
|
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
abstract superclass for all kinds of wrapping components |
|
45 |
||
365 | 46 |
This class and its subclasses (currently) exist mostly for |
47 |
ST-80 compatibility - to provide a home for ported PD classes, |
|
48 |
which depend on the VisualPart hierarchy. |
|
49 |
||
50 |
Notice: |
|
51 |
this class was implemented using protocol information |
|
52 |
from alpha testers, from reading PD programs and |
|
53 |
from the Hopkins/Horan book. |
|
54 |
- it may not be complete or compatible to the corresponding ST-80 class. |
|
55 |
If you encounter any incompatibilities, please forward a note |
|
56 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
57 |
This is still being constructed - not yet finished. |
|
58 |
||
245 | 59 |
[author:] |
60 |
Claus Gittinger |
|
61 |
" |
|
62 |
||
63 |
! ! |
|
64 |
||
365 | 65 |
!Wrapper class methodsFor:'instance creation'! |
245 | 66 |
|
67 |
on:aComponent |
|
68 |
^ self new component:aComponent |
|
69 |
||
70 |
"Created: 8.5.1996 / 23:20:46 / cg" |
|
71 |
! ! |
|
72 |
||
73 |
!Wrapper methodsFor:'accessing'! |
|
74 |
||
75 |
component |
|
247 | 76 |
"return the wrappers component" |
77 |
||
245 | 78 |
^ component |
79 |
||
80 |
"Created: 8.5.1996 / 23:17:30 / cg" |
|
247 | 81 |
"Modified: 9.5.1996 / 00:19:58 / cg" |
245 | 82 |
! |
83 |
||
84 |
component:someComponent |
|
247 | 85 |
"set the wrappers component" |
86 |
||
279 | 87 |
component := someComponent. |
88 |
component notNil ifTrue:[ |
|
283 | 89 |
"/ temporary kludge - images are (currently) not |
90 |
"/ inheriting from visualComponent ... |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
91 |
"/ (someComponent respondsTo:#container:) ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
92 |
someComponent container:self. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
93 |
"/ ]. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
94 |
bounds isNil ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
95 |
component bounds notNil ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
96 |
bounds := component bounds |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
97 |
] |
283 | 98 |
] |
279 | 99 |
] |
245 | 100 |
|
101 |
"Created: 8.5.1996 / 23:17:46 / cg" |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
102 |
"Modified: 5.6.1996 / 02:31:40 / cg" |
245 | 103 |
! ! |
104 |
||
105 |
!Wrapper methodsFor:'accessing - bounds'! |
|
106 |
||
107 |
bounds:newBounds |
|
246 | 108 |
"set my bounds - forwarded to the wrapped object" |
109 |
||
321 | 110 |
newBounds ~= bounds ifTrue:[ |
111 |
bounds := newBounds. |
|
112 |
component bounds:newBounds |
|
113 |
]. |
|
245 | 114 |
|
115 |
"Created: 8.5.1996 / 23:18:12 / cg" |
|
321 | 116 |
"Modified: 19.7.1996 / 17:47:34 / cg" |
245 | 117 |
! |
118 |
||
279 | 119 |
newBounds:newBounds containingBounds:containingBounds |
120 |
self bounds:newBounds |
|
121 |
||
122 |
"Created: 26.5.1996 / 16:50:49 / cg" |
|
123 |
! |
|
124 |
||
245 | 125 |
preferredBounds |
246 | 126 |
"return my preferredBounds as the components preferredBounds" |
127 |
||
245 | 128 |
^ component preferredBounds |
129 |
||
130 |
"Created: 8.5.1996 / 23:18:53 / cg" |
|
246 | 131 |
"Modified: 9.5.1996 / 00:10:32 / cg" |
245 | 132 |
! ! |
133 |
||
134 |
!Wrapper methodsFor:'displaying'! |
|
135 |
||
136 |
displayOn:aGC |
|
246 | 137 |
"display myself - forwarded to the wrapped object" |
138 |
||
245 | 139 |
component displayOn:aGC |
140 |
||
141 |
"Created: 8.5.1996 / 23:19:24 / cg" |
|
246 | 142 |
"Modified: 9.5.1996 / 00:10:59 / cg" |
245 | 143 |
! ! |
144 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
145 |
!Wrapper methodsFor:'queries'! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
146 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
147 |
hasBorder |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
148 |
^ false |
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 |
"Created: 26.5.1996 / 16:47:37 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
151 |
! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
152 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
153 |
isWrapper |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
154 |
^ true |
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 |
"Created: 5.6.1996 / 01:04:30 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
157 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
158 |
|
279 | 159 |
!Wrapper methodsFor:'testing'! |
160 |
||
161 |
containsPoint:aPoint |
|
162 |
^ component containsPoint:aPoint |
|
163 |
||
164 |
"Created: 26.5.1996 / 16:48:00 / cg" |
|
165 |
! |
|
166 |
||
167 |
intersects:aRectangle |
|
168 |
^ component intersects:aRectangle |
|
169 |
||
170 |
"Created: 26.5.1996 / 16:48:52 / cg" |
|
171 |
! ! |
|
172 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
173 |
!Wrapper methodsFor:'view protocol mimicri'! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
174 |
|
321 | 175 |
containerMapped |
176 |
component containerMapped |
|
177 |
||
178 |
"Created: 19.7.1996 / 17:41:31 / cg" |
|
179 |
! |
|
180 |
||
181 |
containerUnmapped |
|
182 |
component containerUnmapped |
|
183 |
||
184 |
"Created: 19.7.1996 / 17:45:10 / cg" |
|
185 |
! |
|
186 |
||
187 |
destroy |
|
188 |
component destroy |
|
189 |
||
190 |
"Created: 19.7.1996 / 17:26:02 / cg" |
|
191 |
! |
|
192 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
193 |
realize |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
194 |
"my container realized itself. Forward this to my component" |
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 |
component realize. |
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 |
"Created: 4.6.1996 / 21:29:27 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
199 |
! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
200 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
201 |
removeSubView:aView |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
202 |
component := nil |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
203 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
204 |
"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
|
205 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
206 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
207 |
withAllSubViewsDo:aBlock |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
208 |
aBlock value:self. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
209 |
component notNil ifTrue:[ |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
210 |
component withAllSubViewsDo:aBlock |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
211 |
]. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
212 |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
213 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
214 |
|
365 | 215 |
!Wrapper class methodsFor:'documentation'! |
245 | 216 |
|
217 |
version |
|
1789 | 218 |
^ '$Header: /cvs/stx/stx/libview2/Wrapper.st,v 1.11 2003-08-18 12:12:34 cg Exp $' |
245 | 219 |
! ! |