author | Claus Gittinger <cg@exept.de> |
Thu, 12 Feb 2009 18:45:32 +0100 | |
changeset 2465 | 37207ee0ff04 |
parent 2377 | 460554434db0 |
child 2524 | 759b4b908fcb |
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 |
|
2377 | 103 |
#showFrame |
104 |
'Show the frame' |
|
105 |
||
2239
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
106 |
#textModel |
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
107 |
'' |
2f8dda52674e
aspect chooser in inputFieldSpec (prep)
Claus Gittinger <cg@exept.de>
parents:
2237
diff
changeset
|
108 |
|
2377 | 109 |
#translateLabel |
110 |
'' |
|
111 |
||
1963
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
112 |
) |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
113 |
! ! |
a0c51ed97fc3
autoScrollHoriz is now configurable
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
114 |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
115 |
!UISpecificationTool class methodsFor:'image specs'! |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
116 |
|
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
117 |
browseActionImage |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
118 |
^ UIPainter browseActionImage |
2283 | 119 |
! |
120 |
||
121 |
editTableIcon |
|
122 |
^ UIPainter editTableIcon |
|
2209
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
123 |
! ! |
c7ac53d62021
action creation/browse added
Claus Gittinger <cg@exept.de>
parents:
2160
diff
changeset
|
124 |
|
164 | 125 |
!UISpecificationTool class methodsFor:'interface specs'! |
126 |
||
127 |
windowSpec |
|
1307 | 128 |
"This resource specification was automatically generated |
129 |
by the UIPainter of ST/X." |
|
164 | 130 |
|
1307 | 131 |
"Do not manually edit this!! If it is corrupted, |
132 |
the UIPainter may not be able to read the specification." |
|
164 | 133 |
|
134 |
" |
|
135 |
UIPainter new openOnClass:UISpecificationTool andSelector:#windowSpec |
|
136 |
UISpecificationTool new openInterface:#windowSpec |
|
1307 | 137 |
UISpecificationTool open |
164 | 138 |
" |
139 |
||
140 |
<resource: #canvas> |
|
141 |
||
1307 | 142 |
^ |
143 |
#(#FullSpec |
|
144 |
#name: #windowSpec |
|
145 |
#window: |
|
146 |
#(#WindowSpec |
|
147 |
#label: 'unnamed canvas' |
|
148 |
#name: 'unnamed canvas' |
|
1313 | 149 |
#bounds: #(#Rectangle 12 22 312 322) |
1307 | 150 |
) |
151 |
#component: |
|
152 |
#(#SpecCollection |
|
153 |
#collection: #( |
|
154 |
#(#ArbitraryComponentSpec |
|
1313 | 155 |
#name: 'BuildInView' |
1307 | 156 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
1313 | 157 |
#hasVerticalScrollBar: true |
158 |
#miniScrollerVertical: true |
|
159 |
#autoHideScrollBars: true |
|
1307 | 160 |
#hasBorder: false |
1313 | 161 |
#component: #buildInView |
1307 | 162 |
) |
163 |
) |
|
164 |
||
165 |
) |
|
164 | 166 |
) |
167 |
! ! |
|
168 |
||
1781
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
169 |
!UISpecificationTool class methodsFor:'resources'! |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
170 |
|
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
171 |
classResources |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
172 |
"my translations are found in the UIPainter classes resources" |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
173 |
|
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
174 |
^ UIPainter classResources |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
175 |
! ! |
d67090b1ad57
resources shared with UIPainter class
Claus Gittinger <cg@exept.de>
parents:
1677
diff
changeset
|
176 |
|
1331 | 177 |
!UISpecificationTool methodsFor:'accessing-channels'! |
1315 | 178 |
|
179 |
modifiedHolder:aValueHolder |
|
180 |
"set the value holder set to true in case of modifying attributes |
|
181 |
" |
|
182 |
||
183 |
modifiedHolder removeDependent:self. |
|
164 | 184 |
|
1315 | 185 |
(modifiedHolder := aValueHolder) notNil ifTrue:[ |
186 |
modifiedHolder addDependent:self. |
|
187 |
]. |
|
1063
9e710dbc7c92
inputFields use modified & acceptChannels
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
188 |
|
1315 | 189 |
! ! |
190 |
||
1331 | 191 |
!UISpecificationTool methodsFor:'accessing-specification'! |
1063
9e710dbc7c92
inputFields use modified & acceptChannels
Claus Gittinger <cg@exept.de>
parents:
1051
diff
changeset
|
192 |
|
2245 | 193 |
listOfAspects |
194 |
^ masterApplication listOfAspects |
|
195 |
||
196 |
"Created: / 12-01-2008 / 19:24:39 / cg" |
|
197 |
! |
|
198 |
||
199 |
listOfCallbacks |
|
200 |
^ masterApplication listOfCallbacks |
|
201 |
||
202 |
"Created: / 12-01-2008 / 19:25:05 / cg" |
|
203 |
! |
|
204 |
||
172 | 205 |
specification |
206 |
"gets current edit specification |
|
207 |
" |
|
208 |
^ specification |
|
209 |
||
210 |
||
211 |
! |
|
212 |
||
213 |
specification:aSpec |
|
214 |
"sets current edit specification |
|
215 |
" |
|
1315 | 216 |
aSpec notNil ifTrue:[ |
217 |
"/ same type of spec - simply change the spec; no need to setup everything |
|
218 |
specification class == aSpec class ifTrue:[ |
|
219 |
specification := aSpec. |
|
220 |
specChannel value:specification. |
|
221 |
^ self |
|
222 |
] |
|
1307 | 223 |
]. |
428 | 224 |
|
1315 | 225 |
"/ release resources |
226 |
specChannel release. |
|
227 |
aspects release. |
|
228 |
selection := listOfSpecViews := nil. |
|
1573 | 229 |
buildInView destroyAllClientViews. |
1315 | 230 |
|
231 |
(specification := aSpec) isNil ifTrue:[ |
|
232 |
aspects := specChannel := nil. |
|
233 |
^ self |
|
1307 | 234 |
]. |
235 |
||
236 |
"/ some tricky specs need the builder during the addBindings phase. |
|
237 |
"/ This is passed down in a special UIBindingsDictionary |
|
238 |
"/ (remain backward compatible) |
|
536
3991e37ec19f
pass special dictionary as bindings-environmnt
Claus Gittinger <cg@exept.de>
parents:
428
diff
changeset
|
239 |
|
1307 | 240 |
aspects := UISpecification newBindingsDictionary. |
241 |
aspects builder:builder. |
|
242 |
aspects at:#modifiedChannel put:modifiedHolder. |
|
243 |
aspects at:#acceptChannel put:self acceptChannel. |
|
172 | 244 |
|
2245 | 245 |
aspects at:#listOfAspects put:[self listOfAspects]. |
246 |
aspects at:#listOfCallbacks put:[self listOfCallbacks]. |
|
247 |
||
1307 | 248 |
specChannel := specification asValue. |
249 |
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
|
250 |
|
1307 | 251 |
"/ arrange for being notified, if any aspect changes |
252 |
aspects do:[:el| el addDependent:self ]. |
|
2245 | 253 |
|
254 |
"Modified: / 12-01-2008 / 19:28:47 / cg" |
|
172 | 255 |
! ! |
256 |
||
364 | 257 |
!UISpecificationTool methodsFor:'actions'! |
258 |
||
259 |
setMaxExtent |
|
260 |
"set the windows maxExtent from its current extent" |
|
261 |
||
262 |
|canvas currentExtent| |
|
263 |
||
2211 | 264 |
canvas := self masterApplication canvas. |
364 | 265 |
currentExtent := canvas extent. |
266 |
(self aspectFor:#maxX) value:currentExtent x. |
|
267 |
(self aspectFor:#maxY) value:currentExtent y. |
|
268 |
||
269 |
"Modified: / 29.10.1997 / 18:29:17 / cg" |
|
270 |
! |
|
271 |
||
272 |
setMinExtent |
|
273 |
"set the windows minExtent from its current extent" |
|
274 |
||
275 |
|canvas currentExtent| |
|
276 |
||
2211 | 277 |
canvas := self masterApplication canvas. |
364 | 278 |
currentExtent := canvas extent. |
279 |
(self aspectFor:#minX) value:currentExtent x. |
|
280 |
(self aspectFor:#minY) value:currentExtent y. |
|
281 |
||
282 |
"Created: / 29.10.1997 / 18:17:55 / cg" |
|
283 |
"Modified: / 29.10.1997 / 18:28:53 / cg" |
|
284 |
! ! |
|
285 |
||
164 | 286 |
!UISpecificationTool methodsFor:'bindings'! |
287 |
||
1315 | 288 |
acceptChannel |
2245 | 289 |
^ masterApplication acceptChannel |
1315 | 290 |
|
2245 | 291 |
"Modified: / 12-01-2008 / 11:28:38 / cg" |
1315 | 292 |
! |
293 |
||
164 | 294 |
aspectFor:aKey |
2245 | 295 |
"returns the aspect for a key or nil" |
296 |
||
164 | 297 |
aspects notNil ifTrue:[ |
298 |
^ aspects at:aKey ifAbsent:nil |
|
299 |
]. |
|
300 |
^ super aspectFor:aKey |
|
301 |
||
2245 | 302 |
"Modified: / 12-01-2008 / 11:28:52 / cg" |
428 | 303 |
! |
304 |
||
1313 | 305 |
buildInView |
306 |
^ buildInView |
|
1307 | 307 |
! |
308 |
||
584
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
309 |
specificationFor:aKey |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
310 |
"this is called if our current specification contains |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
311 |
subspecifications or subcanvases. |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
312 |
Get the subspecification from the current specification" |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
313 |
|
1307 | 314 |
specification notNil ifTrue:[ |
315 |
^ specification class perform:aKey ifNotUnderstood:nil |
|
584
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
316 |
]. |
351914fcc5a4
Define #specificationFor: to fetch subspecifications and
Stefan Vogel <sv@exept.de>
parents:
580
diff
changeset
|
317 |
^ nil |
172 | 318 |
! ! |
319 |
||
320 |
!UISpecificationTool methodsFor:'change & update'! |
|
164 | 321 |
|
172 | 322 |
update |
323 |
"reload specification |
|
164 | 324 |
" |
172 | 325 |
specChannel notNil ifTrue:[ |
326 |
specChannel value:specification. |
|
327 |
] |
|
164 | 328 |
|
329 |
||
330 |
! |
|
331 |
||
332 |
update:something with:someArgument from:someone |
|
333 |
"any attribute changed its state in the current specification |
|
334 |
" |
|
335 |
someone ~~ modifiedHolder ifTrue:[ |
|
893 | 336 |
"/ any in the spec has changed. |
337 |
"/ update my modified holders value |
|
338 |
||
1071 | 339 |
modifiedHolder value:true |
164 | 340 |
] |
341 |
||
893 | 342 |
"Modified: / 16.7.1998 / 19:25:59 / cg" |
164 | 343 |
! ! |
344 |
||
1956 | 345 |
!UISpecificationTool methodsFor:'help'! |
346 |
||
347 |
basicHelpTextForKey:aKey |
|
348 |
"activeHelp interface: return some help text for a key. |
|
349 |
Redefined to ask the current components Spec first." |
|
350 |
||
351 |
|helpText| |
|
352 |
||
353 |
"/ first, ask the spec |
|
354 |
helpText := (specification helpSpec) at:aKey ifAbsent:nil. |
|
355 |
"/ DEBUG: helpText isNil ifTrue:[^ 'No help for key: ', aKey ]. |
|
356 |
||
357 |
helpText isNil ifTrue:[ |
|
358 |
helpText := super basicHelpTextForKey:aKey. |
|
359 |
]. |
|
360 |
"/ DEBUG: ^ aKey , ': ' , helpText |
|
361 |
^ helpText |
|
362 |
! ! |
|
363 |
||
1315 | 364 |
!UISpecificationTool methodsFor:'initialization'! |
365 |
||
366 |
initialize |
|
367 |
super initialize. |
|
368 |
buildInView := BuildInView new. |
|
1573 | 369 |
buildInView keepViews:true. |
1315 | 370 |
! ! |
371 |
||
164 | 372 |
!UISpecificationTool methodsFor:'selection'! |
373 |
||
374 |
selection:something |
|
172 | 375 |
"selection changed |
376 |
" |
|
1307 | 377 |
|slices index spec window| |
164 | 378 |
|
172 | 379 |
specification notNil ifTrue:[ |
380 |
slices := specification class slices. |
|
1307 | 381 |
index := slices findFirst:[:aSlice| aSlice first = something ]. |
164 | 382 |
|
1307 | 383 |
index ~~ 0 ifTrue:[ |
384 |
spec := specification class perform:((slices at:index) last) |
|
428 | 385 |
] |
164 | 386 |
]. |
387 |
||
172 | 388 |
spec ~= selection ifTrue:[ |
1307 | 389 |
(selection := spec) notNil ifTrue:[ |
390 |
listOfSpecViews isNil ifTrue:[ |
|
391 |
listOfSpecViews := Array new:(slices size). |
|
392 |
] ifFalse:[ |
|
393 |
window := listOfSpecViews at:index |
|
394 |
]. |
|
395 |
window isNil ifTrue:[ |
|
396 |
builder buildFromSpec:spec in:(window := SimpleView new). |
|
397 |
listOfSpecViews at:index put:window. |
|
398 |
]. |
|
399 |
]. |
|
1315 | 400 |
buildInView scrolledView:window. |
164 | 401 |
]. |
402 |
! ! |
|
403 |
||
1307 | 404 |
!UISpecificationTool::BuildInView methodsFor:'accessing'! |
759 | 405 |
|
2160 | 406 |
mapped |
407 |
super mapped. |
|
408 |
||
409 |
scrolledView notNil ifTrue:[ |
|
410 |
scrolledView beVisible. |
|
411 |
scrolledView raise. |
|
412 |
]. |
|
413 |
! |
|
414 |
||
1307 | 415 |
scrolledView:aView |
416 |
"set the view to be scrolled" |
|
1573 | 417 |
|wrapper y| |
1307 | 418 |
|
419 |
scrolledView == aView ifTrue:[^ self]. |
|
759 | 420 |
|
2160 | 421 |
scrolledView notNil ifTrue:[ |
422 |
scrolledView unmap. |
|
423 |
]. |
|
424 |
(scrolledView := aView) notNil ifTrue:[ |
|
425 |
scrolledView superView ~~ frame ifTrue:[ |
|
426 |
scrolledView borderWidth:0; level:0. |
|
1307 | 427 |
|
2160 | 428 |
frame addSubView:scrolledView. |
1573 | 429 |
|
2160 | 430 |
scrolledView subViews size == 1 ifTrue:[ |
431 |
wrapper := scrolledView subViews first. |
|
432 |
wrapper isScrollWrapper ifTrue:[ |
|
433 |
"/ give it a full-relative size, and let it do |
|
434 |
"/ the scrolling itself. |
|
435 |
y := 1.0 |
|
436 |
] |
|
437 |
]. |
|
438 |
y isNil ifTrue:[ |
|
2350 | 439 |
y := scrolledView preferredHeight |
2160 | 440 |
]. |
441 |
scrolledView origin:0@0 corner:1.0 @ y. |
|
442 |
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
|
443 |
]. |
2160 | 444 |
]. |
445 |
shown ifTrue:[ |
|
446 |
scrolledView beVisible. |
|
447 |
scrolledView raise. |
|
1307 | 448 |
self sizeChanged:nil. |
449 |
]. |
|
1573 | 450 |
model value:scrolledView. |
759 | 451 |
! ! |
452 |
||
1313 | 453 |
!UISpecificationTool::BuildInView methodsFor:'initialization'! |
454 |
||
455 |
level:aLevel |
|
456 |
super level:0 |
|
457 |
! |
|
458 |
||
459 |
realize |
|
1315 | 460 |
|
1313 | 461 |
super realize. |
462 |
superView notNil ifTrue:[superView level:0]. |
|
463 |
! ! |
|
464 |
||
164 | 465 |
!UISpecificationTool class methodsFor:'documentation'! |
466 |
||
467 |
version |
|
468 |
^ '$Header$' |
|
469 |
! ! |