author | Claus Gittinger <cg@exept.de> |
Tue, 08 Apr 2003 16:41:06 +0200 | |
changeset 2478 | 654d6ffde1f8 |
parent 2427 | 43e68ab02e63 |
child 2735 | 6999d16ef613 |
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 |
|
1818 | 14 |
"{ Package: 'stx:libwidg2' }" |
15 |
||
455 | 16 |
ScrollableView subclass:#SubCanvas |
1912 | 17 |
instanceVariableNames:'builder spec client clientHolder specHolder clientView |
18 |
clientViewIsScrolled lateBuild useApplicationSubView |
|
19 |
keepClientView useOwnBuilder' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Views-Basic' |
|
455 | 23 |
! |
24 |
||
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
25 |
!SubCanvas class methodsFor:'documentation'! |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
26 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
27 |
copyright |
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 |
COPYRIGHT (c) 1998 by eXept Software AG |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
30 |
All Rights Reserved |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
31 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
hereby transferred. |
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 |
|
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 |
|
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
42 |
documentation |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
43 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
44 |
a view for a subApplication. |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
45 |
|
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
46 |
Made to be VW compatible as much as possible (try opening a RefactoringBrowser ...). |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
47 |
However, the default setup is not very useful, to embedd arbitrary applications |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
48 |
which are meant to be separate stand-alone applications. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
49 |
Play with the settings: |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
50 |
keepClientView (default: true) |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
51 |
useApplicationSubView (default: false) |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
52 |
useOwnBuilder (default: false) |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
53 |
|
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
54 |
[author:] |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
55 |
Claus Atzkern |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
56 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
57 |
! ! |
455 | 58 |
|
1414
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
59 |
!SubCanvas class methodsFor:'defaults'! |
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 |
defaultHorizontalScrollable |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
62 |
^ false |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
63 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
64 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
65 |
! |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
66 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
67 |
defaultVerticalScrollable |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
68 |
^ false |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
69 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
70 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
71 |
! ! |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
72 |
|
455 | 73 |
!SubCanvas methodsFor:'accessing'! |
74 |
||
503 | 75 |
builder |
76 |
"return the value of the instance variable 'builder' (automatically generated)" |
|
455 | 77 |
|
1893 | 78 |
^ builder |
79 |
! |
|
455 | 80 |
|
503 | 81 |
client |
82 |
"return the value of the instance variable 'client' (automatically generated)" |
|
455 | 83 |
|
1893 | 84 |
^ client |
85 |
! |
|
455 | 86 |
|
503 | 87 |
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder |
455 | 88 |
"release existing components and generate new components from |
89 |
the given windowSpec, using the given builder." |
|
90 |
||
2427
43e68ab02e63
oops - undo last change (postOpen when client changes)
Claus Gittinger <cg@exept.de>
parents:
2426
diff
changeset
|
91 |
|myApp| |
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
92 |
|
1686 | 93 |
(client notNil and:[client ~~ anApplication]) ifTrue:[ |
94 |
client releaseAsSubCanvas. |
|
95 |
client := nil. |
|
96 |
]. |
|
97 |
||
1546
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
98 |
(builder := aBuilder) isNil ifTrue:[ |
1846 | 99 |
builder := anApplication perform:#builder ifNotUnderstood:[UIBuilder new] |
1546
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
100 |
]. |
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
101 |
|
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
102 |
spec := aWindowSpecOrSpecSymbol. |
503 | 103 |
|
104 |
"/ check for master application |
|
105 |
(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
|
106 |
myApp := self application. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
107 |
myApp ~~ anApplication ifTrue:[ |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
108 |
anApplication masterApplication:myApp |
503 | 109 |
] |
110 |
]. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
111 |
|
503 | 112 |
client := anApplication. |
113 |
self rebuild. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
114 |
^ builder |
503 | 115 |
! |
116 |
||
1412 | 117 |
makeClientViewScrollable:aBoolean |
118 |
|vs| |
|
119 |
||
120 |
aBoolean ~~ clientViewIsScrolled ifTrue:[ |
|
1662 | 121 |
clientView isNil ifTrue:[ |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
122 |
useApplicationSubView ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
123 |
clientView := ApplicationSubView new. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
124 |
] ifFalse:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
125 |
clientView := View new. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
126 |
] |
1662 | 127 |
]. |
1412 | 128 |
aBoolean ifTrue:[ |
129 |
self scrolledView:(vs := ViewScroller new). |
|
130 |
vs scrolledView:clientView. |
|
131 |
] ifFalse:[ |
|
132 |
self scrolledView:clientView. |
|
133 |
]. |
|
134 |
clientViewIsScrolled := aBoolean. |
|
135 |
] |
|
136 |
||
1662 | 137 |
"Modified: / 30.1.2000 / 21:36:29 / cg" |
1412 | 138 |
! |
139 |
||
1450 | 140 |
setClient:anApplicationModel |
141 |
"set the client - do NOT rebuild" |
|
142 |
||
143 |
client := anApplicationModel |
|
144 |
! |
|
145 |
||
503 | 146 |
spec |
147 |
"return the value of the instance variable 'spec' (automatically generated)" |
|
148 |
||
1893 | 149 |
^ spec |
150 |
! |
|
503 | 151 |
|
152 |
spec:something |
|
153 |
"set the value of the instance variable 'spec' (automatically generated)" |
|
154 |
||
155 |
spec := something. |
|
156 |
self rebuild. |
|
819 | 157 |
! |
158 |
||
159 |
widget |
|
160 |
"ST80 compatibility. |
|
161 |
I am my own widget" |
|
162 |
||
163 |
^ self |
|
164 |
||
165 |
"Created: / 10.3.1998 / 16:20:52 / stefan" |
|
503 | 166 |
! ! |
167 |
||
2404 | 168 |
!SubCanvas methodsFor:'accessing-canvasView handling'! |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
169 |
|
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
170 |
keepClientView:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
171 |
keepClientView := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
172 |
! |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
173 |
|
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
174 |
useApplicationSubView:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
175 |
useApplicationSubView := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
176 |
! |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
177 |
|
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
178 |
useOwnBuilder:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
179 |
useOwnBuilder := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
180 |
! ! |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
181 |
|
1818 | 182 |
!SubCanvas methodsFor:'accessing-channels'! |
503 | 183 |
|
184 |
clientHolder |
|
185 |
^ clientHolder |
|
186 |
! |
|
187 |
||
188 |
clientHolder:aValueHolder |
|
189 |
||
190 |
clientHolder notNil ifTrue:[ |
|
191 |
clientHolder removeDependent:self |
|
192 |
]. |
|
193 |
(clientHolder := aValueHolder) notNil ifTrue:[ |
|
194 |
clientHolder addDependent:self |
|
195 |
]. |
|
557 | 196 |
self updateFromChannels |
503 | 197 |
! |
198 |
||
1893 | 199 |
clientView:aView |
200 |
||
201 |
clientView notNil ifTrue:[ |
|
202 |
clientView destroy |
|
203 |
]. |
|
204 |
clientView := aView |
|
205 |
! |
|
206 |
||
503 | 207 |
specHolder |
208 |
^ specHolder |
|
209 |
! |
|
210 |
||
211 |
specHolder:aValueHolder |
|
1905 | 212 |
|oldSpec| |
503 | 213 |
|
214 |
specHolder notNil ifTrue:[ |
|
1905 | 215 |
oldSpec := specHolder value. |
503 | 216 |
specHolder removeDependent:self |
217 |
]. |
|
218 |
(specHolder := aValueHolder) notNil ifTrue:[ |
|
219 |
specHolder addDependent:self |
|
220 |
]. |
|
1905 | 221 |
oldSpec ~~ specHolder value ifTrue:[ |
222 |
self updateFromChannels |
|
223 |
] |
|
503 | 224 |
! ! |
225 |
||
226 |
!SubCanvas methodsFor:'building'! |
|
227 |
||
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
228 |
XXrebuild |
503 | 229 |
"rebuild |
230 |
" |
|
2083
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
231 |
"/ | subSpec savedView builderClass boundsOrLayout| |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
232 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
233 |
"/ superView isNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
234 |
"/ lateBuild := true. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
235 |
"/ ^ self |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
236 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
237 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
238 |
"/ clientView notNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
239 |
"/ clientView destroySubViews |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
240 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
241 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
242 |
"/ spec notNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
243 |
"/ (subSpec := spec) isSymbol ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
244 |
"/ client isNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
245 |
"/ 'SubCanvas [warning]: no client - cannot build spec' infoPrintCR. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
246 |
"/ ^ self |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
247 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
248 |
"/ (subSpec := client class interfaceSpecFor:spec) isNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
249 |
"/ "/ Transcript showCR:'SubCanvas: nil spec'. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
250 |
"/ ^ self |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
251 |
"/ ] |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
252 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
253 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
254 |
"/ builder isNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
255 |
"/ client isNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
256 |
"/ builderClass := UIBuilder |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
257 |
"/ ] ifFalse:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
258 |
"/ builderClass := client builderClass |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
259 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
260 |
"/ builder := builderClass new. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
261 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
262 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
263 |
"/ "/ old: |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
264 |
"/"/ builder buildFromSpec:subSpec in:clientView. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
265 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
266 |
"/ "/ new (let app know (somehow) that this is a build |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
267 |
"/ "/ for a subcanvas (i.e. it can redefine the buildSubCanvase-method |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
268 |
"/ "/: |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
269 |
"/ savedView := builder window. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
270 |
"/ builder window:clientView. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
271 |
"/ [ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
272 |
"/ client buildSubCanvas:subSpec withBuilder:builder. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
273 |
"/ ] ensure:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
274 |
"/ builder window:savedView. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
275 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
276 |
"/ clientViewIsScrolled ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
277 |
"/ boundsOrLayout := builder spec window layout. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
278 |
"/ boundsOrLayout isNil ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
279 |
"/ boundsOrLayout := builder spec window bounds |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
280 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
281 |
"/ clientView |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
282 |
"/ extent:(boundsOrLayout rectangleRelativeTo:self bounds preferred:nil) extent. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
283 |
"/ ]. |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
284 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
285 |
"/ self realized ifTrue:[ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
286 |
"/ clientView realizeAllSubViews |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
287 |
"/ ] |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
288 |
"/ ] |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
289 |
"/ |
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
290 |
"/ "Modified: / 20.6.1998 / 14:29:00 / cg" |
503 | 291 |
! |
292 |
||
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
293 |
container:aView |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
294 |
super container:aView. |
1846 | 295 |
|
296 |
"/ my builder can only build the components, when I have a container |
|
297 |
"/ lateBuild is set, if the spec was set some time ago, when I had no container |
|
298 |
"/ Now, we know where to build the GUI ... |
|
299 |
"/ ... and must hurry up to create the widgets. |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
300 |
lateBuild == true ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
301 |
lateBuild := false. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
302 |
self rebuild |
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 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
305 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
306 |
rebuild |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
307 |
"rebuild |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
308 |
" |
2083
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
309 |
| subSpec savedView savedBuilder builderClass| |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
310 |
|
1856 | 311 |
"/ if the superView is not yet created, |
312 |
"/ we MUST delay building... (sigh) |
|
1905 | 313 |
superView isNil ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
314 |
lateBuild := true. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
315 |
^ self |
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 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
318 |
clientView notNil ifTrue:[ |
1893 | 319 |
clientView destroySubViews. |
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 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
322 |
spec notNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
323 |
(subSpec := spec) isSymbol ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
324 |
client isNil ifTrue:[ |
2394
c3984ea38fb5
only output warning 'no client...' if clientHolder is nil.
Claus Gittinger <cg@exept.de>
parents:
2156
diff
changeset
|
325 |
clientHolder isNil ifTrue:[ |
2395 | 326 |
('SubCanvas [warning]: no client - cannot build spec: ' , spec) infoPrintCR. |
2394
c3984ea38fb5
only output warning 'no client...' if clientHolder is nil.
Claus Gittinger <cg@exept.de>
parents:
2156
diff
changeset
|
327 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
328 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
329 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
330 |
(subSpec := client class interfaceSpecFor:spec) isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
331 |
"/ Transcript showCR:'SubCanvas: nil spec'. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
332 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
333 |
] |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
334 |
]. |
1662 | 335 |
subSpec isArray ifTrue:[ |
336 |
subSpec := subSpec decodeAsLiteralArray |
|
337 |
]. |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
338 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
339 |
builder isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
340 |
client isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
341 |
builderClass := UIBuilder |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
342 |
] ifFalse:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
343 |
builderClass := client builderClass |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
344 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
345 |
builder := builderClass new. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
346 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
347 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
348 |
"/ old: |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
349 |
"/ builder buildFromSpec:subSpec in:clientView. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
350 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
351 |
"/ 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
|
352 |
"/ 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
|
353 |
|
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
354 |
keepClientView ifFalse:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
355 |
(clientView notNil and:[clientView application ~~ client]) ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
356 |
clientView destroy. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
357 |
clientView := nil. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
358 |
]. |
1893 | 359 |
]. |
360 |
||
361 |
clientView isNil ifTrue:[ |
|
1927 | 362 |
"/ create a new view |
1925
6026af8498a5
if keepClientView is set, care for a view being already
Claus Gittinger <cg@exept.de>
parents:
1914
diff
changeset
|
363 |
|
1927 | 364 |
useApplicationSubView ifTrue:[ |
365 |
clientView := ApplicationSubView new. |
|
366 |
clientView application:client. |
|
367 |
] ifFalse:[ |
|
368 |
clientView := View new. |
|
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
369 |
] |
1893 | 370 |
]. |
371 |
||
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
372 |
savedView := builder window. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
373 |
builder window:clientView. |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
374 |
useOwnBuilder ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
375 |
savedBuilder := client builder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
376 |
client builder:builder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
377 |
]. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
378 |
|
1912 | 379 |
[ |savedSuperView| |
380 |
||
381 |
"/ kludge: need superView to be set correctly, in order for |
|
382 |
"/ postBuildAsSubCanvas to be invoked (instead of postBuild) |
|
383 |
"/ however, must unset the superView for code below ... |
|
384 |
savedSuperView := clientView superView. |
|
1914 | 385 |
savedSuperView isNil ifTrue:[clientView setContainer:self]. |
1912 | 386 |
client buildSubCanvas:subSpec withBuilder:builder. |
2091 | 387 |
savedSuperView isNil ifTrue:[clientView setContainer:nil. self removeSubView:clientView. ]. |
1905 | 388 |
|
389 |
keepClientView ifFalse:[ |
|
1908 | 390 |
(scrolledView notNil and:[clientView isComponentOf:scrolledView]) ifTrue:[ |
1906 | 391 |
self error:'this should not happen' |
1905 | 392 |
] ifFalse:[ |
393 |
self scrolledView:clientView. |
|
394 |
] |
|
1907 | 395 |
] ifTrue:[ |
1908 | 396 |
(clientView isComponentOf:self) ifFalse:[ |
1907 | 397 |
self scrolledView:clientView. |
398 |
] |
|
1905 | 399 |
] |
2083
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
400 |
] ensure:[ |
1662 | 401 |
savedView notNil ifTrue:[ |
402 |
builder window:savedView. |
|
1893 | 403 |
]. |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
404 |
useOwnBuilder ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
405 |
savedBuilder notNil ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
406 |
client builder:savedBuilder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
407 |
] |
1662 | 408 |
] |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
409 |
]. |
1893 | 410 |
|
1664 | 411 |
clientViewIsScrolled ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
412 |
clientView extent:((subSpec window layout) ? (subSpec window bounds)) extent. |
1664 | 413 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
414 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
415 |
self realized ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
416 |
clientView realizeAllSubViews |
1662 | 417 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
418 |
] |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
419 |
|
1662 | 420 |
"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
|
421 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
422 |
|
503 | 423 |
releaseAllComponents |
1412 | 424 |
clientView destroySubViews. |
503 | 425 |
builder := nil. |
426 |
spec := nil. |
|
427 |
client := nil. |
|
1662 | 428 |
|
429 |
"Modified: / 31.1.2000 / 16:56:14 / cg" |
|
503 | 430 |
! ! |
431 |
||
432 |
!SubCanvas methodsFor:'change & update'! |
|
433 |
||
434 |
update:something with:aParameter from:changedObject |
|
435 |
"one of my models changed its value |
|
436 |
" |
|
557 | 437 |
(changedObject == clientHolder or:[changedObject == specHolder]) ifTrue:[ |
2478 | 438 |
self updateFromChannels. |
439 |
^ self |
|
440 |
]. |
|
441 |
super update:something with:aParameter from:changedObject. |
|
557 | 442 |
! |
443 |
||
444 |
updateFromChannels |
|
445 |
"update canvas from channel |
|
446 |
" |
|
1911 | 447 |
|client spec bldr| |
557 | 448 |
|
449 |
clientHolder isNil ifTrue:[ |
|
1911 | 450 |
client := self application. |
451 |
bldr := UIBuilder new. |
|
557 | 452 |
] ifFalse:[ |
453 |
client := clientHolder value |
|
554 | 454 |
]. |
503 | 455 |
|
557 | 456 |
specHolder isNil ifTrue:[ |
457 |
spec := #windowSpec |
|
458 |
] ifFalse:[ |
|
459 |
spec := specHolder value |
|
460 |
]. |
|
461 |
(client notNil and:[spec notNil]) ifTrue:[ |
|
462 |
] ifFalse:[ |
|
1467 | 463 |
"/ spec notNil ifTrue:[ |
464 |
"/ self halt:'spec but no app'. |
|
465 |
"/ ]. |
|
1894 | 466 |
client := nil. |
467 |
spec := #windowSpec. "/ is that true ? |
|
468 |
]. |
|
1911 | 469 |
self client:client spec:spec builder:bldr |
503 | 470 |
|
1467 | 471 |
"Modified: / 5.8.1999 / 13:35:26 / cg" |
503 | 472 |
! ! |
473 |
||
474 |
!SubCanvas methodsFor:'initialization'! |
|
475 |
||
2156 | 476 |
initialize |
477 |
||
478 |
super initialize. |
|
479 |
"/ self scrolledView:(clientView := ApplicationSubView new). |
|
480 |
clientViewIsScrolled := false. |
|
481 |
||
482 |
"/ these defaults make subCanvas compatible with VW; |
|
483 |
"/ however, they make our life difficult sometimes. |
|
484 |
keepClientView := true. |
|
485 |
useApplicationSubView := true "false". |
|
486 |
useOwnBuilder := false. |
|
487 |
||
488 |
spec := #windowSpec. |
|
489 |
||
490 |
"Modified: / 31.1.2000 / 16:56:31 / cg" |
|
491 |
! |
|
492 |
||
493 |
release |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
494 |
client notNil ifTrue:[ |
1702 | 495 |
client == self application ifTrue:[ |
496 |
client releaseAsSubCanvas. |
|
497 |
] ifFalse:[ |
|
498 |
client release |
|
499 |
]. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
500 |
]. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
501 |
|
609 | 502 |
clientHolder notNil ifTrue:[ |
503 |
clientHolder removeDependent:self. |
|
504 |
clientHolder := nil. |
|
505 |
]. |
|
506 |
specHolder notNil ifTrue:[ |
|
507 |
specHolder removeDependent:self. |
|
508 |
specHolder := nil. |
|
509 |
]. |
|
2156 | 510 |
super release. |
1702 | 511 |
|
512 |
"Modified: / 13.2.2000 / 23:31:12 / cg" |
|
503 | 513 |
! ! |
514 |
||
1720
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
515 |
!SubCanvas methodsFor:'layout'! |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
516 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
517 |
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
518 |
"return the horizontal margin around (outer margin). |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
519 |
Redefined to avoid margin when no scrollers are present" |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
520 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
521 |
^ (hasV or:[hasH]) ifTrue:[scrolledViewHMargin] ifFalse:[0] |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
522 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
523 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
524 |
! |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
525 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
526 |
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
527 |
"return the horizontal margin around (outer margin). |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
528 |
Redefined to avoid margin when no scrollers are present" |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
529 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
530 |
^ (hasV or:[hasH]) ifTrue:[scrolledViewVMargin] ifFalse:[0] |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
531 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
532 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
533 |
! ! |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
534 |
|
503 | 535 |
!SubCanvas methodsFor:'queries'! |
536 |
||
537 |
application |
|
538 |
"return the application, under which this view was opened, |
|
539 |
" |
|
540 |
||
541 |
client notNil ifTrue:[ |
|
542 |
^ client |
|
455 | 543 |
]. |
503 | 544 |
^ super application |
545 |
||
455 | 546 |
! ! |
547 |
||
548 |
!SubCanvas class methodsFor:'documentation'! |
|
549 |
||
550 |
version |
|
2478 | 551 |
^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.51 2003-04-08 14:41:06 cg Exp $' |
455 | 552 |
! ! |