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