author | Claus Gittinger <cg@exept.de> |
Fri, 30 May 2008 19:20:00 +0200 | |
changeset 2352 | ed9a6f37f85b |
parent 2350 | 3421f548e14a |
child 2377 | 460554434db0 |
permissions | -rw-r--r-- |
164 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1386 | 12 |
"{ Package: 'stx:libtool2' }" |
13 |
||
164 | 14 |
ApplicationModel subclass:#UISpecificationTool |
759 | 15 |
instanceVariableNames:'modifiedHolder aspects specification selection specChannel |
1307 | 16 |
buildInView listOfSpecViews' |
164 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-UIPainter' |
|
20 |
! |
|
21 |
||
1307 | 22 |
ViewScroller subclass:#BuildInView |
1573 | 23 |
instanceVariableNames:'' |
1307 | 24 |
classVariableNames:'' |
25 |
poolDictionaries:'' |
|
26 |
privateIn:UISpecificationTool |
|
27 |
! |
|
28 |
||
164 | 29 |
!UISpecificationTool class methodsFor:'documentation'! |
30 |
||
31 |
copyright |
|
32 |
" |
|
33 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
34 |
All Rights Reserved |
|
35 |
||
36 |
This software is furnished under a license and may be used |
|
37 |
only in accordance with the terms of that license and with the |
|
38 |
inclusion of the above copyright notice. This software may not |
|
39 |
be provided or otherwise made available to, or used by, any |
|
40 |
other person. No title to or ownership of the software is |
|
41 |
hereby transferred. |
|
42 |
" |
|
43 |
||
44 |
||
45 |
||
46 |
! |
|
47 |
||
48 |
documentation |
|
49 |
" |
|
50 |
used by the UIPainter to manipulate the specifications of the selected component |
|
51 |
||
52 |
[author:] |
|
53 |
Claus Atzkern |
|
54 |
||
55 |
[see also:] |
|
56 |
UIPainter |
|
57 |
UILayoutTool |
|
58 |
UIHelpTool |
|
59 |
" |
|
60 |
! ! |
|
61 |
||
1963
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
62 |
!UISpecificationTool class methodsFor:'help specs'! |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
63 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
64 |
helpSpec |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
65 |
"This resource specification was automatically generated |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
66 |
by the UIHelpTool of ST/X." |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
67 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
68 |
"Do not manually edit this!! If it is corrupted, |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
69 |
the UIHelpTool may not be able to read the specification." |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
70 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
71 |
" |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
72 |
UIHelpTool openOnClass:UISpecificationTool |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
73 |
" |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
74 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
75 |
<resource: #help> |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
76 |
|
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
77 |
^ super helpSpec addPairsFrom:#( |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
78 |
|
2316
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
79 |
#allowSymbolicColors |
2335 | 80 |
'ColorMenu is allowed to return a symbolic color name' |
81 |
||
82 |
#allowSymbolicFonts |
|
83 |
'FontMenu is allowed to return a symbolic font name' |
|
2316
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
84 |
|
1963
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
85 |
#autoScrollHorizontal |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
86 |
'' |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
87 |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
88 |
#browseAction |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
89 |
'Browse/Create the Action method.' |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
90 |
|
2237
c1d95982e1c3
browse/generate aspect methods
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
91 |
#browseAspectMethod |
c1d95982e1c3
browse/generate aspect methods
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
92 |
'Browse/Create the Aspect method.' |
c1d95982e1c3
browse/generate aspect methods
Claus Gittinger <cg@exept.de>
parents:
2211
diff
changeset
|
93 |
|
2283 | 94 |
#editListSpec |
95 |
'Edit the contents of the list (inline)' |
|
96 |
||
2239
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
97 |
#formatString |
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
98 |
'' |
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
99 |
|
2316
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
100 |
#labelsAreColored |
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
101 |
'Show color in ColorMenuLabels' |
32e98f335115
Configure wether symbolic colors are allowed
Stefan Vogel <sv@exept.de>
parents:
2283
diff
changeset
|
102 |
|
2239
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
103 |
#textModel |
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
104 |
'' |
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
105 |
|
1963
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
106 |
) |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
107 |
! ! |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
108 |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
109 |
!UISpecificationTool class methodsFor:'image specs'! |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
110 |
|
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
111 |
browseActionImage |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
112 |
^ UIPainter browseActionImage |
2283 | 113 |
! |
114 |
||
115 |
editTableIcon |
|
116 |
^ UIPainter editTableIcon |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
117 |
! ! |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
118 |
|
164 | 119 |
!UISpecificationTool class methodsFor:'interface specs'! |
120 |
||
121 |
windowSpec |
|
1307 | 122 |
"This resource specification was automatically generated |
123 |
by the UIPainter of ST/X." |
|
164 | 124 |
|
1307 | 125 |
"Do not manually edit this!! If it is corrupted, |
126 |
the UIPainter may not be able to read the specification." |
|
164 | 127 |
|
128 |
" |
|
129 |
UIPainter new openOnClass:UISpecificationTool andSelector:#windowSpec |
|
130 |
UISpecificationTool new openInterface:#windowSpec |
|
1307 | 131 |
UISpecificationTool open |
164 | 132 |
" |
133 |
||
134 |
<resource: #canvas> |
|
135 |
||
1307 | 136 |
^ |
137 |
#(#FullSpec |
|
138 |
#name: #windowSpec |
|
139 |
#window: |
|
140 |
#(#WindowSpec |
|
141 |
#label: 'unnamed canvas' |
|
142 |
#name: 'unnamed canvas' |
|
1313 | 143 |
#bounds: #(#Rectangle 12 22 312 322) |
1307 | 144 |
) |
145 |
#component: |
|
146 |
#(#SpecCollection |
|
147 |
#collection: #( |
|
148 |
#(#ArbitraryComponentSpec |
|
1313 | 149 |
#name: 'BuildInView' |
1307 | 150 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
1313 | 151 |
#hasVerticalScrollBar: true |
152 |
#miniScrollerVertical: true |
|
153 |
#autoHideScrollBars: true |
|
1307 | 154 |
#hasBorder: false |
1313 | 155 |
#component: #buildInView |
1307 | 156 |
) |
157 |
) |
|
158 |
||
159 |
) |
|
164 | 160 |
) |
161 |
! ! |
|
162 |
||
1781
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
163 |
!UISpecificationTool class methodsFor:'resources'! |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
164 |
|
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
165 |
classResources |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
166 |
"my translations are found in the UIPainter classes resources" |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
167 |
|
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
168 |
^ UIPainter classResources |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
169 |
! ! |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
170 |
|
1331 | 171 |
!UISpecificationTool methodsFor:'accessing-channels'! |
1315 | 172 |
|
173 |
modifiedHolder:aValueHolder |
|
174 |
"set the value holder set to true in case of modifying attributes |
|
175 |
" |
|
176 |
||
177 |
modifiedHolder removeDependent:self. |
|
164 | 178 |
|
1315 | 179 |
(modifiedHolder := aValueHolder) notNil ifTrue:[ |
180 |
modifiedHolder addDependent:self. |
|
181 |
]. |
|
1063
9e710dbc7c92
inputFields use modified & acceptChannels
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
182 |
|
1315 | 183 |
! ! |
184 |
||
1331 | 185 |
!UISpecificationTool methodsFor:'accessing-specification'! |
1063
9e710dbc7c92
inputFields use modified & acceptChannels
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
186 |
|
2245 | 187 |
listOfAspects |
188 |
^ masterApplication listOfAspects |
|
189 |
||
190 |
"Created: / 12-01-2008 / 19:24:39 / cg" |
|
191 |
! |
|
192 |
||
193 |
listOfCallbacks |
|
194 |
^ masterApplication listOfCallbacks |
|
195 |
||
196 |
"Created: / 12-01-2008 / 19:25:05 / cg" |
|
197 |
! |
|
198 |
||
172 | 199 |
specification |
200 |
"gets current edit specification |
|
201 |
" |
|
202 |
^ specification |
|
203 |
||
204 |
||
205 |
! |
|
206 |
||
207 |
specification:aSpec |
|
208 |
"sets current edit specification |
|
209 |
" |
|
1315 | 210 |
aSpec notNil ifTrue:[ |
211 |
"/ same type of spec - simply change the spec; no need to setup everything |
|
212 |
specification class == aSpec class ifTrue:[ |
|
213 |
specification := aSpec. |
|
214 |
specChannel value:specification. |
|
215 |
^ self |
|
216 |
] |
|
1307 | 217 |
]. |
428 | 218 |
|
1315 | 219 |
"/ release resources |
220 |
specChannel release. |
|
221 |
aspects release. |
|
222 |
selection := listOfSpecViews := nil. |
|
1573 | 223 |
buildInView destroyAllClientViews. |
1315 | 224 |
|
225 |
(specification := aSpec) isNil ifTrue:[ |
|
226 |
aspects := specChannel := nil. |
|
227 |
^ self |
|
1307 | 228 |
]. |
229 |
||
230 |
"/ some tricky specs need the builder during the addBindings phase. |
|
231 |
"/ This is passed down in a special UIBindingsDictionary |
|
232 |
"/ (remain backward compatible) |
|
536
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
233 |
|
1307 | 234 |
aspects := UISpecification newBindingsDictionary. |
235 |
aspects builder:builder. |
|
236 |
aspects at:#modifiedChannel put:modifiedHolder. |
|
237 |
aspects at:#acceptChannel put:self acceptChannel. |
|
172 | 238 |
|
2245 | 239 |
aspects at:#listOfAspects put:[self listOfAspects]. |
240 |
aspects at:#listOfCallbacks put:[self listOfCallbacks]. |
|
241 |
||
1307 | 242 |
specChannel := specification asValue. |
243 |
specification class addBindingsTo:aspects for:specification channel:specChannel. |
|
536
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
244 |
|
1307 | 245 |
"/ arrange for being notified, if any aspect changes |
246 |
aspects do:[:el| el addDependent:self ]. |
|
2245 | 247 |
|
248 |
"Modified: / 12-01-2008 / 19:28:47 / cg" |
|
172 | 249 |
! ! |
250 |
||
364 | 251 |
!UISpecificationTool methodsFor:'actions'! |
252 |
||
253 |
setMaxExtent |
|
254 |
"set the windows maxExtent from its current extent" |
|
255 |
||
256 |
|canvas currentExtent| |
|
257 |
||
2211 | 258 |
canvas := self masterApplication canvas. |
364 | 259 |
currentExtent := canvas extent. |
260 |
(self aspectFor:#maxX) value:currentExtent x. |
|
261 |
(self aspectFor:#maxY) value:currentExtent y. |
|
262 |
||
263 |
"Modified: / 29.10.1997 / 18:29:17 / cg" |
|
264 |
! |
|
265 |
||
266 |
setMinExtent |
|
267 |
"set the windows minExtent from its current extent" |
|
268 |
||
269 |
|canvas currentExtent| |
|
270 |
||
2211 | 271 |
canvas := self masterApplication canvas. |
364 | 272 |
currentExtent := canvas extent. |
273 |
(self aspectFor:#minX) value:currentExtent x. |
|
274 |
(self aspectFor:#minY) value:currentExtent y. |
|
275 |
||
276 |
"Created: / 29.10.1997 / 18:17:55 / cg" |
|
277 |
"Modified: / 29.10.1997 / 18:28:53 / cg" |
|
278 |
! ! |
|
279 |
||
164 | 280 |
!UISpecificationTool methodsFor:'bindings'! |
281 |
||
1315 | 282 |
acceptChannel |
2245 | 283 |
^ masterApplication acceptChannel |
1315 | 284 |
|
2245 | 285 |
"Modified: / 12-01-2008 / 11:28:38 / cg" |
1315 | 286 |
! |
287 |
||
164 | 288 |
aspectFor:aKey |
2245 | 289 |
"returns the aspect for a key or nil" |
290 |
||
164 | 291 |
aspects notNil ifTrue:[ |
292 |
^ aspects at:aKey ifAbsent:nil |
|
293 |
]. |
|
294 |
^ super aspectFor:aKey |
|
295 |
||
2245 | 296 |
"Modified: / 12-01-2008 / 11:28:52 / cg" |
428 | 297 |
! |
298 |
||
1313 | 299 |
buildInView |
300 |
^ buildInView |
|
1307 | 301 |
! |
302 |
||
584
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
303 |
specificationFor:aKey |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
304 |
"this is called if our current specification contains |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
305 |
subspecifications or subcanvases. |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
306 |
Get the subspecification from the current specification" |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
307 |
|
1307 | 308 |
specification notNil ifTrue:[ |
309 |
^ specification class perform:aKey ifNotUnderstood:nil |
|
584
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
310 |
]. |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
311 |
^ nil |
172 | 312 |
! ! |
313 |
||
314 |
!UISpecificationTool methodsFor:'change & update'! |
|
164 | 315 |
|
172 | 316 |
update |
317 |
"reload specification |
|
164 | 318 |
" |
172 | 319 |
specChannel notNil ifTrue:[ |
320 |
specChannel value:specification. |
|
321 |
] |
|
164 | 322 |
|
323 |
||
324 |
! |
|
325 |
||
326 |
update:something with:someArgument from:someone |
|
327 |
"any attribute changed its state in the current specification |
|
328 |
" |
|
329 |
someone ~~ modifiedHolder ifTrue:[ |
|
893 | 330 |
"/ any in the spec has changed. |
331 |
"/ update my modified holders value |
|
332 |
||
1071 | 333 |
modifiedHolder value:true |
164 | 334 |
] |
335 |
||
893 | 336 |
"Modified: / 16.7.1998 / 19:25:59 / cg" |
164 | 337 |
! ! |
338 |
||
1956 | 339 |
!UISpecificationTool methodsFor:'help'! |
340 |
||
341 |
basicHelpTextForKey:aKey |
|
342 |
"activeHelp interface: return some help text for a key. |
|
343 |
Redefined to ask the current components Spec first." |
|
344 |
||
345 |
|helpText| |
|
346 |
||
347 |
"/ first, ask the spec |
|
348 |
helpText := (specification helpSpec) at:aKey ifAbsent:nil. |
|
349 |
"/ DEBUG: helpText isNil ifTrue:[^ 'No help for key: ', aKey ]. |
|
350 |
||
351 |
helpText isNil ifTrue:[ |
|
352 |
helpText := super basicHelpTextForKey:aKey. |
|
353 |
]. |
|
354 |
"/ DEBUG: ^ aKey , ': ' , helpText |
|
355 |
^ helpText |
|
356 |
! ! |
|
357 |
||
1315 | 358 |
!UISpecificationTool methodsFor:'initialization'! |
359 |
||
360 |
initialize |
|
361 |
super initialize. |
|
362 |
buildInView := BuildInView new. |
|
1573 | 363 |
buildInView keepViews:true. |
1315 | 364 |
! ! |
365 |
||
164 | 366 |
!UISpecificationTool methodsFor:'selection'! |
367 |
||
368 |
selection:something |
|
172 | 369 |
"selection changed |
370 |
" |
|
1307 | 371 |
|slices index spec window| |
164 | 372 |
|
172 | 373 |
specification notNil ifTrue:[ |
374 |
slices := specification class slices. |
|
1307 | 375 |
index := slices findFirst:[:aSlice| aSlice first = something ]. |
164 | 376 |
|
1307 | 377 |
index ~~ 0 ifTrue:[ |
378 |
spec := specification class perform:((slices at:index) last) |
|
428 | 379 |
] |
164 | 380 |
]. |
381 |
||
172 | 382 |
spec ~= selection ifTrue:[ |
1307 | 383 |
(selection := spec) notNil ifTrue:[ |
384 |
listOfSpecViews isNil ifTrue:[ |
|
385 |
listOfSpecViews := Array new:(slices size). |
|
386 |
] ifFalse:[ |
|
387 |
window := listOfSpecViews at:index |
|
388 |
]. |
|
389 |
window isNil ifTrue:[ |
|
390 |
builder buildFromSpec:spec in:(window := SimpleView new). |
|
391 |
listOfSpecViews at:index put:window. |
|
392 |
]. |
|
393 |
]. |
|
1315 | 394 |
buildInView scrolledView:window. |
164 | 395 |
]. |
396 |
! ! |
|
397 |
||
1307 | 398 |
!UISpecificationTool::BuildInView methodsFor:'accessing'! |
759 | 399 |
|
2160 | 400 |
mapped |
401 |
super mapped. |
|
402 |
||
403 |
scrolledView notNil ifTrue:[ |
|
404 |
scrolledView beVisible. |
|
405 |
scrolledView raise. |
|
406 |
]. |
|
407 |
! |
|
408 |
||
1307 | 409 |
scrolledView:aView |
410 |
"set the view to be scrolled" |
|
1573 | 411 |
|wrapper y| |
1307 | 412 |
|
413 |
scrolledView == aView ifTrue:[^ self]. |
|
759 | 414 |
|
2160 | 415 |
scrolledView notNil ifTrue:[ |
416 |
scrolledView unmap. |
|
417 |
]. |
|
418 |
(scrolledView := aView) notNil ifTrue:[ |
|
419 |
scrolledView superView ~~ frame ifTrue:[ |
|
420 |
scrolledView borderWidth:0; level:0. |
|
1307 | 421 |
|
2160 | 422 |
frame addSubView:scrolledView. |
1573 | 423 |
|
2160 | 424 |
scrolledView subViews size == 1 ifTrue:[ |
425 |
wrapper := scrolledView subViews first. |
|
426 |
wrapper isScrollWrapper ifTrue:[ |
|
427 |
"/ give it a full-relative size, and let it do |
|
428 |
"/ the scrolling itself. |
|
429 |
y := 1.0 |
|
430 |
] |
|
431 |
]. |
|
432 |
y isNil ifTrue:[ |
|
2350 | 433 |
y := scrolledView preferredHeight |
2160 | 434 |
]. |
435 |
scrolledView origin:0@0 corner:1.0 @ y. |
|
436 |
scrolledView allViewBackground:(self viewBackground). |
|
1351
811686e8acab
no additional scrollBar, if embedded view is itself a scrollable
Claus Gittinger <cg@exept.de>
parents:
1344
diff
changeset
|
437 |
]. |
2160 | 438 |
]. |
439 |
shown ifTrue:[ |
|
440 |
scrolledView beVisible. |
|
441 |
scrolledView raise. |
|
1307 | 442 |
self sizeChanged:nil. |
443 |
]. |
|
1573 | 444 |
model value:scrolledView. |
759 | 445 |
! ! |
446 |
||
1313 | 447 |
!UISpecificationTool::BuildInView methodsFor:'initialization'! |
448 |
||
449 |
level:aLevel |
|
450 |
super level:0 |
|
451 |
! |
|
452 |
||
453 |
realize |
|
1315 | 454 |
|
1313 | 455 |
super realize. |
456 |
superView notNil ifTrue:[superView level:0]. |
|
457 |
! ! |
|
458 |
||
164 | 459 |
!UISpecificationTool class methodsFor:'documentation'! |
460 |
||
461 |
version |
|
462 |
^ '$Header$' |
|
463 |
! ! |