author | ca |
Tue, 08 Feb 2000 11:31:31 +0100 | |
changeset 1686 | bafa16adbf14 |
parent 1664 | a8b97314f813 |
child 1702 | ff202e263b9d |
permissions | -rw-r--r-- |
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
1 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
3 |
All Rights Reserved |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
4 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
5 |
This software is furnished under a license and may be used |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
10 |
hereby transferred. |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
11 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
12 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
13 |
|
455 | 14 |
ScrollableView subclass:#SubCanvas |
1412 | 15 |
instanceVariableNames:'builder spec client clientHolder specHolder clientView |
1548
299e14135d2d
Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents:
1546
diff
changeset
|
16 |
clientViewIsScrolled lateBuild' |
455 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
19 |
category:'Views-Basic' |
|
20 |
! |
|
21 |
||
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
22 |
!SubCanvas class methodsFor:'documentation'! |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
23 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
24 |
copyright |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
25 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
26 |
COPYRIGHT (c) 1998 by eXept Software AG |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
27 |
All Rights Reserved |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
28 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
29 |
This software is furnished under a license and may be used |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
30 |
only in accordance with the terms of that license and with the |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
31 |
inclusion of the above copyright notice. This software may not |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
32 |
be provided or otherwise made available to, or used by, any |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
33 |
other person. No title to or ownership of the software is |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
34 |
hereby transferred. |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
35 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
36 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
37 |
! |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
38 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
39 |
documentation |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
40 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
41 |
a view for a subApplication. |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
42 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
43 |
[author:] |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
44 |
Claus Atzkern |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
45 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
46 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
47 |
! ! |
455 | 48 |
|
1414
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
49 |
!SubCanvas class methodsFor:'defaults'! |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
50 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
51 |
defaultHorizontalScrollable |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
52 |
^ false |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
53 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
54 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
55 |
! |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
56 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
57 |
defaultVerticalScrollable |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
58 |
^ false |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
59 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
60 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
61 |
! ! |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
62 |
|
455 | 63 |
!SubCanvas methodsFor:'accessing'! |
64 |
||
503 | 65 |
builder |
66 |
"return the value of the instance variable 'builder' (automatically generated)" |
|
455 | 67 |
|
503 | 68 |
^ builder! |
455 | 69 |
|
503 | 70 |
client |
71 |
"return the value of the instance variable 'client' (automatically generated)" |
|
455 | 72 |
|
503 | 73 |
^ client! |
455 | 74 |
|
503 | 75 |
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder |
455 | 76 |
"release existing components and generate new components from |
77 |
the given windowSpec, using the given builder." |
|
78 |
||
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
79 |
|myApp| |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
80 |
|
1686 | 81 |
(client notNil and:[client ~~ anApplication]) ifTrue:[ |
82 |
client releaseAsSubCanvas. |
|
83 |
client := nil. |
|
84 |
]. |
|
85 |
||
1546
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
86 |
(builder := aBuilder) isNil ifTrue:[ |
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
87 |
builder := anApplication perform:#builder |
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
88 |
ifNotUnderstood:[UIBuilder new] |
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
89 |
]. |
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
90 |
|
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
91 |
spec := aWindowSpecOrSpecSymbol. |
503 | 92 |
|
93 |
"/ check for master application |
|
94 |
(anApplication notNil and:[anApplication masterApplication isNil]) ifTrue:[ |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
95 |
myApp := self application. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
96 |
myApp ~~ anApplication ifTrue:[ |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
97 |
anApplication masterApplication:myApp |
503 | 98 |
] |
99 |
]. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
100 |
|
503 | 101 |
client := anApplication. |
102 |
self rebuild. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
103 |
^ builder |
503 | 104 |
! |
105 |
||
1412 | 106 |
makeClientViewScrollable:aBoolean |
107 |
|vs| |
|
108 |
||
109 |
aBoolean ~~ clientViewIsScrolled ifTrue:[ |
|
1662 | 110 |
clientView isNil ifTrue:[ |
111 |
clientView := View new. |
|
112 |
]. |
|
1412 | 113 |
aBoolean ifTrue:[ |
114 |
self scrolledView:(vs := ViewScroller new). |
|
115 |
vs scrolledView:clientView. |
|
116 |
] ifFalse:[ |
|
117 |
self scrolledView:clientView. |
|
118 |
]. |
|
119 |
clientViewIsScrolled := aBoolean. |
|
120 |
] |
|
121 |
||
1662 | 122 |
"Modified: / 30.1.2000 / 21:36:29 / cg" |
1412 | 123 |
! |
124 |
||
1450 | 125 |
setClient:anApplicationModel |
126 |
"set the client - do NOT rebuild" |
|
127 |
||
128 |
client := anApplicationModel |
|
129 |
! |
|
130 |
||
503 | 131 |
spec |
132 |
"return the value of the instance variable 'spec' (automatically generated)" |
|
133 |
||
134 |
^ spec! |
|
135 |
||
136 |
spec:something |
|
137 |
"set the value of the instance variable 'spec' (automatically generated)" |
|
138 |
||
139 |
spec := something. |
|
140 |
self rebuild. |
|
819 | 141 |
! |
142 |
||
143 |
widget |
|
144 |
"ST80 compatibility. |
|
145 |
I am my own widget" |
|
146 |
||
147 |
^ self |
|
148 |
||
149 |
"Created: / 10.3.1998 / 16:20:52 / stefan" |
|
503 | 150 |
! ! |
151 |
||
152 |
!SubCanvas methodsFor:'accessing channels'! |
|
153 |
||
154 |
clientHolder |
|
155 |
^ clientHolder |
|
156 |
! |
|
157 |
||
158 |
clientHolder:aValueHolder |
|
159 |
||
160 |
clientHolder notNil ifTrue:[ |
|
161 |
clientHolder removeDependent:self |
|
162 |
]. |
|
163 |
(clientHolder := aValueHolder) notNil ifTrue:[ |
|
164 |
clientHolder addDependent:self |
|
165 |
]. |
|
557 | 166 |
self updateFromChannels |
503 | 167 |
! |
168 |
||
169 |
specHolder |
|
170 |
^ specHolder |
|
171 |
! |
|
172 |
||
173 |
specHolder:aValueHolder |
|
174 |
||
175 |
specHolder notNil ifTrue:[ |
|
176 |
specHolder removeDependent:self |
|
177 |
]. |
|
178 |
(specHolder := aValueHolder) notNil ifTrue:[ |
|
179 |
specHolder addDependent:self |
|
180 |
]. |
|
557 | 181 |
self updateFromChannels |
503 | 182 |
! ! |
183 |
||
184 |
!SubCanvas methodsFor:'building'! |
|
185 |
||
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
186 |
XXrebuild |
503 | 187 |
"rebuild |
188 |
" |
|
1577 | 189 |
|v subSpec savedView builderClass boundsOrLayout| |
455 | 190 |
|
1548
299e14135d2d
Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents:
1546
diff
changeset
|
191 |
superView isNil ifTrue:[ |
299e14135d2d
Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents:
1546
diff
changeset
|
192 |
lateBuild := true. |
299e14135d2d
Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents:
1546
diff
changeset
|
193 |
^ self |
299e14135d2d
Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents:
1546
diff
changeset
|
194 |
]. |
299e14135d2d
Late building if subcanvas does not have a superView. (cg)
Stefan Vogel <sv@exept.de>
parents:
1546
diff
changeset
|
195 |
|
1412 | 196 |
clientView notNil ifTrue:[ |
197 |
clientView destroySubViews |
|
455 | 198 |
]. |
199 |
||
200 |
spec notNil ifTrue:[ |
|
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
201 |
(subSpec := spec) isSymbol ifTrue:[ |
554 | 202 |
client isNil ifTrue:[ |
1216
c9f8253a9e7c
give a warning with nil client
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
203 |
'SubCanvas [warning]: no client - cannot build spec' infoPrintCR. |
554 | 204 |
^ self |
553 | 205 |
]. |
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
206 |
(subSpec := client class interfaceSpecFor:spec) isNil ifTrue:[ |
1216
c9f8253a9e7c
give a warning with nil client
Claus Gittinger <cg@exept.de>
parents:
973
diff
changeset
|
207 |
"/ Transcript showCR:'SubCanvas: nil spec'. |
503 | 208 |
^ self |
209 |
] |
|
210 |
]. |
|
973 | 211 |
|
554 | 212 |
builder isNil ifTrue:[ |
1383 | 213 |
client isNil ifTrue:[ |
214 |
builderClass := UIBuilder |
|
215 |
] ifFalse:[ |
|
216 |
builderClass := client builderClass |
|
217 |
]. |
|
218 |
builder := builderClass new. |
|
554 | 219 |
]. |
973 | 220 |
|
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
221 |
"/ old: |
1412 | 222 |
"/ builder buildFromSpec:subSpec in:clientView. |
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
223 |
|
973 | 224 |
"/ new (let app know (somehow) that this is a build |
225 |
"/ for a subcanvas (i.e. it can redefine the buildSubCanvase-method |
|
226 |
"/: |
|
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
227 |
savedView := builder window. |
1412 | 228 |
builder window:clientView. |
1450 | 229 |
[ |
230 |
client buildSubCanvas:subSpec withBuilder:builder. |
|
231 |
] valueNowOrOnUnwindDo:[ |
|
232 |
builder window:savedView. |
|
233 |
]. |
|
1412 | 234 |
clientViewIsScrolled ifTrue:[ |
1577 | 235 |
boundsOrLayout := builder spec window layout. |
236 |
boundsOrLayout isNil ifTrue:[ |
|
237 |
boundsOrLayout := builder spec window bounds |
|
238 |
]. |
|
1412 | 239 |
clientView |
1577 | 240 |
extent:(boundsOrLayout rectangleRelativeTo:self bounds preferred:nil) extent. |
1412 | 241 |
]. |
242 |
||
503 | 243 |
self realized ifTrue:[ |
1412 | 244 |
clientView realizeAllSubViews |
503 | 245 |
] |
246 |
] |
|
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
247 |
|
973 | 248 |
"Modified: / 20.6.1998 / 14:29:00 / cg" |
503 | 249 |
! |
250 |
||
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
251 |
container:aView |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
252 |
super container:aView. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
253 |
lateBuild == true ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
254 |
lateBuild := false. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
255 |
self rebuild |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
256 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
257 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
258 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
259 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
260 |
rebuild |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
261 |
"rebuild |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
262 |
" |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
263 |
|v subSpec savedView builderClass| |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
264 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
265 |
superView isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
266 |
lateBuild := true. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
267 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
268 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
269 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
270 |
clientView notNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
271 |
clientView destroySubViews |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
272 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
273 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
274 |
spec notNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
275 |
(subSpec := spec) isSymbol ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
276 |
client isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
277 |
'SubCanvas [warning]: no client - cannot build spec' infoPrintCR. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
278 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
279 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
280 |
(subSpec := client class interfaceSpecFor:spec) isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
281 |
"/ Transcript showCR:'SubCanvas: nil spec'. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
282 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
283 |
] |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
284 |
]. |
1662 | 285 |
subSpec isArray ifTrue:[ |
286 |
subSpec := subSpec decodeAsLiteralArray |
|
287 |
]. |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
288 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
289 |
builder isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
290 |
client isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
291 |
builderClass := UIBuilder |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
292 |
] ifFalse:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
293 |
builderClass := client builderClass |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
294 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
295 |
builder := builderClass new. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
296 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
297 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
298 |
"/ old: |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
299 |
"/ builder buildFromSpec:subSpec in:clientView. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
300 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
301 |
"/ new (let app know (somehow) that this is a build |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
302 |
"/ for a subcanvas (i.e. it can redefine the buildSubCanvas-method): |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
303 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
304 |
savedView := builder window. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
305 |
builder window:clientView. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
306 |
[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
307 |
client buildSubCanvas:subSpec withBuilder:builder. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
308 |
] valueNowOrOnUnwindDo:[ |
1662 | 309 |
savedView notNil ifTrue:[ |
310 |
builder window:savedView. |
|
311 |
] |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
312 |
]. |
1664 | 313 |
clientViewIsScrolled ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
314 |
clientView extent:((subSpec window layout) ? (subSpec window bounds)) extent. |
1664 | 315 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
316 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
317 |
self realized ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
318 |
clientView realizeAllSubViews |
1662 | 319 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
320 |
] |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
321 |
|
1662 | 322 |
"Modified: / 30.1.2000 / 21:36:40 / cg" |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
323 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
324 |
|
503 | 325 |
releaseAllComponents |
1412 | 326 |
clientView destroySubViews. |
503 | 327 |
builder := nil. |
328 |
spec := nil. |
|
329 |
client := nil. |
|
1662 | 330 |
|
331 |
"Modified: / 31.1.2000 / 16:56:14 / cg" |
|
503 | 332 |
! ! |
333 |
||
334 |
!SubCanvas methodsFor:'change & update'! |
|
335 |
||
336 |
update:something with:aParameter from:changedObject |
|
337 |
"one of my models changed its value |
|
338 |
" |
|
557 | 339 |
(changedObject == clientHolder or:[changedObject == specHolder]) ifTrue:[ |
340 |
self updateFromChannels |
|
341 |
] ifFalse:[ |
|
342 |
super update:something with:aParameter from:changedObject. |
|
343 |
] |
|
344 |
||
345 |
! |
|
346 |
||
347 |
updateFromChannels |
|
348 |
"update canvas from channel |
|
349 |
" |
|
350 |
|client spec| |
|
351 |
||
352 |
clientHolder isNil ifTrue:[ |
|
353 |
client := self application |
|
354 |
] ifFalse:[ |
|
355 |
client := clientHolder value |
|
554 | 356 |
]. |
503 | 357 |
|
557 | 358 |
specHolder isNil ifTrue:[ |
359 |
spec := #windowSpec |
|
360 |
] ifFalse:[ |
|
361 |
spec := specHolder value |
|
362 |
]. |
|
363 |
(client notNil and:[spec notNil]) ifTrue:[ |
|
364 |
self client:client spec:spec |
|
365 |
] ifFalse:[ |
|
1467 | 366 |
"/ spec notNil ifTrue:[ |
367 |
"/ self halt:'spec but no app'. |
|
368 |
"/ ]. |
|
557 | 369 |
self client:nil |
370 |
] |
|
503 | 371 |
|
1467 | 372 |
"Modified: / 5.8.1999 / 13:35:26 / cg" |
503 | 373 |
! ! |
374 |
||
375 |
!SubCanvas methodsFor:'initialization'! |
|
376 |
||
609 | 377 |
destroy |
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
378 |
client notNil ifTrue:[ |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
379 |
client releaseAsSubCanvas. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
380 |
]. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
381 |
|
609 | 382 |
clientHolder notNil ifTrue:[ |
383 |
clientHolder removeDependent:self. |
|
384 |
clientHolder := nil. |
|
385 |
]. |
|
386 |
specHolder notNil ifTrue:[ |
|
387 |
specHolder removeDependent:self. |
|
388 |
specHolder := nil. |
|
389 |
]. |
|
390 |
super destroy. |
|
391 |
! |
|
392 |
||
503 | 393 |
initialize |
1412 | 394 |
|
503 | 395 |
super initialize. |
1412 | 396 |
self scrolledView:(clientView := View new). |
397 |
clientViewIsScrolled := false. |
|
398 |
||
503 | 399 |
spec := #windowSpec. |
1662 | 400 |
|
401 |
"Modified: / 31.1.2000 / 16:56:31 / cg" |
|
503 | 402 |
! ! |
403 |
||
404 |
!SubCanvas methodsFor:'queries'! |
|
405 |
||
406 |
application |
|
407 |
"return the application, under which this view was opened, |
|
408 |
" |
|
409 |
||
410 |
client notNil ifTrue:[ |
|
411 |
^ client |
|
455 | 412 |
]. |
503 | 413 |
^ super application |
414 |
||
455 | 415 |
! ! |
416 |
||
417 |
!SubCanvas class methodsFor:'documentation'! |
|
418 |
||
419 |
version |
|
1686 | 420 |
^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.23 2000-02-08 10:31:31 ca Exp $' |
455 | 421 |
! ! |