author | Jan Vrany <jan.vrany@labware.com> |
Tue, 04 Apr 2023 14:22:18 +0200 | |
branch | jv |
changeset 4473 | 3675eb1de41b |
parent 3855 | 1db7742d33ad |
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 |
||
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2662
diff
changeset
|
14 |
"{ NameSpace: Smalltalk }" |
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2662
diff
changeset
|
15 |
|
279 | 16 |
VisualPart subclass:#Wrapper |
245 | 17 |
instanceVariableNames:'component' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
1789 | 20 |
category:'Compatibility-ST80-Graphics-Display Objects' |
245 | 21 |
! |
22 |
||
365 | 23 |
!Wrapper 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 |
" |
|
43 |
abstract superclass for all kinds of wrapping components |
|
44 |
||
365 | 45 |
This class and its subclasses (currently) exist mostly for |
46 |
ST-80 compatibility - to provide a home for ported PD classes, |
|
47 |
which depend on the VisualPart hierarchy. |
|
48 |
||
49 |
Notice: |
|
50 |
this class was implemented using protocol information |
|
51 |
from alpha testers, from reading PD programs and |
|
52 |
from the Hopkins/Horan book. |
|
53 |
- it may not be complete or compatible to the corresponding ST-80 class. |
|
54 |
If you encounter any incompatibilities, please forward a note |
|
55 |
describing the incompatibility verbal (i.e. no code) to the ST/X team. |
|
56 |
This is still being constructed - not yet finished. |
|
57 |
||
245 | 58 |
[author:] |
59 |
Claus Gittinger |
|
60 |
" |
|
61 |
||
62 |
! ! |
|
63 |
||
365 | 64 |
!Wrapper class methodsFor:'instance creation'! |
245 | 65 |
|
66 |
on:aComponent |
|
67 |
^ self new component:aComponent |
|
68 |
||
69 |
"Created: 8.5.1996 / 23:20:46 / cg" |
|
70 |
! ! |
|
71 |
||
72 |
!Wrapper methodsFor:'accessing'! |
|
73 |
||
74 |
component |
|
247 | 75 |
"return the wrappers component" |
76 |
||
245 | 77 |
^ component |
78 |
||
79 |
"Created: 8.5.1996 / 23:17:30 / cg" |
|
247 | 80 |
"Modified: 9.5.1996 / 00:19:58 / cg" |
245 | 81 |
! |
82 |
||
83 |
component:someComponent |
|
247 | 84 |
"set the wrappers component" |
85 |
||
279 | 86 |
component := someComponent. |
87 |
component notNil ifTrue:[ |
|
283 | 88 |
"/ temporary kludge - images are (currently) not |
89 |
"/ inheriting from visualComponent ... |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
90 |
"/ (someComponent respondsTo:#container:) ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
91 |
someComponent container:self. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
92 |
"/ ]. |
2662 | 93 |
frame isNil ifTrue:[ |
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
94 |
component bounds notNil ifTrue:[ |
2662 | 95 |
frame := component bounds |
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
96 |
] |
283 | 97 |
] |
279 | 98 |
] |
245 | 99 |
|
100 |
"Created: 8.5.1996 / 23:17:46 / cg" |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
101 |
"Modified: 5.6.1996 / 02:31:40 / cg" |
245 | 102 |
! ! |
103 |
||
104 |
!Wrapper methodsFor:'accessing - bounds'! |
|
105 |
||
106 |
bounds:newBounds |
|
246 | 107 |
"set my bounds - forwarded to the wrapped object" |
108 |
||
2662 | 109 |
newBounds ~= frame ifTrue:[ |
110 |
frame := newBounds. |
|
321 | 111 |
component bounds:newBounds |
112 |
]. |
|
245 | 113 |
|
114 |
"Created: 8.5.1996 / 23:18:12 / cg" |
|
321 | 115 |
"Modified: 19.7.1996 / 17:47:34 / cg" |
245 | 116 |
! |
117 |
||
279 | 118 |
newBounds:newBounds containingBounds:containingBounds |
119 |
self bounds:newBounds |
|
120 |
||
121 |
"Created: 26.5.1996 / 16:50:49 / cg" |
|
122 |
! |
|
123 |
||
245 | 124 |
preferredBounds |
246 | 125 |
"return my preferredBounds as the components preferredBounds" |
126 |
||
245 | 127 |
^ component preferredBounds |
128 |
||
129 |
"Created: 8.5.1996 / 23:18:53 / cg" |
|
246 | 130 |
"Modified: 9.5.1996 / 00:10:32 / cg" |
245 | 131 |
! ! |
132 |
||
133 |
!Wrapper methodsFor:'displaying'! |
|
134 |
||
2209 | 135 |
displayOn:aGCOrStream |
246 | 136 |
"display myself - forwarded to the wrapped object" |
137 |
||
2209 | 138 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
139 |
"/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
|
140 |
(aGCOrStream isStream or:[aGCOrStream == Transcript]) ifTrue:[ |
|
141 |
self printOn:aGCOrStream. |
|
142 |
^ self |
|
143 |
]. |
|
144 |
component displayOn:aGCOrStream |
|
245 | 145 |
|
2209 | 146 |
"Created: / 08-05-1996 / 23:19:24 / cg" |
147 |
"Modified: / 11-09-2006 / 15:01:24 / User" |
|
245 | 148 |
! ! |
149 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
150 |
!Wrapper methodsFor:'queries'! |
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 |
hasBorder |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
153 |
^ false |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
154 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
155 |
"Created: 26.5.1996 / 16:47:37 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
156 |
! |
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 |
isWrapper |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
159 |
^ true |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
160 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
161 |
"Created: 5.6.1996 / 01:04:30 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
162 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
163 |
|
279 | 164 |
!Wrapper methodsFor:'testing'! |
165 |
||
166 |
containsPoint:aPoint |
|
167 |
^ component containsPoint:aPoint |
|
168 |
||
169 |
"Created: 26.5.1996 / 16:48:00 / cg" |
|
170 |
! |
|
171 |
||
172 |
intersects:aRectangle |
|
173 |
^ component intersects:aRectangle |
|
174 |
||
175 |
"Created: 26.5.1996 / 16:48:52 / cg" |
|
176 |
! ! |
|
177 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
178 |
!Wrapper methodsFor:'view protocol mimicri'! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
179 |
|
321 | 180 |
containerMapped |
181 |
component containerMapped |
|
182 |
||
183 |
"Created: 19.7.1996 / 17:41:31 / cg" |
|
184 |
! |
|
185 |
||
186 |
containerUnmapped |
|
187 |
component containerUnmapped |
|
188 |
||
189 |
"Created: 19.7.1996 / 17:45:10 / cg" |
|
190 |
! |
|
191 |
||
192 |
destroy |
|
2662 | 193 |
self destroyComponent. |
194 |
super destroy. |
|
321 | 195 |
|
196 |
"Created: 19.7.1996 / 17:26:02 / cg" |
|
197 |
! |
|
198 |
||
2662 | 199 |
destroyComponent |
200 |
component destroy |
|
201 |
! |
|
202 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
203 |
realize |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
204 |
"my container realized itself. Forward this to my component" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
205 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
206 |
component realize. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
207 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
208 |
"Created: 4.6.1996 / 21:29:27 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
209 |
! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
210 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
211 |
removeSubView:aView |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
212 |
component := nil |
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 |
"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
|
215 |
! |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
216 |
|
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
217 |
withAllSubViewsDo:aBlock |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
218 |
aBlock value:self. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
219 |
component notNil ifTrue:[ |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
220 |
component withAllSubViewsDo:aBlock |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
221 |
]. |
39e5e28042da
protocol fixes to make examples work again
Claus Gittinger <cg@exept.de>
parents:
365
diff
changeset
|
222 |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
223 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
224 |
|
365 | 225 |
!Wrapper class methodsFor:'documentation'! |
245 | 226 |
|
227 |
version |
|
2662 | 228 |
^ '$Header: /cvs/stx/stx/libview2/Wrapper.st,v 1.13 2009-05-08 11:54:52 cg Exp $' |
245 | 229 |
! ! |
3855
1db7742d33ad
Win32: Build libjpeg in its own directory, out-of-source-tree.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2662
diff
changeset
|
230 |