author | Claus Gittinger <cg@exept.de> |
Mon, 20 Oct 2008 16:47:34 +0200 | |
changeset 3560 | da82e25a9b0f |
parent 3514 | f90f271410dd |
child 3846 | d786c6dba0a4 |
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 ...). |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
45 |
However, the default setup is not very useful to embed arbitrary applications |
1895
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. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
47 |
|
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
48 |
Use the settings: |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
49 |
keepClientView (default: true) |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
50 |
useApplicationSubView (default: false) |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
51 |
useOwnBuilder (default: false) |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
52 |
|
970
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
53 |
[author:] |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
54 |
Claus Atzkern |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
55 |
" |
8cbadf2b9825
also send #postBuildWith: to the app.
Claus Gittinger <cg@exept.de>
parents:
819
diff
changeset
|
56 |
! ! |
455 | 57 |
|
1414
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
58 |
!SubCanvas class methodsFor:'defaults'! |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
59 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
60 |
defaultHorizontalScrollable |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
61 |
^ false |
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 |
|
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
66 |
defaultVerticalScrollable |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
67 |
^ false |
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 |
! ! |
faf0465c333b
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1412
diff
changeset
|
71 |
|
455 | 72 |
!SubCanvas methodsFor:'accessing'! |
73 |
||
503 | 74 |
builder |
1893 | 75 |
^ builder |
76 |
! |
|
455 | 77 |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
78 |
builder:aBuilder |
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 |
! |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
81 |
|
503 | 82 |
client |
1893 | 83 |
^ client |
84 |
! |
|
455 | 85 |
|
503 | 86 |
client:anApplication spec:aWindowSpecOrSpecSymbol builder:aBuilder |
455 | 87 |
"release existing components and generate new components from |
88 |
the given windowSpec, using the given builder." |
|
89 |
||
2427
43e68ab02e63
oops - undo last change (postOpen when client changes)
Claus Gittinger <cg@exept.de>
parents:
2426
diff
changeset
|
90 |
|myApp| |
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
91 |
|
1686 | 92 |
(client notNil and:[client ~~ anApplication]) ifTrue:[ |
93 |
client releaseAsSubCanvas. |
|
94 |
client := nil. |
|
95 |
]. |
|
96 |
||
1546
452132649648
Moved #client: and #client:spec: to SimpleView.
Stefan Vogel <sv@exept.de>
parents:
1471
diff
changeset
|
97 |
(builder := aBuilder) isNil ifTrue:[ |
1846 | 98 |
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
|
99 |
]. |
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 |
spec := aWindowSpecOrSpecSymbol. |
503 | 102 |
|
103 |
"/ check for master application |
|
104 |
(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
|
105 |
myApp := self application. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
106 |
myApp ~~ anApplication ifTrue:[ |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
107 |
anApplication masterApplication:myApp |
503 | 108 |
] |
109 |
]. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
110 |
|
503 | 111 |
client := anApplication. |
112 |
self rebuild. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
113 |
^ builder |
503 | 114 |
! |
115 |
||
3340 | 116 |
clientView |
117 |
^ clientView |
|
118 |
! |
|
119 |
||
3499 | 120 |
clientViewIsScrolled |
121 |
^ clientViewIsScrolled |
|
122 |
! |
|
123 |
||
124 |
isScrollWrapper |
|
125 |
^ clientViewIsScrolled |
|
126 |
! |
|
127 |
||
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
128 |
makeClientViewScrollable:shouldBeScrollable |
3514
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
129 |
|scroller| |
1412 | 130 |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
131 |
shouldBeScrollable ~~ clientViewIsScrolled ifTrue:[ |
1662 | 132 |
clientView isNil ifTrue:[ |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
133 |
useApplicationSubView ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
134 |
clientView := ApplicationSubView new. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
135 |
] ifFalse:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
136 |
clientView := View new. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
137 |
] |
1662 | 138 |
]. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
139 |
shouldBeScrollable ifTrue:[ |
3514
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
140 |
scroller := ViewScroller new. |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
141 |
scroller viewBackground:self viewBackground. |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
142 |
self scrolledView:scroller. |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
143 |
scroller scrolledView:clientView. |
1412 | 144 |
] ifFalse:[ |
145 |
self scrolledView:clientView. |
|
146 |
]. |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
147 |
clientViewIsScrolled := shouldBeScrollable. |
1412 | 148 |
] |
149 |
||
1662 | 150 |
"Modified: / 30.1.2000 / 21:36:29 / cg" |
1412 | 151 |
! |
152 |
||
1450 | 153 |
setClient:anApplicationModel |
154 |
"set the client - do NOT rebuild" |
|
155 |
||
156 |
client := anApplicationModel |
|
157 |
! |
|
158 |
||
503 | 159 |
spec |
1893 | 160 |
^ spec |
161 |
! |
|
503 | 162 |
|
163 |
spec:something |
|
164 |
spec := something. |
|
165 |
self rebuild. |
|
819 | 166 |
! |
167 |
||
168 |
widget |
|
169 |
"ST80 compatibility. |
|
170 |
I am my own widget" |
|
171 |
||
172 |
^ self |
|
173 |
||
174 |
"Created: / 10.3.1998 / 16:20:52 / stefan" |
|
503 | 175 |
! ! |
176 |
||
2404 | 177 |
!SubCanvas methodsFor:'accessing-canvasView handling'! |
1895
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 |
keepClientView:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
180 |
keepClientView := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
181 |
! |
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 |
useApplicationSubView:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
184 |
useApplicationSubView := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
185 |
! |
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 |
useOwnBuilder:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
188 |
useOwnBuilder := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
189 |
! ! |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
190 |
|
1818 | 191 |
!SubCanvas methodsFor:'accessing-channels'! |
503 | 192 |
|
193 |
clientHolder |
|
194 |
^ clientHolder |
|
195 |
! |
|
196 |
||
197 |
clientHolder:aValueHolder |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
198 |
|oldClient| |
503 | 199 |
|
200 |
clientHolder notNil ifTrue:[ |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
201 |
oldClient := clientHolder value. |
503 | 202 |
clientHolder removeDependent:self |
203 |
]. |
|
204 |
(clientHolder := aValueHolder) notNil ifTrue:[ |
|
205 |
clientHolder addDependent:self |
|
206 |
]. |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
207 |
oldClient ~~ clientHolder value ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
208 |
self updateFromChannels |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
209 |
] |
503 | 210 |
! |
211 |
||
1893 | 212 |
clientView:aView |
213 |
clientView notNil ifTrue:[ |
|
214 |
clientView destroy |
|
215 |
]. |
|
216 |
clientView := aView |
|
217 |
! |
|
218 |
||
503 | 219 |
specHolder |
220 |
^ specHolder |
|
221 |
! |
|
222 |
||
223 |
specHolder:aValueHolder |
|
1905 | 224 |
|oldSpec| |
503 | 225 |
|
226 |
specHolder notNil ifTrue:[ |
|
1905 | 227 |
oldSpec := specHolder value. |
503 | 228 |
specHolder removeDependent:self |
229 |
]. |
|
230 |
(specHolder := aValueHolder) notNil ifTrue:[ |
|
231 |
specHolder addDependent:self |
|
232 |
]. |
|
1905 | 233 |
oldSpec ~~ specHolder value ifTrue:[ |
234 |
self updateFromChannels |
|
235 |
] |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
236 |
! |
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 |
specHolder:newSpecHolder clientHolder:newClientHolder |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
239 |
|oldSpec oldClient| |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
240 |
|
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
241 |
clientHolder notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
242 |
oldClient := clientHolder value. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
243 |
clientHolder removeDependent:self |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
244 |
]. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
245 |
specHolder notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
246 |
oldSpec := specHolder value. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
247 |
specHolder removeDependent: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 |
(specHolder := newSpecHolder) notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
250 |
specHolder 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 |
(clientHolder := newClientHolder) notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
253 |
clientHolder addDependent:self |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
254 |
]. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
255 |
((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
|
256 |
self updateFromChannels |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
257 |
] |
503 | 258 |
! ! |
259 |
||
260 |
!SubCanvas methodsFor:'building'! |
|
261 |
||
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
262 |
container:aView |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
263 |
super container:aView. |
1846 | 264 |
|
265 |
"/ my builder can only build the components, when I have a container |
|
266 |
"/ lateBuild is set, if the spec was set some time ago, when I had no container |
|
267 |
"/ Now, we know where to build the GUI ... |
|
268 |
"/ ... 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
|
269 |
lateBuild == true ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
270 |
lateBuild := false. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
271 |
self rebuild |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
272 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
273 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
274 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
275 |
rebuild |
2912 | 276 |
"rebuild my GUI from the spec." |
277 |
||
278 |
|subSpec savedView savedBuilder builderClass| |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
279 |
|
1856 | 280 |
"/ if the superView is not yet created, |
281 |
"/ we MUST delay building... (sigh) |
|
1905 | 282 |
superView isNil ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
283 |
lateBuild := true. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
284 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
285 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
286 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
287 |
clientView notNil ifTrue:[ |
1893 | 288 |
clientView destroySubViews. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
289 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
290 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
291 |
spec notNil ifTrue:[ |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
292 |
subSpec := spec. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
293 |
subSpec isSymbol ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
294 |
client isNil ifTrue:[ |
2394
c3984ea38fb5
only output warning 'no client...' if clientHolder is nil.
Claus Gittinger <cg@exept.de>
parents:
2156
diff
changeset
|
295 |
clientHolder isNil ifTrue:[ |
2395 | 296 |
('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
|
297 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
298 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
299 |
]. |
3392
0d0461a20004
interfaceSpecFor: must go via the instance
Claus Gittinger <cg@exept.de>
parents:
3354
diff
changeset
|
300 |
(subSpec := client interfaceSpecFor:spec) isNil ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
301 |
"/ Transcript showCR:'SubCanvas: nil spec'. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
302 |
^ self |
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 |
]. |
1662 | 305 |
subSpec isArray ifTrue:[ |
3340 | 306 |
subSpec := subSpec decodeAsLiteralArray. |
3560 | 307 |
subSpec isArray ifTrue:[self halt:'oops - decode failed']. |
1662 | 308 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
309 |
builder isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
310 |
client isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
311 |
builderClass := UIBuilder |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
312 |
] ifFalse:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
313 |
builderClass := client builderClass |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
314 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
315 |
builder := builderClass new. |
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 |
"/ old: |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
319 |
"/ builder buildFromSpec:subSpec in:clientView. |
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 |
"/ 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
|
322 |
"/ 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
|
323 |
|
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
324 |
keepClientView ifFalse:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
325 |
(clientView notNil and:[clientView application ~~ client]) ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
326 |
clientView destroy. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
327 |
clientView := nil. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
328 |
]. |
1893 | 329 |
]. |
330 |
||
331 |
clientView isNil ifTrue:[ |
|
1927 | 332 |
"/ 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
|
333 |
|
1927 | 334 |
useApplicationSubView ifTrue:[ |
335 |
clientView := ApplicationSubView new. |
|
336 |
] ifFalse:[ |
|
337 |
clientView := View new. |
|
3514
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
338 |
]. |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
339 |
clientView viewBackground:self viewBackground. |
1893 | 340 |
]. |
3271 | 341 |
useApplicationSubView ifTrue:[ |
342 |
clientView application:client. |
|
343 |
]. |
|
1893 | 344 |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
345 |
savedView := builder window. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
346 |
builder window:clientView. |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
347 |
useOwnBuilder ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
348 |
savedBuilder := client builder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
349 |
client builder:builder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
350 |
]. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
351 |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
352 |
[ |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
353 |
|savedSuperView| |
1912 | 354 |
|
355 |
"/ kludge: need superView to be set correctly, in order for |
|
356 |
"/ postBuildAsSubCanvas to be invoked (instead of postBuild) |
|
357 |
"/ however, must unset the superView for code below ... |
|
358 |
savedSuperView := clientView superView. |
|
1914 | 359 |
savedSuperView isNil ifTrue:[clientView setContainer:self]. |
1912 | 360 |
client buildSubCanvas:subSpec withBuilder:builder. |
3485
d3eaa466fc23
care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
361 |
|
d3eaa466fc23
care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
362 |
subSpec class == FullSpec ifTrue:[ |
d3eaa466fc23
care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
363 |
"/ mhmh - should we take the attributes from the windowSpec or from my spec ???? |
d3eaa466fc23
care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
364 |
subSpec window setBackgroundColorAttributesIn:clientView with:builder. |
d3eaa466fc23
care for viewBackground (coming from embedded spec)
Claus Gittinger <cg@exept.de>
parents:
3392
diff
changeset
|
365 |
]. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
366 |
savedSuperView isNil ifTrue:[ |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
367 |
clientView setContainer:nil. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
368 |
self removeSubView:clientView. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
369 |
]. |
1905 | 370 |
|
371 |
keepClientView ifFalse:[ |
|
3514
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
372 |
self assert:(scrolledView isNil or:[(clientView isComponentOf:scrolledView) not]). |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
373 |
self scrolledView:clientView. |
1907 | 374 |
] ifTrue:[ |
1908 | 375 |
(clientView isComponentOf:self) ifFalse:[ |
1907 | 376 |
self scrolledView:clientView. |
377 |
] |
|
1905 | 378 |
] |
2083
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
379 |
] ensure:[ |
1662 | 380 |
savedView notNil ifTrue:[ |
381 |
builder window:savedView. |
|
1893 | 382 |
]. |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
383 |
useOwnBuilder ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
384 |
savedBuilder notNil ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
385 |
client builder:savedBuilder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
386 |
] |
1662 | 387 |
] |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
388 |
]. |
1893 | 389 |
|
1664 | 390 |
clientViewIsScrolled ifTrue:[ |
3340 | 391 |
subSpec window layout notNil ifTrue:[ |
392 |
"/ mhmh - what should we base the size computation on ? |
|
393 |
"/ (I dont see any reason to look at the windows spec at all; |
|
394 |
"/ isn't the user of the spec the only one to control the size). |
|
395 |
clientView extent:(subSpec window bounds extent) |
|
396 |
] ifFalse:[ |
|
397 |
clientView extent:(subSpec window bounds extent) |
|
398 |
]. |
|
3352 | 399 |
self sizeChanged:nil. "/ to force recomputation of the scrollbar |
1664 | 400 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
401 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
402 |
self realized ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
403 |
clientView realizeAllSubViews |
1662 | 404 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
405 |
] |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
406 |
|
1662 | 407 |
"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
|
408 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
409 |
|
503 | 410 |
releaseAllComponents |
2916 | 411 |
clientView notNil ifTrue:[ |
412 |
clientView destroySubViews. |
|
413 |
]. |
|
503 | 414 |
builder := nil. |
415 |
spec := nil. |
|
416 |
client := nil. |
|
1662 | 417 |
|
418 |
"Modified: / 31.1.2000 / 16:56:14 / cg" |
|
503 | 419 |
! ! |
420 |
||
421 |
!SubCanvas methodsFor:'change & update'! |
|
422 |
||
423 |
update:something with:aParameter from:changedObject |
|
557 | 424 |
(changedObject == clientHolder or:[changedObject == specHolder]) ifTrue:[ |
2478 | 425 |
self updateFromChannels. |
426 |
^ self |
|
427 |
]. |
|
428 |
super update:something with:aParameter from:changedObject. |
|
557 | 429 |
! |
430 |
||
431 |
updateFromChannels |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
432 |
"some of our channels (clientHolder, specHolder) changed" |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
433 |
|
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
434 |
|newClient newSpec uiBuilder| |
557 | 435 |
|
436 |
clientHolder isNil ifTrue:[ |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
437 |
newClient := self application. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
438 |
uiBuilder := UIBuilder new. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
439 |
uiBuilder isSubBuilder:true. |
557 | 440 |
] ifFalse:[ |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
441 |
newClient := clientHolder value |
554 | 442 |
]. |
503 | 443 |
|
557 | 444 |
specHolder isNil ifTrue:[ |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
445 |
newSpec := #windowSpec |
557 | 446 |
] ifFalse:[ |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
447 |
newSpec := specHolder value |
557 | 448 |
]. |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
449 |
|
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
450 |
(newClient notNil and:[newSpec notNil]) ifTrue:[ |
557 | 451 |
] ifFalse:[ |
1467 | 452 |
"/ spec notNil ifTrue:[ |
453 |
"/ self halt:'spec but no app'. |
|
454 |
"/ ]. |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
455 |
newClient := nil. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
456 |
newSpec := #windowSpec. "/ is that true ? |
1894 | 457 |
]. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
458 |
self client:newClient spec:newSpec builder:uiBuilder |
503 | 459 |
|
1467 | 460 |
"Modified: / 5.8.1999 / 13:35:26 / cg" |
503 | 461 |
! ! |
462 |
||
3514
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
463 |
!SubCanvas methodsFor:'delegation'! |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
464 |
|
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
465 |
viewBackground:aColor |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
466 |
"convenient method: forward this to the scrolledView" |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
467 |
|
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
468 |
super viewBackground:aColor. |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
469 |
(scrolledView notNil and:[scrolledView ~= clientView]) ifTrue:[ |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
470 |
scrolledView viewBackground:aColor |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
471 |
]. |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
472 |
! ! |
f90f271410dd
When using a viewscroller, propagate viewBackground to the viewscroller
Stefan Vogel <sv@exept.de>
parents:
3499
diff
changeset
|
473 |
|
503 | 474 |
!SubCanvas methodsFor:'initialization'! |
475 |
||
2156 | 476 |
initialize |
477 |
super initialize. |
|
478 |
clientViewIsScrolled := false. |
|
479 |
||
480 |
"/ these defaults make subCanvas compatible with VW; |
|
481 |
"/ however, they make our life difficult sometimes. |
|
482 |
keepClientView := true. |
|
483 |
useApplicationSubView := true "false". |
|
484 |
useOwnBuilder := false. |
|
485 |
||
486 |
spec := #windowSpec. |
|
487 |
||
488 |
"Modified: / 31.1.2000 / 16:56:31 / cg" |
|
489 |
! |
|
490 |
||
491 |
release |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
492 |
client notNil ifTrue:[ |
1702 | 493 |
client == self application ifTrue:[ |
494 |
client releaseAsSubCanvas. |
|
495 |
] ifFalse:[ |
|
496 |
client release |
|
497 |
]. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
498 |
]. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
499 |
|
609 | 500 |
clientHolder notNil ifTrue:[ |
501 |
clientHolder removeDependent:self. |
|
502 |
clientHolder := nil. |
|
503 |
]. |
|
504 |
specHolder notNil ifTrue:[ |
|
505 |
specHolder removeDependent:self. |
|
506 |
specHolder := nil. |
|
507 |
]. |
|
2156 | 508 |
super release. |
1702 | 509 |
|
510 |
"Modified: / 13.2.2000 / 23:31:12 / cg" |
|
503 | 511 |
! ! |
512 |
||
1720
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
513 |
!SubCanvas methodsFor:'layout'! |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
514 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
515 |
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
516 |
"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
|
517 |
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
|
518 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
519 |
^ (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
|
520 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
521 |
|
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 |
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
525 |
"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
|
526 |
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
|
527 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
528 |
^ (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
|
529 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
530 |
|
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 |
|
503 | 533 |
!SubCanvas methodsFor:'queries'! |
534 |
||
535 |
application |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
536 |
"return the application, under which this view was opened" |
503 | 537 |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
538 |
^ client ? super application |
455 | 539 |
! ! |
540 |
||
541 |
!SubCanvas class methodsFor:'documentation'! |
|
542 |
||
543 |
version |
|
3560 | 544 |
^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.65 2008-10-20 14:47:34 cg Exp $' |
455 | 545 |
! ! |