author | Claus Gittinger <cg@exept.de> |
Wed, 23 Apr 2008 22:59:27 +0200 | |
changeset 3392 | 0d0461a20004 |
parent 3354 | 1f993ecf2265 |
child 3485 | d3eaa466fc23 |
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 |
||
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
120 |
makeClientViewScrollable:shouldBeScrollable |
1412 | 121 |
|vs| |
122 |
||
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
123 |
shouldBeScrollable ~~ clientViewIsScrolled ifTrue:[ |
1662 | 124 |
clientView isNil ifTrue:[ |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
125 |
useApplicationSubView ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
126 |
clientView := ApplicationSubView new. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
127 |
] ifFalse:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
128 |
clientView := View new. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
129 |
] |
1662 | 130 |
]. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
131 |
shouldBeScrollable ifTrue:[ |
1412 | 132 |
self scrolledView:(vs := ViewScroller new). |
133 |
vs scrolledView:clientView. |
|
134 |
] ifFalse:[ |
|
135 |
self scrolledView:clientView. |
|
136 |
]. |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
137 |
clientViewIsScrolled := shouldBeScrollable. |
1412 | 138 |
] |
139 |
||
1662 | 140 |
"Modified: / 30.1.2000 / 21:36:29 / cg" |
1412 | 141 |
! |
142 |
||
1450 | 143 |
setClient:anApplicationModel |
144 |
"set the client - do NOT rebuild" |
|
145 |
||
146 |
client := anApplicationModel |
|
147 |
! |
|
148 |
||
503 | 149 |
spec |
1893 | 150 |
^ spec |
151 |
! |
|
503 | 152 |
|
153 |
spec:something |
|
154 |
spec := something. |
|
155 |
self rebuild. |
|
819 | 156 |
! |
157 |
||
158 |
widget |
|
159 |
"ST80 compatibility. |
|
160 |
I am my own widget" |
|
161 |
||
162 |
^ self |
|
163 |
||
164 |
"Created: / 10.3.1998 / 16:20:52 / stefan" |
|
503 | 165 |
! ! |
166 |
||
2404 | 167 |
!SubCanvas methodsFor:'accessing-canvasView handling'! |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
168 |
|
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
169 |
keepClientView:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
170 |
keepClientView := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
171 |
! |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
172 |
|
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
173 |
useApplicationSubView:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
174 |
useApplicationSubView := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
175 |
! |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
176 |
|
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
177 |
useOwnBuilder:aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
178 |
useOwnBuilder := aBoolean |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
179 |
! ! |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
180 |
|
1818 | 181 |
!SubCanvas methodsFor:'accessing-channels'! |
503 | 182 |
|
183 |
clientHolder |
|
184 |
^ clientHolder |
|
185 |
! |
|
186 |
||
187 |
clientHolder:aValueHolder |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
188 |
|oldClient| |
503 | 189 |
|
190 |
clientHolder notNil ifTrue:[ |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
191 |
oldClient := clientHolder value. |
503 | 192 |
clientHolder removeDependent:self |
193 |
]. |
|
194 |
(clientHolder := aValueHolder) notNil ifTrue:[ |
|
195 |
clientHolder addDependent:self |
|
196 |
]. |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
197 |
oldClient ~~ clientHolder value ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
198 |
self updateFromChannels |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
199 |
] |
503 | 200 |
! |
201 |
||
1893 | 202 |
clientView:aView |
203 |
clientView notNil ifTrue:[ |
|
204 |
clientView destroy |
|
205 |
]. |
|
206 |
clientView := aView |
|
207 |
! |
|
208 |
||
503 | 209 |
specHolder |
210 |
^ specHolder |
|
211 |
! |
|
212 |
||
213 |
specHolder:aValueHolder |
|
1905 | 214 |
|oldSpec| |
503 | 215 |
|
216 |
specHolder notNil ifTrue:[ |
|
1905 | 217 |
oldSpec := specHolder value. |
503 | 218 |
specHolder removeDependent:self |
219 |
]. |
|
220 |
(specHolder := aValueHolder) notNil ifTrue:[ |
|
221 |
specHolder addDependent:self |
|
222 |
]. |
|
1905 | 223 |
oldSpec ~~ specHolder value ifTrue:[ |
224 |
self updateFromChannels |
|
225 |
] |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
226 |
! |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
227 |
|
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
228 |
specHolder:newSpecHolder clientHolder:newClientHolder |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
229 |
|oldSpec oldClient| |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
230 |
|
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
231 |
clientHolder notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
232 |
oldClient := clientHolder value. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
233 |
clientHolder removeDependent:self |
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 notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
236 |
oldSpec := specHolder value. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
237 |
specHolder removeDependent:self |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
238 |
]. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
239 |
(specHolder := newSpecHolder) notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
240 |
specHolder addDependent: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 |
(clientHolder := newClientHolder) notNil ifTrue:[ |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
243 |
clientHolder addDependent: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 |
((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
|
246 |
self updateFromChannels |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
247 |
] |
503 | 248 |
! ! |
249 |
||
250 |
!SubCanvas methodsFor:'building'! |
|
251 |
||
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
252 |
container:aView |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
253 |
super container:aView. |
1846 | 254 |
|
255 |
"/ my builder can only build the components, when I have a container |
|
256 |
"/ lateBuild is set, if the spec was set some time ago, when I had no container |
|
257 |
"/ Now, we know where to build the GUI ... |
|
258 |
"/ ... 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
|
259 |
lateBuild == true ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
260 |
lateBuild := false. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
261 |
self rebuild |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
262 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
263 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
264 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
265 |
rebuild |
2912 | 266 |
"rebuild my GUI from the spec." |
267 |
||
268 |
|subSpec savedView savedBuilder builderClass| |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
269 |
|
1856 | 270 |
"/ if the superView is not yet created, |
271 |
"/ we MUST delay building... (sigh) |
|
1905 | 272 |
superView isNil ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
273 |
lateBuild := true. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
274 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
275 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
276 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
277 |
clientView notNil ifTrue:[ |
1893 | 278 |
clientView destroySubViews. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
279 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
280 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
281 |
spec notNil ifTrue:[ |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
282 |
subSpec := spec. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
283 |
subSpec isSymbol ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
284 |
client isNil ifTrue:[ |
2394
c3984ea38fb5
only output warning 'no client...' if clientHolder is nil.
Claus Gittinger <cg@exept.de>
parents:
2156
diff
changeset
|
285 |
clientHolder isNil ifTrue:[ |
2395 | 286 |
('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
|
287 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
288 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
289 |
]. |
3392
0d0461a20004
interfaceSpecFor: must go via the instance
Claus Gittinger <cg@exept.de>
parents:
3354
diff
changeset
|
290 |
(subSpec := client interfaceSpecFor:spec) isNil ifTrue:[ |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
291 |
"/ Transcript showCR:'SubCanvas: nil spec'. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
292 |
^ self |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
293 |
] |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
294 |
]. |
1662 | 295 |
subSpec isArray ifTrue:[ |
3340 | 296 |
subSpec := subSpec decodeAsLiteralArray. |
297 |
subSpec isArray ifTrue:[self halt]. |
|
1662 | 298 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
299 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
300 |
builder isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
301 |
client isNil ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
302 |
builderClass := UIBuilder |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
303 |
] ifFalse:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
304 |
builderClass := client builderClass |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
305 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
306 |
builder := builderClass new. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
307 |
]. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
308 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
309 |
"/ old: |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
310 |
"/ builder buildFromSpec:subSpec in:clientView. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
311 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
312 |
"/ 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
|
313 |
"/ 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
|
314 |
|
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
315 |
keepClientView ifFalse:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
316 |
(clientView notNil and:[clientView application ~~ client]) ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
317 |
clientView destroy. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
318 |
clientView := nil. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
319 |
]. |
1893 | 320 |
]. |
321 |
||
322 |
clientView isNil ifTrue:[ |
|
1927 | 323 |
"/ 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
|
324 |
|
1927 | 325 |
useApplicationSubView ifTrue:[ |
326 |
clientView := ApplicationSubView new. |
|
327 |
] ifFalse:[ |
|
328 |
clientView := View new. |
|
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
329 |
] |
1893 | 330 |
]. |
3271 | 331 |
useApplicationSubView ifTrue:[ |
332 |
clientView application:client. |
|
333 |
]. |
|
1893 | 334 |
|
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
335 |
savedView := builder window. |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
336 |
builder window:clientView. |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
337 |
useOwnBuilder ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
338 |
savedBuilder := client builder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
339 |
client builder:builder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
340 |
]. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
341 |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
342 |
[ |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
343 |
|savedSuperView| |
1912 | 344 |
|
345 |
"/ kludge: need superView to be set correctly, in order for |
|
346 |
"/ postBuildAsSubCanvas to be invoked (instead of postBuild) |
|
347 |
"/ however, must unset the superView for code below ... |
|
348 |
savedSuperView := clientView superView. |
|
1914 | 349 |
savedSuperView isNil ifTrue:[clientView setContainer:self]. |
1912 | 350 |
client buildSubCanvas:subSpec withBuilder:builder. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
351 |
savedSuperView isNil ifTrue:[ |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
352 |
clientView setContainer:nil. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
353 |
self removeSubView:clientView. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
354 |
]. |
1905 | 355 |
|
356 |
keepClientView ifFalse:[ |
|
1908 | 357 |
(scrolledView notNil and:[clientView isComponentOf:scrolledView]) ifTrue:[ |
1906 | 358 |
self error:'this should not happen' |
1905 | 359 |
] ifFalse:[ |
360 |
self scrolledView:clientView. |
|
361 |
] |
|
1907 | 362 |
] ifTrue:[ |
1908 | 363 |
(clientView isComponentOf:self) ifFalse:[ |
1907 | 364 |
self scrolledView:clientView. |
365 |
] |
|
1905 | 366 |
] |
2083
d7b305aea776
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
1927
diff
changeset
|
367 |
] ensure:[ |
1662 | 368 |
savedView notNil ifTrue:[ |
369 |
builder window:savedView. |
|
1893 | 370 |
]. |
1895
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
371 |
useOwnBuilder ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
372 |
savedBuilder notNil ifTrue:[ |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
373 |
client builder:savedBuilder. |
a1b2502c91d7
went back halfway to the old behavior,
Claus Gittinger <cg@exept.de>
parents:
1894
diff
changeset
|
374 |
] |
1662 | 375 |
] |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
376 |
]. |
1893 | 377 |
|
1664 | 378 |
clientViewIsScrolled ifTrue:[ |
3340 | 379 |
subSpec window layout notNil ifTrue:[ |
380 |
"/ mhmh - what should we base the size computation on ? |
|
381 |
"/ (I dont see any reason to look at the windows spec at all; |
|
382 |
"/ isn't the user of the spec the only one to control the size). |
|
383 |
clientView extent:(subSpec window bounds extent) |
|
384 |
] ifFalse:[ |
|
385 |
clientView extent:(subSpec window bounds extent) |
|
386 |
]. |
|
3352 | 387 |
self sizeChanged:nil. "/ to force recomputation of the scrollbar |
1664 | 388 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
389 |
|
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
390 |
self realized ifTrue:[ |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
391 |
clientView realizeAllSubViews |
1662 | 392 |
]. |
1584
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
393 |
] |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
394 |
|
1662 | 395 |
"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
|
396 |
! |
f020416e00ae
LetterPrinter now works, after changing #rebuild.
Stefan Vogel <sv@exept.de>
parents:
1577
diff
changeset
|
397 |
|
503 | 398 |
releaseAllComponents |
2916 | 399 |
clientView notNil ifTrue:[ |
400 |
clientView destroySubViews. |
|
401 |
]. |
|
503 | 402 |
builder := nil. |
403 |
spec := nil. |
|
404 |
client := nil. |
|
1662 | 405 |
|
406 |
"Modified: / 31.1.2000 / 16:56:14 / cg" |
|
503 | 407 |
! ! |
408 |
||
409 |
!SubCanvas methodsFor:'change & update'! |
|
410 |
||
411 |
update:something with:aParameter from:changedObject |
|
557 | 412 |
(changedObject == clientHolder or:[changedObject == specHolder]) ifTrue:[ |
2478 | 413 |
self updateFromChannels. |
414 |
^ self |
|
415 |
]. |
|
416 |
super update:something with:aParameter from:changedObject. |
|
557 | 417 |
! |
418 |
||
419 |
updateFromChannels |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
420 |
"some of our channels (clientHolder, specHolder) changed" |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
421 |
|
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
422 |
|newClient newSpec uiBuilder| |
557 | 423 |
|
424 |
clientHolder isNil ifTrue:[ |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
425 |
newClient := self application. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
426 |
uiBuilder := UIBuilder new. |
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
427 |
uiBuilder isSubBuilder:true. |
557 | 428 |
] ifFalse:[ |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
429 |
newClient := clientHolder value |
554 | 430 |
]. |
503 | 431 |
|
557 | 432 |
specHolder isNil ifTrue:[ |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
433 |
newSpec := #windowSpec |
557 | 434 |
] ifFalse:[ |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
435 |
newSpec := specHolder value |
557 | 436 |
]. |
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
437 |
|
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
438 |
(newClient notNil and:[newSpec notNil]) ifTrue:[ |
557 | 439 |
] ifFalse:[ |
1467 | 440 |
"/ spec notNil ifTrue:[ |
441 |
"/ self halt:'spec but no app'. |
|
442 |
"/ ]. |
|
2857
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
443 |
newClient := nil. |
8bfa2eebfd2e
avoid double-update if clientHolder and specHolder are both set
Claus Gittinger <cg@exept.de>
parents:
2735
diff
changeset
|
444 |
newSpec := #windowSpec. "/ is that true ? |
1894 | 445 |
]. |
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
446 |
self client:newClient spec:newSpec builder:uiBuilder |
503 | 447 |
|
1467 | 448 |
"Modified: / 5.8.1999 / 13:35:26 / cg" |
503 | 449 |
! ! |
450 |
||
451 |
!SubCanvas methodsFor:'initialization'! |
|
452 |
||
2156 | 453 |
initialize |
454 |
super initialize. |
|
455 |
clientViewIsScrolled := false. |
|
456 |
||
457 |
"/ these defaults make subCanvas compatible with VW; |
|
458 |
"/ however, they make our life difficult sometimes. |
|
459 |
keepClientView := true. |
|
460 |
useApplicationSubView := true "false". |
|
461 |
useOwnBuilder := false. |
|
462 |
||
463 |
spec := #windowSpec. |
|
464 |
||
465 |
"Modified: / 31.1.2000 / 16:56:31 / cg" |
|
466 |
! |
|
467 |
||
468 |
release |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
469 |
client notNil ifTrue:[ |
1702 | 470 |
client == self application ifTrue:[ |
471 |
client releaseAsSubCanvas. |
|
472 |
] ifFalse:[ |
|
473 |
client release |
|
474 |
]. |
|
1471
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
475 |
]. |
09a5803325e4
when destroying or changing the client, release as subApp
Claus Gittinger <cg@exept.de>
parents:
1467
diff
changeset
|
476 |
|
609 | 477 |
clientHolder notNil ifTrue:[ |
478 |
clientHolder removeDependent:self. |
|
479 |
clientHolder := nil. |
|
480 |
]. |
|
481 |
specHolder notNil ifTrue:[ |
|
482 |
specHolder removeDependent:self. |
|
483 |
specHolder := nil. |
|
484 |
]. |
|
2156 | 485 |
super release. |
1702 | 486 |
|
487 |
"Modified: / 13.2.2000 / 23:31:12 / cg" |
|
503 | 488 |
! ! |
489 |
||
1720
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
490 |
!SubCanvas methodsFor:'layout'! |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
491 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
492 |
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
493 |
"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
|
494 |
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
|
495 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
496 |
^ (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
|
497 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
498 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
499 |
! |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
500 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
501 |
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
502 |
"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
|
503 |
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
|
504 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
505 |
^ (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
|
506 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
507 |
|
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
508 |
! ! |
d855968ce342
redefine margin computations (avoid margin if subcanvas does not scroll).
Claus Gittinger <cg@exept.de>
parents:
1702
diff
changeset
|
509 |
|
503 | 510 |
!SubCanvas methodsFor:'queries'! |
511 |
||
512 |
application |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
513 |
"return the application, under which this view was opened" |
503 | 514 |
|
3354
1f993ecf2265
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3352
diff
changeset
|
515 |
^ client ? super application |
455 | 516 |
! ! |
517 |
||
518 |
!SubCanvas class methodsFor:'documentation'! |
|
519 |
||
520 |
version |
|
3392
0d0461a20004
interfaceSpecFor: must go via the instance
Claus Gittinger <cg@exept.de>
parents:
3354
diff
changeset
|
521 |
^ '$Header: /cvs/stx/stx/libwidg2/SubCanvas.st,v 1.61 2008-04-23 20:59:27 cg Exp $' |
455 | 522 |
! ! |