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