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