author | Claus Gittinger <cg@exept.de> |
Sat, 26 Oct 1996 19:17:33 +0200 | |
changeset 346 | 1612c23d9c5d |
parent 323 | ee2f4da361a6 |
child 365 | 47e0d48fd769 |
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 |
||
321 | 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 |
||
44 |
[author:] |
|
45 |
Claus Gittinger |
|
46 |
" |
|
47 |
||
48 |
! ! |
|
49 |
||
321 | 50 |
!Wrapper class methodsFor:'instance creation'! |
245 | 51 |
|
52 |
on:aComponent |
|
53 |
^ self new component:aComponent |
|
54 |
||
55 |
"Created: 8.5.1996 / 23:20:46 / cg" |
|
56 |
! ! |
|
57 |
||
58 |
!Wrapper methodsFor:'accessing'! |
|
59 |
||
60 |
component |
|
247 | 61 |
"return the wrappers component" |
62 |
||
245 | 63 |
^ component |
64 |
||
65 |
"Created: 8.5.1996 / 23:17:30 / cg" |
|
247 | 66 |
"Modified: 9.5.1996 / 00:19:58 / cg" |
245 | 67 |
! |
68 |
||
69 |
component:someComponent |
|
247 | 70 |
"set the wrappers component" |
71 |
||
279 | 72 |
component := someComponent. |
73 |
component notNil ifTrue:[ |
|
283 | 74 |
"/ temporary kludge - images are (currently) not |
75 |
"/ inheriting from visualComponent ... |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
76 |
"/ (someComponent respondsTo:#container:) ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
77 |
someComponent container:self. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
78 |
"/ ]. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
79 |
bounds isNil ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
80 |
component bounds notNil ifTrue:[ |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
81 |
bounds := component bounds |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
82 |
] |
283 | 83 |
] |
279 | 84 |
] |
245 | 85 |
|
86 |
"Created: 8.5.1996 / 23:17:46 / cg" |
|
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
87 |
"Modified: 5.6.1996 / 02:31:40 / cg" |
245 | 88 |
! ! |
89 |
||
90 |
!Wrapper methodsFor:'accessing - bounds'! |
|
91 |
||
92 |
bounds:newBounds |
|
246 | 93 |
"set my bounds - forwarded to the wrapped object" |
94 |
||
321 | 95 |
newBounds ~= bounds ifTrue:[ |
96 |
bounds := newBounds. |
|
97 |
component bounds:newBounds |
|
98 |
]. |
|
245 | 99 |
|
100 |
"Created: 8.5.1996 / 23:18:12 / cg" |
|
321 | 101 |
"Modified: 19.7.1996 / 17:47:34 / cg" |
245 | 102 |
! |
103 |
||
279 | 104 |
newBounds:newBounds containingBounds:containingBounds |
105 |
self bounds:newBounds |
|
106 |
||
107 |
"Created: 26.5.1996 / 16:50:49 / cg" |
|
108 |
! |
|
109 |
||
245 | 110 |
preferredBounds |
246 | 111 |
"return my preferredBounds as the components preferredBounds" |
112 |
||
245 | 113 |
^ component preferredBounds |
114 |
||
115 |
"Created: 8.5.1996 / 23:18:53 / cg" |
|
246 | 116 |
"Modified: 9.5.1996 / 00:10:32 / cg" |
245 | 117 |
! ! |
118 |
||
119 |
!Wrapper methodsFor:'displaying'! |
|
120 |
||
121 |
displayOn:aGC |
|
246 | 122 |
"display myself - forwarded to the wrapped object" |
123 |
||
245 | 124 |
component displayOn:aGC |
125 |
||
126 |
"Created: 8.5.1996 / 23:19:24 / cg" |
|
246 | 127 |
"Modified: 9.5.1996 / 00:10:59 / cg" |
245 | 128 |
! ! |
129 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
130 |
!Wrapper methodsFor:'queries'! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
131 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
132 |
hasBorder |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
133 |
^ false |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
134 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
135 |
"Created: 26.5.1996 / 16:47:37 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
136 |
! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
137 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
138 |
isWrapper |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
139 |
^ true |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
140 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
141 |
"Created: 5.6.1996 / 01:04:30 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
142 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
143 |
|
279 | 144 |
!Wrapper methodsFor:'testing'! |
145 |
||
146 |
containsPoint:aPoint |
|
147 |
^ component containsPoint:aPoint |
|
148 |
||
149 |
"Created: 26.5.1996 / 16:48:00 / cg" |
|
150 |
! |
|
151 |
||
152 |
intersects:aRectangle |
|
153 |
^ component intersects:aRectangle |
|
154 |
||
155 |
"Created: 26.5.1996 / 16:48:52 / cg" |
|
156 |
! ! |
|
157 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
158 |
!Wrapper methodsFor:'view protocol mimicri'! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
159 |
|
321 | 160 |
containerMapped |
161 |
component containerMapped |
|
162 |
||
163 |
"Created: 19.7.1996 / 17:41:31 / cg" |
|
164 |
! |
|
165 |
||
166 |
containerUnmapped |
|
167 |
component containerUnmapped |
|
168 |
||
169 |
"Created: 19.7.1996 / 17:45:10 / cg" |
|
170 |
! |
|
171 |
||
172 |
destroy |
|
173 |
component destroy |
|
174 |
||
175 |
"Created: 19.7.1996 / 17:26:02 / cg" |
|
176 |
! |
|
177 |
||
292
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
178 |
realize |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
179 |
"my container realized itself. Forward this to my component" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
180 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
181 |
component realize. |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
182 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
183 |
"Created: 4.6.1996 / 21:29:27 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
184 |
! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
185 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
186 |
removeSubView:aView |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
187 |
component := nil |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
188 |
|
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
189 |
"Created: 4.6.1996 / 21:39:50 / cg" |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
190 |
! ! |
60fbf13dfc8c
prepare for view-component integration
Claus Gittinger <cg@exept.de>
parents:
283
diff
changeset
|
191 |
|
321 | 192 |
!Wrapper class methodsFor:'documentation'! |
245 | 193 |
|
194 |
version |
|
323 | 195 |
^ '$Header: /cvs/stx/stx/libview2/Wrapper.st,v 1.8 1996-07-22 09:02:32 cg Exp $' |
245 | 196 |
! ! |