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