56
|
1 |
ApplicationModel subclass:#UIPropertyView
|
111
|
2 |
instanceVariableNames:'window specClass aspects modified modifiedHolder'
|
56
|
3 |
classVariableNames:''
|
|
4 |
poolDictionaries:''
|
|
5 |
category:'Interface-UIPainter'
|
|
6 |
!
|
|
7 |
|
140
|
8 |
UIPropertyView subclass:#Dimension
|
|
9 |
instanceVariableNames:'noteBook forView selection layoutTypes'
|
111
|
10 |
classVariableNames:''
|
|
11 |
poolDictionaries:''
|
|
12 |
privateIn:UIPropertyView
|
|
13 |
!
|
|
14 |
|
140
|
15 |
UIPropertyView subclass:#Specification
|
|
16 |
instanceVariableNames:'specEdited specChannel'
|
111
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
privateIn:UIPropertyView
|
|
20 |
!
|
|
21 |
|
|
22 |
!UIPropertyView class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
documentation
|
|
25 |
"
|
126
|
26 |
provides tools to the UIPainter accessing and manipulation properties
|
|
27 |
and/or layouts.
|
|
28 |
|
|
29 |
[see also:]
|
|
30 |
UIBuilder
|
111
|
31 |
"
|
|
32 |
|
|
33 |
! !
|
56
|
34 |
|
|
35 |
!UIPropertyView class methodsFor:'instance creation'!
|
|
36 |
|
111
|
37 |
for:aTool in:aTopview
|
|
38 |
|cls appl|
|
|
39 |
|
|
40 |
cls := Smalltalk classNamed:(self name asString, '::', aTool asString).
|
|
41 |
appl := cls new.
|
|
42 |
appl origin:0.0@0.0 corner:1.0@1.0 in:aTopview.
|
|
43 |
^ appl
|
|
44 |
!
|
|
45 |
|
|
46 |
in:aTopview
|
|
47 |
|appl|
|
|
48 |
|
|
49 |
appl := self new.
|
|
50 |
appl origin:0.0@0.0 corner:1.0@1.0 in:aTopview.
|
|
51 |
^ appl
|
|
52 |
! !
|
|
53 |
|
|
54 |
!UIPropertyView methodsFor:'accessing'!
|
|
55 |
|
|
56 |
buildFromSpec:aSpec
|
144
|
57 |
|state subViews backGroundColor v|
|
111
|
58 |
|
|
59 |
aSpec ~= specClass ifTrue:[
|
|
60 |
window destroySubViews.
|
|
61 |
|
|
62 |
aSpec notNil ifTrue:[
|
144
|
63 |
v := builder buildFromSpec:aSpec in:window.
|
111
|
64 |
window allViewBackground:(self viewBackground).
|
144
|
65 |
window realizeAllSubViews.
|
111
|
66 |
]
|
|
67 |
].
|
|
68 |
specClass := aSpec.
|
|
69 |
self modified:false
|
|
70 |
|
|
71 |
!
|
56
|
72 |
|
111
|
73 |
modified
|
|
74 |
"returns modifying state
|
|
75 |
"
|
|
76 |
^ modified
|
|
77 |
!
|
|
78 |
|
|
79 |
modified:aState
|
|
80 |
"set modifying state
|
|
81 |
"
|
|
82 |
modified := aState.
|
|
83 |
|
|
84 |
modifiedHolder notNil ifTrue:[
|
|
85 |
modifiedHolder value ~~ modified ifTrue:[
|
|
86 |
modifiedHolder value:modified
|
|
87 |
]
|
|
88 |
]
|
|
89 |
!
|
|
90 |
|
|
91 |
modifiedHolder
|
|
92 |
"returns the value holder set to true in case of modifying attributes
|
|
93 |
"
|
|
94 |
^ modifiedHolder
|
|
95 |
!
|
|
96 |
|
|
97 |
modifiedHolder:aValueHolder
|
|
98 |
"set the value holder set to true in case of modifying attributes
|
|
99 |
"
|
|
100 |
modifiedHolder notNil ifTrue:[
|
|
101 |
modifiedHolder removeDependent:self.
|
|
102 |
].
|
|
103 |
|
|
104 |
(modifiedHolder := aValueHolder) notNil ifTrue:[
|
|
105 |
modifiedHolder addDependent:self.
|
|
106 |
modifiedHolder setValue:modified.
|
|
107 |
].
|
56
|
108 |
! !
|
|
109 |
|
111
|
110 |
!UIPropertyView methodsFor:'accessing hierarchy'!
|
|
111 |
|
|
112 |
lower
|
|
113 |
"bring window to back
|
|
114 |
"
|
|
115 |
self window back
|
|
116 |
!
|
59
|
117 |
|
111
|
118 |
raise
|
|
119 |
"bring window to front
|
|
120 |
"
|
|
121 |
self window raise
|
|
122 |
!
|
|
123 |
|
|
124 |
viewBackground
|
|
125 |
^ window viewBackground
|
|
126 |
!
|
|
127 |
|
|
128 |
viewBackground:aColor
|
|
129 |
window viewBackground:aColor
|
|
130 |
!
|
|
131 |
|
|
132 |
window
|
|
133 |
"returns window application is running in
|
|
134 |
"
|
|
135 |
^ window
|
59
|
136 |
! !
|
|
137 |
|
111
|
138 |
!UIPropertyView methodsFor:'bindings'!
|
|
139 |
|
|
140 |
aspectFor:aKey
|
|
141 |
"returns aspect for a key or nil
|
|
142 |
"
|
|
143 |
aspects notNil ifTrue:[
|
|
144 |
^ aspects at:aKey ifAbsent:nil
|
|
145 |
].
|
|
146 |
^ super aspectFor:aKey
|
|
147 |
|
|
148 |
!
|
|
149 |
|
|
150 |
aspects
|
|
151 |
"returned monitored aspects
|
|
152 |
"
|
|
153 |
^ aspects
|
|
154 |
!
|
|
155 |
|
|
156 |
aspects:aListOfAspects
|
|
157 |
"set aspects to be monitored
|
|
158 |
"
|
|
159 |
(aspects := aListOfAspects) notNil ifTrue:[
|
|
160 |
aspects do:[:el | el addDependent:self ].
|
|
161 |
].
|
|
162 |
self modified:false.
|
|
163 |
! !
|
|
164 |
|
|
165 |
!UIPropertyView methodsFor:'change & update'!
|
|
166 |
|
|
167 |
update:something with:someArgument from:someone
|
|
168 |
"any attribute changed its state in the current specification
|
|
169 |
"
|
|
170 |
someone == modifiedHolder ifTrue:[
|
|
171 |
modified := modifiedHolder value
|
|
172 |
] ifFalse:[
|
|
173 |
self modified:true
|
|
174 |
]
|
|
175 |
! !
|
|
176 |
|
|
177 |
!UIPropertyView methodsFor:'initialization'!
|
|
178 |
|
|
179 |
closeRequest
|
149
|
180 |
|
111
|
181 |
modifiedHolder notNil ifTrue:[
|
|
182 |
modifiedHolder removeDependent:self.
|
|
183 |
modifiedHolder := nil.
|
|
184 |
].
|
|
185 |
|
|
186 |
super closeRequest
|
|
187 |
|
|
188 |
|
|
189 |
!
|
|
190 |
|
|
191 |
initialize
|
|
192 |
super initialize.
|
|
193 |
modified := false.
|
|
194 |
!
|
|
195 |
|
|
196 |
origin:anOrigin corner:aCorner in:aTopview
|
|
197 |
window := SimpleView origin:anOrigin corner:aCorner in:aTopview
|
|
198 |
|
|
199 |
! !
|
|
200 |
|
|
201 |
!UIPropertyView::Dimension class methodsFor:'interface specs'!
|
56
|
202 |
|
|
203 |
specificationAlignmentOrigin
|
62
|
204 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
205 |
|
|
206 |
"do not manually edit this - the painter/builder may not be able to
|
|
207 |
handle the specification if its corrupted."
|
|
208 |
|
56
|
209 |
"
|
111
|
210 |
UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationAlignmentOrigin
|
|
211 |
UIPropertyView::Dimension new openInterface:#specificationAlignmentOrigin
|
56
|
212 |
"
|
62
|
213 |
|
56
|
214 |
<resource: #canvas>
|
|
215 |
|
|
216 |
^
|
140
|
217 |
|
56
|
218 |
#(#FullSpec
|
|
219 |
#'window:'
|
|
220 |
#(#WindowSpec
|
62
|
221 |
#'name:' 'uIPainterView'
|
56
|
222 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
223 |
#'label:' 'unnamed'
|
78
|
224 |
#'bounds:' #(#Rectangle 0 0 250 365)
|
56
|
225 |
)
|
|
226 |
#'component:'
|
|
227 |
#(#SpecCollection
|
|
228 |
#'collection:'
|
|
229 |
#(
|
|
230 |
#(#LabelSpec
|
|
231 |
#'name:' 'label2'
|
111
|
232 |
#'layout:' #(#AlignmentOrigin 49 0 68 0 1 0)
|
56
|
233 |
#'label:' 'top'
|
66
|
234 |
#'adjust:' #right
|
56
|
235 |
)
|
|
236 |
#(#LabelSpec
|
|
237 |
#'name:' 'label3'
|
111
|
238 |
#'layout:' #(#Point 58 13)
|
56
|
239 |
#'label:' 'relative'
|
|
240 |
)
|
|
241 |
#(#LabelSpec
|
|
242 |
#'name:' 'label4'
|
111
|
243 |
#'layout:' #(#Point 154 14)
|
56
|
244 |
#'label:' 'offset'
|
|
245 |
)
|
|
246 |
#(#LabelSpec
|
|
247 |
#'name:' 'label5'
|
111
|
248 |
#'layout:' #(#AlignmentOrigin 63 0 140 0 1 0)
|
56
|
249 |
#'label:' 'align H'
|
66
|
250 |
#'adjust:' #right
|
56
|
251 |
)
|
|
252 |
#(#LabelSpec
|
|
253 |
#'name:' 'label6'
|
111
|
254 |
#'layout:' #(#AlignmentOrigin 63 0 166 0 1 0)
|
56
|
255 |
#'label:' 'align V'
|
66
|
256 |
#'adjust:' #right
|
56
|
257 |
)
|
|
258 |
#(#InputFieldSpec
|
|
259 |
#'name:' 'editField1'
|
111
|
260 |
#'layout:' #(#LayoutFrame 58 0 41 0 115 0 59 0)
|
62
|
261 |
#'model:' #leftFraction
|
|
262 |
#'tabable:' true
|
56
|
263 |
#'type:' #numberOrNil
|
|
264 |
)
|
|
265 |
#(#InputFieldSpec
|
|
266 |
#'name:' 'editField2'
|
111
|
267 |
#'layout:' #(#LayoutFrame 58 0 68 0 115 0 86 0)
|
62
|
268 |
#'model:' #topFraction
|
|
269 |
#'tabable:' true
|
56
|
270 |
#'type:' #numberOrNil
|
|
271 |
)
|
|
272 |
#(#InputFieldSpec
|
|
273 |
#'name:' 'editField5'
|
111
|
274 |
#'layout:' #(#LayoutFrame 68 0 140 0 125 0 158 0)
|
62
|
275 |
#'model:' #leftAlignmentFraction
|
|
276 |
#'tabable:' true
|
56
|
277 |
#'type:' #numberOrNil
|
|
278 |
)
|
|
279 |
#(#InputFieldSpec
|
|
280 |
#'name:' 'editField6'
|
111
|
281 |
#'layout:' #(#LayoutFrame 68 0 166 0 125 0 184 0)
|
62
|
282 |
#'model:' #topAlignmentFraction
|
|
283 |
#'tabable:' true
|
56
|
284 |
#'type:' #numberOrNil
|
|
285 |
)
|
|
286 |
#(#InputFieldSpec
|
|
287 |
#'name:' 'editField3'
|
111
|
288 |
#'layout:' #(#LayoutFrame 154 0 41 0 212 0 59 0)
|
62
|
289 |
#'model:' #leftOffset
|
|
290 |
#'tabable:' true
|
56
|
291 |
#'type:' #numberOrNil
|
|
292 |
)
|
|
293 |
#(#InputFieldSpec
|
|
294 |
#'name:' 'editField4'
|
111
|
295 |
#'layout:' #(#LayoutFrame 154 0 68 0 212 0 86 0)
|
62
|
296 |
#'model:' #topOffset
|
|
297 |
#'tabable:' true
|
56
|
298 |
#'type:' #numberOrNil
|
|
299 |
)
|
|
300 |
#(#ActionButtonSpec
|
|
301 |
#'name:' 'button1'
|
111
|
302 |
#'layout:' #(#LayoutFrame 119 0 41 0 138 0 59 0)
|
56
|
303 |
#'label:' ''
|
|
304 |
#'model:' #makeRelativeLeft
|
111
|
305 |
#'isTriggerOnDown:' false
|
|
306 |
#'autoRepeat:' false
|
56
|
307 |
)
|
|
308 |
#(#ActionButtonSpec
|
|
309 |
#'name:' 'button2'
|
111
|
310 |
#'layout:' #(#LayoutFrame 119 0 68 0 138 0 86 0)
|
56
|
311 |
#'label:' ''
|
|
312 |
#'model:' #makeRelativeTop
|
111
|
313 |
#'isTriggerOnDown:' false
|
|
314 |
#'autoRepeat:' false
|
56
|
315 |
)
|
|
316 |
#(#ActionButtonSpec
|
|
317 |
#'name:' 'button3'
|
111
|
318 |
#'layout:' #(#LayoutFrame 217 0 41 0 236 0 59 0)
|
56
|
319 |
#'label:' ''
|
|
320 |
#'model:' #makeOffsetLeft
|
111
|
321 |
#'isTriggerOnDown:' false
|
|
322 |
#'autoRepeat:' false
|
56
|
323 |
)
|
|
324 |
#(#ActionButtonSpec
|
|
325 |
#'name:' 'button4'
|
111
|
326 |
#'layout:' #(#LayoutFrame 217 0 68 0 236 0 86 0)
|
56
|
327 |
#'label:' ''
|
|
328 |
#'model:' #makeOffsetTop
|
111
|
329 |
#'isTriggerOnDown:' false
|
|
330 |
#'autoRepeat:' false
|
56
|
331 |
)
|
62
|
332 |
#(#ActionButtonSpec
|
|
333 |
#'name:' 'button8'
|
111
|
334 |
#'layout:' #(#LayoutFrame 119 0 102 0 138 0 120 0)
|
62
|
335 |
#'label:' ''
|
|
336 |
#'model:' #makeRelativeLeftTop
|
111
|
337 |
#'isTriggerOnDown:' false
|
|
338 |
#'autoRepeat:' false
|
56
|
339 |
)
|
62
|
340 |
#(#ActionButtonSpec
|
|
341 |
#'name:' 'button9'
|
111
|
342 |
#'layout:' #(#LayoutFrame 217 0 102 0 236 0 120 0)
|
62
|
343 |
#'label:' ''
|
|
344 |
#'model:' #makeOffsetLeftTop
|
111
|
345 |
#'isTriggerOnDown:' false
|
|
346 |
#'autoRepeat:' false
|
56
|
347 |
)
|
62
|
348 |
#(#LabelSpec
|
|
349 |
#'name:' 'label7'
|
111
|
350 |
#'layout:' #(#AlignmentOrigin 49 0 102 0 1 0)
|
62
|
351 |
#'label:' 'all'
|
66
|
352 |
#'adjust:' #right
|
56
|
353 |
)
|
62
|
354 |
#(#LabelSpec
|
|
355 |
#'name:' 'label1'
|
111
|
356 |
#'layout:' #(#AlignmentOrigin 49 0 41 0 1 0)
|
62
|
357 |
#'label:' 'left'
|
66
|
358 |
#'adjust:' #right
|
62
|
359 |
)
|
68
|
360 |
#(#DividerSpec
|
|
361 |
#'name:' 'separator1'
|
111
|
362 |
#'layout:' #(#Rectangle 154 142 203 153)
|
78
|
363 |
#'orientation:' #horizontal
|
68
|
364 |
)
|
|
365 |
#(#DividerSpec
|
|
366 |
#'name:' 'separator2'
|
111
|
367 |
#'layout:' #(#Rectangle 154 173 203 184)
|
78
|
368 |
#'orientation:' #horizontal
|
68
|
369 |
)
|
|
370 |
#(#DividerSpec
|
|
371 |
#'name:' 'separator3'
|
111
|
372 |
#'layout:' #(#Rectangle 145 152 155 173)
|
68
|
373 |
#'orientation:' #vertical
|
|
374 |
)
|
|
375 |
#(#DividerSpec
|
|
376 |
#'name:' 'separator4'
|
111
|
377 |
#'layout:' #(#Rectangle 203 152 213 173)
|
68
|
378 |
#'orientation:' #vertical
|
|
379 |
)
|
|
380 |
#(#ActionButtonSpec
|
|
381 |
#'name:' 'alignBR'
|
111
|
382 |
#'layout:' #(#Rectangle 201 172 213 184)
|
68
|
383 |
#'label:' ''
|
|
384 |
#'model:' #makeAlignBottomRight
|
111
|
385 |
#'isTriggerOnDown:' false
|
|
386 |
#'autoRepeat:' false
|
68
|
387 |
)
|
|
388 |
#(#ActionButtonSpec
|
|
389 |
#'name:' 'alignTL'
|
111
|
390 |
#'layout:' #(#Rectangle 145 141 157 153)
|
68
|
391 |
#'label:' ''
|
|
392 |
#'model:' #makeAlignTopLeft
|
111
|
393 |
#'isTriggerOnDown:' false
|
|
394 |
#'autoRepeat:' false
|
68
|
395 |
)
|
|
396 |
#(#ActionButtonSpec
|
|
397 |
#'name:' 'alignTR'
|
111
|
398 |
#'layout:' #(#Rectangle 201 141 213 153)
|
68
|
399 |
#'label:' ''
|
|
400 |
#'model:' #makeAlignTopRight
|
111
|
401 |
#'isTriggerOnDown:' false
|
|
402 |
#'autoRepeat:' false
|
68
|
403 |
)
|
|
404 |
#(#ActionButtonSpec
|
|
405 |
#'name:' 'alignBL'
|
111
|
406 |
#'layout:' #(#Rectangle 145 171 157 183)
|
68
|
407 |
#'label:' ''
|
|
408 |
#'model:' #makeAlignBottomLeft
|
111
|
409 |
#'isTriggerOnDown:' false
|
|
410 |
#'autoRepeat:' false
|
68
|
411 |
)
|
|
412 |
#(#ActionButtonSpec
|
|
413 |
#'name:' 'alignTC'
|
111
|
414 |
#'layout:' #(#Rectangle 173 141 185 153)
|
68
|
415 |
#'label:' ''
|
|
416 |
#'model:' #makeAlignTopCenter
|
111
|
417 |
#'isTriggerOnDown:' false
|
|
418 |
#'autoRepeat:' false
|
68
|
419 |
)
|
|
420 |
#(#ActionButtonSpec
|
|
421 |
#'name:' 'alignBC'
|
111
|
422 |
#'layout:' #(#Rectangle 173 172 185 184)
|
68
|
423 |
#'label:' ''
|
|
424 |
#'model:' #makeAlignBottomCenter
|
111
|
425 |
#'isTriggerOnDown:' false
|
|
426 |
#'autoRepeat:' false
|
68
|
427 |
)
|
|
428 |
#(#ActionButtonSpec
|
|
429 |
#'name:' 'alignLC'
|
111
|
430 |
#'layout:' #(#Rectangle 145 156 157 168)
|
68
|
431 |
#'label:' ''
|
|
432 |
#'model:' #makeAlignLeftCenter
|
111
|
433 |
#'isTriggerOnDown:' false
|
|
434 |
#'autoRepeat:' false
|
68
|
435 |
)
|
|
436 |
#(#ActionButtonSpec
|
|
437 |
#'name:' 'alignRC'
|
111
|
438 |
#'layout:' #(#Rectangle 201 156 213 168)
|
68
|
439 |
#'label:' ''
|
|
440 |
#'model:' #makeAlignRightCenter
|
111
|
441 |
#'isTriggerOnDown:' false
|
|
442 |
#'autoRepeat:' false
|
68
|
443 |
)
|
|
444 |
#(#ActionButtonSpec
|
|
445 |
#'name:' 'alignC'
|
111
|
446 |
#'layout:' #(#Rectangle 173 156 185 168)
|
68
|
447 |
#'label:' ''
|
|
448 |
#'model:' #makeAlignCenter
|
111
|
449 |
#'isTriggerOnDown:' false
|
|
450 |
#'autoRepeat:' false
|
68
|
451 |
)
|
56
|
452 |
)
|
|
453 |
)
|
|
454 |
)
|
|
455 |
!
|
|
456 |
|
62
|
457 |
specificationExtent
|
|
458 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
459 |
|
|
460 |
"do not manually edit this - the painter/builder may not be able to
|
|
461 |
handle the specification if its corrupted."
|
|
462 |
|
56
|
463 |
"
|
111
|
464 |
UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationExtent
|
|
465 |
UIPropertyView::Dimension new openInterface:#specificationExtent
|
56
|
466 |
"
|
62
|
467 |
|
56
|
468 |
<resource: #canvas>
|
|
469 |
|
|
470 |
^
|
140
|
471 |
|
56
|
472 |
#(#FullSpec
|
|
473 |
#'window:'
|
|
474 |
#(#WindowSpec
|
62
|
475 |
#'name:' 'uIPainterView'
|
56
|
476 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
477 |
#'label:' 'unnamed'
|
111
|
478 |
#'bounds:' #(#Rectangle 0 0 224 251)
|
56
|
479 |
)
|
|
480 |
#'component:'
|
|
481 |
#(#SpecCollection
|
|
482 |
#'collection:'
|
|
483 |
#(
|
|
484 |
#(#LabelSpec
|
|
485 |
#'name:' 'label1'
|
111
|
486 |
#'layout:' #(#AlignmentOrigin 99 0 45 0 1 0)
|
62
|
487 |
#'label:' 'horizontal:'
|
|
488 |
#'adjust:' #left
|
56
|
489 |
)
|
|
490 |
#(#LabelSpec
|
|
491 |
#'name:' 'label2'
|
111
|
492 |
#'layout:' #(#AlignmentOrigin 99 0 72 0 1 0)
|
62
|
493 |
#'label:' 'vertical:'
|
|
494 |
#'adjust:' #left
|
56
|
495 |
)
|
|
496 |
#(#InputFieldSpec
|
|
497 |
#'name:' 'editField1'
|
111
|
498 |
#'layout:' #(#LayoutFrame 104 0 45 0 197 0 63 0)
|
62
|
499 |
#'model:' #leftOffset
|
|
500 |
#'tabable:' true
|
56
|
501 |
#'type:' #numberOrNil
|
|
502 |
)
|
|
503 |
#(#InputFieldSpec
|
|
504 |
#'name:' 'editField2'
|
111
|
505 |
#'layout:' #(#LayoutFrame 104 0 72 0 197 0 90 0)
|
62
|
506 |
#'model:' #rightOffset
|
|
507 |
#'tabable:' true
|
56
|
508 |
#'type:' #numberOrNil
|
62
|
509 |
)
|
111
|
510 |
#(#LabelSpec
|
|
511 |
#'name:' 'extentLabel'
|
|
512 |
#'layout:' #(#LayoutFrame 9 0 20 0 63 0 37 0)
|
|
513 |
#'label:' 'Extent:'
|
|
514 |
)
|
62
|
515 |
)
|
|
516 |
)
|
|
517 |
)
|
|
518 |
!
|
|
519 |
|
|
520 |
specificationLayoutFrame
|
|
521 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
522 |
|
|
523 |
"do not manually edit this - the painter/builder may not be able to
|
|
524 |
handle the specification if its corrupted."
|
|
525 |
|
|
526 |
"
|
111
|
527 |
UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationLayoutFrame
|
|
528 |
UIPropertyView::Dimension new openInterface:#specificationLayoutFrame
|
62
|
529 |
"
|
|
530 |
|
|
531 |
<resource: #canvas>
|
|
532 |
|
|
533 |
^
|
140
|
534 |
|
62
|
535 |
#(#FullSpec
|
|
536 |
#'window:'
|
|
537 |
#(#WindowSpec
|
|
538 |
#'name:' 'uIPainterView'
|
|
539 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
540 |
#'label:' 'unnamed'
|
|
541 |
#'bounds:' #(#Rectangle 0 0 238 291)
|
|
542 |
)
|
|
543 |
#'component:'
|
|
544 |
#(#SpecCollection
|
|
545 |
#'collection:'
|
|
546 |
#(
|
|
547 |
#(#LabelSpec
|
|
548 |
#'name:' 'label left'
|
111
|
549 |
#'layout:' #(#AlignmentOrigin 60 0 43 0 1 0)
|
62
|
550 |
#'label:' 'left'
|
|
551 |
)
|
|
552 |
#(#LabelSpec
|
|
553 |
#'name:' 'label top'
|
111
|
554 |
#'layout:' #(#AlignmentOrigin 60 0 71 0 1 0)
|
62
|
555 |
#'label:' 'top'
|
|
556 |
)
|
|
557 |
#(#LabelSpec
|
|
558 |
#'name:' 'label right'
|
111
|
559 |
#'layout:' #(#AlignmentOrigin 60 0 99 0 1 0)
|
62
|
560 |
#'label:' 'right'
|
|
561 |
)
|
|
562 |
#(#LabelSpec
|
|
563 |
#'name:' 'label bottom'
|
111
|
564 |
#'layout:' #(#AlignmentOrigin 60 0 127 0 1 0)
|
62
|
565 |
#'label:' 'bottom'
|
|
566 |
)
|
|
567 |
#(#LabelSpec
|
|
568 |
#'name:' 'label relative'
|
111
|
569 |
#'layout:' #(#Point 65 14)
|
62
|
570 |
#'label:' 'relative'
|
|
571 |
)
|
|
572 |
#(#LabelSpec
|
|
573 |
#'name:' 'label offset'
|
111
|
574 |
#'layout:' #(#Point 159 14)
|
62
|
575 |
#'label:' 'offset'
|
|
576 |
)
|
|
577 |
#(#LabelSpec
|
|
578 |
#'name:' 'label all relative'
|
111
|
579 |
#'layout:' #(#AlignmentOrigin 60 0 161 0 1 0)
|
62
|
580 |
#'label:' 'all'
|
|
581 |
)
|
|
582 |
#(#InputFieldSpec
|
|
583 |
#'name:' 'relative E1'
|
111
|
584 |
#'layout:' #(#LayoutFrame 65 0 43 0 113 0 61 0)
|
62
|
585 |
#'model:' #leftFraction
|
|
586 |
#'type:' #numberOrNil
|
|
587 |
)
|
|
588 |
#(#InputFieldSpec
|
|
589 |
#'name:' 'relative E2'
|
111
|
590 |
#'layout:' #(#LayoutFrame 65 0 71 0 113 0 89 0)
|
56
|
591 |
#'model:' #topFraction
|
62
|
592 |
#'type:' #numberOrNil
|
|
593 |
)
|
|
594 |
#(#InputFieldSpec
|
|
595 |
#'name:' 'relative E3'
|
111
|
596 |
#'layout:' #(#LayoutFrame 65 0 99 0 113 0 117 0)
|
62
|
597 |
#'model:' #rightFraction
|
|
598 |
#'type:' #numberOrNil
|
|
599 |
)
|
|
600 |
#(#InputFieldSpec
|
|
601 |
#'name:' 'relative E4'
|
111
|
602 |
#'layout:' #(#LayoutFrame 65 0 127 0 113 0 145 0)
|
62
|
603 |
#'model:' #bottomFraction
|
|
604 |
#'type:' #numberOrNil
|
|
605 |
)
|
|
606 |
#(#InputFieldSpec
|
|
607 |
#'name:' 'offset E1'
|
111
|
608 |
#'layout:' #(#LayoutFrame 159 0 43 0 210 0 61 0)
|
62
|
609 |
#'model:' #leftOffset
|
|
610 |
#'type:' #numberOrNil
|
|
611 |
)
|
|
612 |
#(#InputFieldSpec
|
|
613 |
#'name:' 'offset E2'
|
111
|
614 |
#'layout:' #(#LayoutFrame 159 0 71 0 210 0 89 0)
|
62
|
615 |
#'model:' #topOffset
|
|
616 |
#'type:' #numberOrNil
|
|
617 |
)
|
|
618 |
#(#InputFieldSpec
|
|
619 |
#'name:' 'offset E3'
|
111
|
620 |
#'layout:' #(#LayoutFrame 159 0 99 0 210 0 117 0)
|
62
|
621 |
#'model:' #rightOffset
|
|
622 |
#'type:' #numberOrNil
|
|
623 |
)
|
|
624 |
#(#InputFieldSpec
|
|
625 |
#'name:' 'offset E4'
|
111
|
626 |
#'layout:' #(#LayoutFrame 159 0 127 0 210 0 145 0)
|
62
|
627 |
#'model:' #bottomOffset
|
|
628 |
#'type:' #numberOrNil
|
|
629 |
)
|
|
630 |
#(#ActionButtonSpec
|
|
631 |
#'name:' 'relative B1'
|
111
|
632 |
#'layout:' #(#LayoutFrame 117 0 43 0 136 0 61 0)
|
62
|
633 |
#'label:' ' '
|
|
634 |
#'model:' #makeRelativeLeft
|
111
|
635 |
#'isTriggerOnDown:' false
|
|
636 |
#'autoRepeat:' false
|
62
|
637 |
)
|
|
638 |
#(#ActionButtonSpec
|
|
639 |
#'name:' 'relative B2'
|
111
|
640 |
#'layout:' #(#LayoutFrame 117 0 71 0 136 0 89 0)
|
62
|
641 |
#'label:' ' '
|
|
642 |
#'model:' #makeRelativeTop
|
111
|
643 |
#'isTriggerOnDown:' false
|
|
644 |
#'autoRepeat:' false
|
62
|
645 |
)
|
|
646 |
#(#ActionButtonSpec
|
|
647 |
#'name:' 'relative B3'
|
111
|
648 |
#'layout:' #(#LayoutFrame 117 0 99 0 136 0 117 0)
|
62
|
649 |
#'label:' ' '
|
|
650 |
#'model:' #makeRelativeRight
|
111
|
651 |
#'isTriggerOnDown:' false
|
|
652 |
#'autoRepeat:' false
|
62
|
653 |
)
|
|
654 |
#(#ActionButtonSpec
|
|
655 |
#'name:' 'relative B4'
|
111
|
656 |
#'layout:' #(#LayoutFrame 117 0 127 0 136 0 145 0)
|
62
|
657 |
#'label:' ' '
|
|
658 |
#'model:' #makeRelativeBottom
|
111
|
659 |
#'isTriggerOnDown:' false
|
|
660 |
#'autoRepeat:' false
|
62
|
661 |
)
|
|
662 |
#(#ActionButtonSpec
|
|
663 |
#'name:' 'relative BAll'
|
111
|
664 |
#'layout:' #(#LayoutFrame 117 0 161 0 136 0 179 0)
|
62
|
665 |
#'label:' ' '
|
|
666 |
#'model:' #makeRelativeAll
|
111
|
667 |
#'isTriggerOnDown:' false
|
|
668 |
#'autoRepeat:' false
|
62
|
669 |
)
|
|
670 |
#(#ActionButtonSpec
|
|
671 |
#'name:' 'offset B1'
|
111
|
672 |
#'layout:' #(#LayoutFrame 214 0 43 0 233 0 61 0)
|
62
|
673 |
#'label:' ''
|
|
674 |
#'model:' #makeOffsetLeft
|
111
|
675 |
#'isTriggerOnDown:' false
|
|
676 |
#'autoRepeat:' false
|
62
|
677 |
)
|
|
678 |
#(#ActionButtonSpec
|
|
679 |
#'name:' 'offset B2'
|
111
|
680 |
#'layout:' #(#LayoutFrame 214 0 71 0 233 0 89 0)
|
62
|
681 |
#'label:' ''
|
|
682 |
#'model:' #makeOffsetTop
|
111
|
683 |
#'isTriggerOnDown:' false
|
|
684 |
#'autoRepeat:' false
|
62
|
685 |
)
|
|
686 |
#(#ActionButtonSpec
|
|
687 |
#'name:' 'offset B3'
|
111
|
688 |
#'layout:' #(#LayoutFrame 214 0 99 0 233 0 117 0)
|
62
|
689 |
#'label:' ''
|
|
690 |
#'model:' #makeOffsetRight
|
111
|
691 |
#'isTriggerOnDown:' false
|
|
692 |
#'autoRepeat:' false
|
62
|
693 |
)
|
|
694 |
#(#ActionButtonSpec
|
|
695 |
#'name:' 'offset B4'
|
111
|
696 |
#'layout:' #(#LayoutFrame 214 0 127 0 233 0 145 0)
|
62
|
697 |
#'label:' ''
|
|
698 |
#'model:' #makeOffsetBottom
|
111
|
699 |
#'isTriggerOnDown:' false
|
|
700 |
#'autoRepeat:' false
|
62
|
701 |
)
|
|
702 |
#(#ActionButtonSpec
|
|
703 |
#'name:' 'offset BAll'
|
111
|
704 |
#'layout:' #(#LayoutFrame 214 0 161 0 233 0 179 0)
|
62
|
705 |
#'label:' ' '
|
|
706 |
#'model:' #makeOffsetAll
|
111
|
707 |
#'isTriggerOnDown:' false
|
|
708 |
#'autoRepeat:' false
|
62
|
709 |
)
|
|
710 |
)
|
|
711 |
)
|
|
712 |
)
|
|
713 |
!
|
|
714 |
|
|
715 |
specificationLayoutOrigin
|
|
716 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
717 |
|
|
718 |
"do not manually edit this - the painter/builder may not be able to
|
|
719 |
handle the specification if its corrupted."
|
|
720 |
|
|
721 |
"
|
111
|
722 |
UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationLayoutOrigin
|
|
723 |
UIPropertyView::Dimension new openInterface:#specificationLayoutOrigin
|
62
|
724 |
"
|
|
725 |
|
|
726 |
<resource: #canvas>
|
|
727 |
|
|
728 |
^
|
140
|
729 |
|
62
|
730 |
#(#FullSpec
|
|
731 |
#'window:'
|
|
732 |
#(#WindowSpec
|
|
733 |
#'name:' 'uIPainterView'
|
|
734 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
735 |
#'label:' 'unnamed'
|
|
736 |
#'bounds:' #(#Rectangle 0 0 238 303)
|
|
737 |
)
|
|
738 |
#'component:'
|
|
739 |
#(#SpecCollection
|
|
740 |
#'collection:'
|
|
741 |
#(
|
|
742 |
#(#LabelSpec
|
|
743 |
#'name:' 'label1'
|
111
|
744 |
#'layout:' #(#AlignmentOrigin 52 0 44 0 1 0)
|
62
|
745 |
#'label:' 'left'
|
|
746 |
)
|
|
747 |
#(#LabelSpec
|
|
748 |
#'name:' 'label2'
|
111
|
749 |
#'layout:' #(#AlignmentOrigin 52 0 71 0 1 0)
|
62
|
750 |
#'label:' 'top'
|
|
751 |
)
|
|
752 |
#(#LabelSpec
|
|
753 |
#'name:' 'label3'
|
111
|
754 |
#'layout:' #(#Point 57 12)
|
62
|
755 |
#'label:' 'relative'
|
|
756 |
)
|
|
757 |
#(#LabelSpec
|
|
758 |
#'name:' 'label4'
|
111
|
759 |
#'layout:' #(#Point 154 13)
|
62
|
760 |
#'label:' 'offset'
|
|
761 |
)
|
|
762 |
#(#InputFieldSpec
|
|
763 |
#'name:' 'editField1'
|
111
|
764 |
#'layout:' #(#LayoutFrame 57 0 44 0 114 0 62 0)
|
62
|
765 |
#'model:' #leftFraction
|
|
766 |
#'tabable:' true
|
|
767 |
#'type:' #numberOrNil
|
|
768 |
)
|
|
769 |
#(#InputFieldSpec
|
|
770 |
#'name:' 'editField2'
|
111
|
771 |
#'layout:' #(#LayoutFrame 57 0 71 0 114 0 89 0)
|
62
|
772 |
#'model:' #topFraction
|
|
773 |
#'tabable:' true
|
|
774 |
#'type:' #numberOrNil
|
56
|
775 |
)
|
|
776 |
#(#InputFieldSpec
|
|
777 |
#'name:' 'editField3'
|
111
|
778 |
#'layout:' #(#LayoutFrame 154 0 44 0 212 0 62 0)
|
62
|
779 |
#'model:' #leftOffset
|
|
780 |
#'tabable:' true
|
56
|
781 |
#'type:' #numberOrNil
|
|
782 |
)
|
|
783 |
#(#InputFieldSpec
|
|
784 |
#'name:' 'editField4'
|
111
|
785 |
#'layout:' #(#LayoutFrame 154 0 71 0 212 0 89 0)
|
62
|
786 |
#'model:' #topOffset
|
|
787 |
#'tabable:' true
|
56
|
788 |
#'type:' #numberOrNil
|
|
789 |
)
|
|
790 |
#(#ActionButtonSpec
|
|
791 |
#'name:' 'button1'
|
111
|
792 |
#'layout:' #(#LayoutFrame 119 0 44 0 138 0 62 0)
|
56
|
793 |
#'label:' ''
|
|
794 |
#'model:' #makeRelativeLeft
|
111
|
795 |
#'isTriggerOnDown:' false
|
|
796 |
#'autoRepeat:' false
|
56
|
797 |
)
|
|
798 |
#(#ActionButtonSpec
|
|
799 |
#'name:' 'button2'
|
111
|
800 |
#'layout:' #(#LayoutFrame 119 0 71 0 138 0 89 0)
|
56
|
801 |
#'label:' ''
|
|
802 |
#'model:' #makeRelativeTop
|
111
|
803 |
#'isTriggerOnDown:' false
|
|
804 |
#'autoRepeat:' false
|
56
|
805 |
)
|
|
806 |
#(#ActionButtonSpec
|
|
807 |
#'name:' 'button3'
|
111
|
808 |
#'layout:' #(#LayoutFrame 216 0 44 0 235 0 62 0)
|
56
|
809 |
#'label:' ''
|
|
810 |
#'model:' #makeOffsetLeft
|
111
|
811 |
#'isTriggerOnDown:' false
|
|
812 |
#'autoRepeat:' false
|
56
|
813 |
)
|
|
814 |
#(#ActionButtonSpec
|
|
815 |
#'name:' 'button4'
|
111
|
816 |
#'layout:' #(#LayoutFrame 216 0 71 0 235 0 89 0)
|
56
|
817 |
#'label:' ''
|
|
818 |
#'model:' #makeOffsetTop
|
111
|
819 |
#'isTriggerOnDown:' false
|
|
820 |
#'autoRepeat:' false
|
56
|
821 |
)
|
62
|
822 |
#(#ActionButtonSpec
|
|
823 |
#'name:' 'button8'
|
111
|
824 |
#'layout:' #(#LayoutFrame 119 0 103 0 138 0 121 0)
|
62
|
825 |
#'label:' ''
|
|
826 |
#'model:' #makeRelativeLeftTop
|
111
|
827 |
#'isTriggerOnDown:' false
|
|
828 |
#'autoRepeat:' false
|
62
|
829 |
)
|
|
830 |
#(#ActionButtonSpec
|
|
831 |
#'name:' 'button9'
|
111
|
832 |
#'layout:' #(#LayoutFrame 216 0 103 0 235 0 121 0)
|
62
|
833 |
#'label:' ''
|
|
834 |
#'model:' #makeOffsetLeftTop
|
111
|
835 |
#'isTriggerOnDown:' false
|
|
836 |
#'autoRepeat:' false
|
62
|
837 |
)
|
|
838 |
#(#LabelSpec
|
|
839 |
#'name:' 'label5'
|
111
|
840 |
#'layout:' #(#AlignmentOrigin 52 0 103 0 1 0)
|
62
|
841 |
#'label:' 'all'
|
56
|
842 |
)
|
62
|
843 |
)
|
|
844 |
)
|
|
845 |
)
|
|
846 |
!
|
|
847 |
|
|
848 |
specificationPoint
|
|
849 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
850 |
|
|
851 |
"do not manually edit this - the painter/builder may not be able to
|
|
852 |
handle the specification if its corrupted."
|
|
853 |
|
|
854 |
"
|
111
|
855 |
UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationPoint
|
|
856 |
UIPropertyView::Dimension new openInterface:#specificationPoint
|
62
|
857 |
"
|
|
858 |
|
|
859 |
<resource: #canvas>
|
|
860 |
|
|
861 |
^
|
140
|
862 |
|
62
|
863 |
#(#FullSpec
|
|
864 |
#'window:'
|
|
865 |
#(#WindowSpec
|
|
866 |
#'name:' 'uIPainterView'
|
|
867 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
868 |
#'label:' 'unnamed'
|
|
869 |
#'bounds:' #(#Rectangle 0 0 238 303)
|
|
870 |
)
|
|
871 |
#'component:'
|
|
872 |
#(#SpecCollection
|
|
873 |
#'collection:'
|
|
874 |
#(
|
|
875 |
#(#LabelSpec
|
|
876 |
#'name:' 'label1'
|
111
|
877 |
#'layout:' #(#AlignmentOrigin 75 0 19 0 1 0)
|
62
|
878 |
#'label:' 'origin x:'
|
|
879 |
)
|
|
880 |
#(#LabelSpec
|
|
881 |
#'name:' 'label2'
|
111
|
882 |
#'layout:' #(#AlignmentOrigin 75 0 46 0 1 0)
|
62
|
883 |
#'label:' 'origin y:'
|
56
|
884 |
)
|
62
|
885 |
#(#InputFieldSpec
|
|
886 |
#'name:' 'editField1'
|
111
|
887 |
#'layout:' #(#LayoutFrame 77 0 19 0 170 0 37 0)
|
66
|
888 |
#'model:' #absLeft
|
62
|
889 |
#'tabable:' true
|
|
890 |
#'type:' #numberOrNil
|
|
891 |
)
|
|
892 |
#(#InputFieldSpec
|
|
893 |
#'name:' 'editField2'
|
111
|
894 |
#'layout:' #(#LayoutFrame 77 0 46 0 170 0 64 0)
|
66
|
895 |
#'model:' #absTop
|
62
|
896 |
#'tabable:' true
|
|
897 |
#'type:' #numberOrNil
|
|
898 |
)
|
56
|
899 |
)
|
|
900 |
)
|
|
901 |
)
|
62
|
902 |
!
|
56
|
903 |
|
62
|
904 |
specificationRectangle
|
|
905 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
906 |
|
|
907 |
"do not manually edit this - the painter/builder may not be able to
|
|
908 |
handle the specification if its corrupted."
|
|
909 |
|
|
910 |
"
|
111
|
911 |
UIPainter new openOnClass:UIPropertyView::Dimension andSelector:#specificationRectangle
|
|
912 |
UIPropertyView::Dimension new openInterface:#specificationRectangle
|
62
|
913 |
"
|
|
914 |
|
|
915 |
<resource: #canvas>
|
56
|
916 |
|
62
|
917 |
^
|
140
|
918 |
|
62
|
919 |
#(#FullSpec
|
|
920 |
#'window:'
|
|
921 |
#(#WindowSpec
|
|
922 |
#'name:' 'uIPainterView'
|
|
923 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
924 |
#'label:' 'unnamed'
|
|
925 |
#'bounds:' #(#Rectangle 0 0 238 303)
|
|
926 |
)
|
|
927 |
#'component:'
|
|
928 |
#(#SpecCollection
|
|
929 |
#'collection:'
|
|
930 |
#(
|
|
931 |
#(#LabelSpec
|
|
932 |
#'name:' 'label1'
|
111
|
933 |
#'layout:' #(#AlignmentOrigin 80 0 19 0 1 0)
|
62
|
934 |
#'label:' 'origin x:'
|
|
935 |
#'adjust:' #left
|
|
936 |
)
|
|
937 |
#(#LabelSpec
|
|
938 |
#'name:' 'label2'
|
111
|
939 |
#'layout:' #(#AlignmentOrigin 80 0 46 0 1 0)
|
62
|
940 |
#'label:' 'origin y:'
|
|
941 |
#'adjust:' #left
|
|
942 |
)
|
|
943 |
#(#InputFieldSpec
|
|
944 |
#'name:' 'editField1'
|
111
|
945 |
#'layout:' #(#LayoutFrame 81 0 19 0 174 0 37 0)
|
62
|
946 |
#'model:' #leftOffset
|
|
947 |
#'tabable:' true
|
|
948 |
#'type:' #numberOrNil
|
|
949 |
)
|
|
950 |
#(#InputFieldSpec
|
|
951 |
#'name:' 'editField2'
|
111
|
952 |
#'layout:' #(#LayoutFrame 81 0 46 0 174 0 64 0)
|
62
|
953 |
#'model:' #topOffset
|
|
954 |
#'tabable:' true
|
|
955 |
#'type:' #numberOrNil
|
|
956 |
)
|
|
957 |
#(#LabelSpec
|
|
958 |
#'name:' 'label4'
|
111
|
959 |
#'layout:' #(#AlignmentOrigin 80 0 74 0 1 0)
|
62
|
960 |
#'label:' 'corner x:'
|
|
961 |
#'adjust:' #left
|
|
962 |
)
|
|
963 |
#(#LabelSpec
|
|
964 |
#'name:' 'label5'
|
111
|
965 |
#'layout:' #(#AlignmentOrigin 80 0 101 0 1 0)
|
62
|
966 |
#'label:' 'corner y:'
|
|
967 |
#'adjust:' #left
|
|
968 |
)
|
|
969 |
#(#InputFieldSpec
|
|
970 |
#'name:' 'editField3'
|
111
|
971 |
#'layout:' #(#LayoutFrame 81 0 74 0 174 0 92 0)
|
62
|
972 |
#'model:' #rightOffset
|
|
973 |
#'tabable:' true
|
|
974 |
#'type:' #numberOrNil
|
|
975 |
)
|
|
976 |
#(#InputFieldSpec
|
|
977 |
#'name:' 'editField4'
|
111
|
978 |
#'layout:' #(#LayoutFrame 81 0 101 0 174 0 119 0)
|
62
|
979 |
#'model:' #bottomOffset
|
|
980 |
#'tabable:' true
|
|
981 |
#'type:' #numberOrNil
|
|
982 |
)
|
|
983 |
)
|
|
984 |
)
|
|
985 |
)
|
56
|
986 |
! !
|
|
987 |
|
111
|
988 |
!UIPropertyView::Dimension methodsFor:'accessing'!
|
59
|
989 |
|
140
|
990 |
forView
|
|
991 |
"get the view the layout derives from
|
|
992 |
"
|
|
993 |
^ forView
|
|
994 |
!
|
|
995 |
|
111
|
996 |
forView:aView
|
|
997 |
"set the view the layout derives from
|
|
998 |
"
|
122
|
999 |
forView := aView.
|
144
|
1000 |
self update.
|
62
|
1001 |
!
|
56
|
1002 |
|
149
|
1003 |
label
|
|
1004 |
^ 'Layout'
|
|
1005 |
!
|
|
1006 |
|
111
|
1007 |
layout
|
|
1008 |
"returns current layout
|
|
1009 |
"
|
|
1010 |
|layout|
|
|
1011 |
|
|
1012 |
selection notNil ifTrue:[
|
|
1013 |
layout := self perform:(('get', selection asString) asSymbol).
|
|
1014 |
].
|
|
1015 |
^ layout
|
56
|
1016 |
!
|
|
1017 |
|
111
|
1018 |
layoutType
|
|
1019 |
"returns current layoutType
|
56
|
1020 |
"
|
111
|
1021 |
^ selection
|
144
|
1022 |
!
|
|
1023 |
|
|
1024 |
update
|
|
1025 |
"update from physical view
|
|
1026 |
"
|
|
1027 |
|superView|
|
|
1028 |
|
|
1029 |
forView notNil ifTrue:[
|
|
1030 |
superView := forView superView
|
|
1031 |
].
|
|
1032 |
noteBook enabled:((superView isNil or:[superView specClass isLayoutContainer]) not).
|
|
1033 |
self selection:(UIPainterView layoutType:forView).
|
|
1034 |
|
|
1035 |
|
111
|
1036 |
! !
|
74
|
1037 |
|
111
|
1038 |
!UIPropertyView::Dimension methodsFor:'accessing hierarchy'!
|
56
|
1039 |
|
111
|
1040 |
window
|
|
1041 |
^ noteBook
|
74
|
1042 |
|
|
1043 |
|
56
|
1044 |
! !
|
|
1045 |
|
111
|
1046 |
!UIPropertyView::Dimension methodsFor:'initialization'!
|
56
|
1047 |
|
111
|
1048 |
initialize
|
|
1049 |
"initialize channels
|
62
|
1050 |
"
|
111
|
1051 |
|layoutAspects|
|
56
|
1052 |
|
|
1053 |
super initialize.
|
|
1054 |
|
62
|
1055 |
layoutAspects := IdentityDictionary new.
|
59
|
1056 |
|
|
1057 |
#( bottomFraction bottomOffset
|
|
1058 |
leftFraction leftOffset
|
|
1059 |
topFraction topOffset
|
|
1060 |
rightFraction rightOffset
|
|
1061 |
leftAlignmentFraction topAlignmentFraction
|
66
|
1062 |
absLeft absTop
|
59
|
1063 |
)
|
111
|
1064 |
do:[:aKey|
|
|
1065 |
layoutAspects at:aKey put:(ValueHolder new)
|
59
|
1066 |
].
|
111
|
1067 |
self aspects:layoutAspects.
|
56
|
1068 |
|
|
1069 |
|
|
1070 |
!
|
|
1071 |
|
111
|
1072 |
origin:anOrigin corner:aCorner in:aTopView
|
|
1073 |
"set dimensions
|
62
|
1074 |
"
|
111
|
1075 |
noteBook := NoteBookView origin:anOrigin corner:aCorner in:aTopView.
|
|
1076 |
window := noteBook canvas.
|
59
|
1077 |
|
111
|
1078 |
noteBook direction:#bottom.
|
|
1079 |
noteBook useIndex:true.
|
|
1080 |
layoutTypes := #( #LayoutFrame #AlignmentOrigin #LayoutOrigin #Point #Rectangle ).
|
|
1081 |
noteBook list:#( 'Frame' 'Alig.Origin' 'LayoutOrigin' 'Point' 'Rectangle' ).
|
62
|
1082 |
|
111
|
1083 |
noteBook action:[:anIndex|
|
|
1084 |
anIndex notNil ifTrue:[self selection:(layoutTypes at:anIndex)].
|
59
|
1085 |
].
|
70
|
1086 |
|
111
|
1087 |
! !
|
|
1088 |
|
|
1089 |
!UIPropertyView::Dimension methodsFor:'layout access'!
|
|
1090 |
|
|
1091 |
getAlignmentOrigin
|
|
1092 |
"returns current layout as alignmentOrigin
|
|
1093 |
"
|
|
1094 |
|layout|
|
|
1095 |
|
|
1096 |
layout := AlignmentOrigin new.
|
59
|
1097 |
|
111
|
1098 |
layout leftOffset:((aspects at:#leftOffset) value) ? 0.
|
|
1099 |
layout topOffset:((aspects at:#topOffset) value) ? 0.
|
|
1100 |
layout leftFraction:((aspects at:#leftFraction) value) ? 0.
|
|
1101 |
layout topFraction:((aspects at:#topFraction) value) ? 0.
|
|
1102 |
|
|
1103 |
layout leftAlignmentFraction:((aspects at:#leftAlignmentFraction) value) ? 0.
|
|
1104 |
layout topAlignmentFraction:((aspects at:#topAlignmentFraction) value) ? 0.
|
|
1105 |
|
|
1106 |
^ layout
|
|
1107 |
!
|
|
1108 |
|
|
1109 |
getExtent
|
|
1110 |
"returns current extent
|
|
1111 |
"
|
|
1112 |
^ Point x:(((aspects at:#leftOffset) value) ? 0)
|
|
1113 |
y:(((aspects at:#rightOffset) value) ? 0)
|
64
|
1114 |
!
|
|
1115 |
|
111
|
1116 |
getLayoutFrame
|
|
1117 |
"returns current layout as layoutFrame
|
|
1118 |
"
|
|
1119 |
|layout|
|
|
1120 |
|
|
1121 |
layout := LayoutFrame new.
|
|
1122 |
|
|
1123 |
layout leftOffset:((aspects at:#leftOffset) value) ? 0.
|
|
1124 |
layout rightOffset:((aspects at:#rightOffset) value) ? 0.
|
|
1125 |
layout topOffset:((aspects at:#topOffset) value) ? 0.
|
|
1126 |
layout bottomOffset:((aspects at:#bottomOffset) value) ? 0.
|
|
1127 |
layout leftFraction:((aspects at:#leftFraction) value) ? 0.
|
|
1128 |
layout rightFraction:((aspects at:#rightFraction) value) ? 0.
|
|
1129 |
layout topFraction:((aspects at:#topFraction) value) ? 0.
|
|
1130 |
layout bottomFraction:((aspects at:#bottomFraction) value) ? 0.
|
|
1131 |
|
|
1132 |
^ layout
|
|
1133 |
!
|
|
1134 |
|
|
1135 |
getLayoutOrigin
|
|
1136 |
"returns current layout as layoutOrigin
|
64
|
1137 |
"
|
111
|
1138 |
|layout|
|
|
1139 |
|
|
1140 |
layout := LayoutOrigin new.
|
|
1141 |
|
|
1142 |
layout leftOffset:((aspects at:#leftOffset) value) ? 0.
|
|
1143 |
layout topOffset:((aspects at:#topOffset) value) ? 0.
|
|
1144 |
layout leftFraction:((aspects at:#leftFraction) value) ? 0.
|
|
1145 |
layout topFraction:((aspects at:#topFraction) value) ? 0.
|
|
1146 |
|
|
1147 |
^ layout
|
|
1148 |
!
|
|
1149 |
|
|
1150 |
getPoint
|
|
1151 |
"returns current layout as point
|
|
1152 |
"
|
|
1153 |
^ Point x:(((aspects at:#absLeft) value) ? 0)
|
|
1154 |
y:(((aspects at:#absTop) value) ? 0)
|
|
1155 |
!
|
|
1156 |
|
|
1157 |
getRectangle
|
|
1158 |
"returns current layout as rectangle
|
|
1159 |
"
|
|
1160 |
^ Rectangle left:(((aspects at:#leftOffset) value) ? 0)
|
|
1161 |
top:(((aspects at:#topOffset) value) ? 0)
|
|
1162 |
right:(((aspects at:#rightOffset) value) ? 0)
|
|
1163 |
bottom:(((aspects at:#bottomOffset) value) ? 0)
|
62
|
1164 |
! !
|
|
1165 |
|
111
|
1166 |
!UIPropertyView::Dimension methodsFor:'layout fetch'!
|
62
|
1167 |
|
|
1168 |
fetchAlignmentOrigin
|
|
1169 |
"fetch alignmentOrigin
|
|
1170 |
"
|
70
|
1171 |
|layout type extent|
|
|
1172 |
|
111
|
1173 |
type := UIPainterView layoutType:forView.
|
|
1174 |
layout := forView geometryLayout.
|
62
|
1175 |
|
70
|
1176 |
layout isLayout ifTrue:[
|
111
|
1177 |
(aspects at:#leftOffset) value:(layout leftOffset).
|
|
1178 |
(aspects at:#leftFraction) value:(layout leftFraction).
|
|
1179 |
(aspects at:#topOffset) value:(layout topOffset).
|
|
1180 |
(aspects at:#topFraction) value:(layout topFraction).
|
59
|
1181 |
|
70
|
1182 |
type == #AlignmentOrigin ifTrue:[
|
111
|
1183 |
(aspects at:#leftAlignmentFraction) value:(layout leftAlignmentFraction).
|
|
1184 |
(aspects at:#topAlignmentFraction) value:(layout topAlignmentFraction).
|
70
|
1185 |
^ self
|
|
1186 |
]
|
|
1187 |
] ifFalse:[
|
111
|
1188 |
layout := forView computeOrigin.
|
64
|
1189 |
|
111
|
1190 |
(aspects at:#leftOffset) value:(layout x).
|
|
1191 |
(aspects at:#leftFraction) value:0.
|
|
1192 |
(aspects at:#topOffset) value:(layout y).
|
|
1193 |
(aspects at:#topFraction) value:0.
|
70
|
1194 |
].
|
111
|
1195 |
(aspects at:#leftAlignmentFraction) value:0.
|
|
1196 |
(aspects at:#topAlignmentFraction) value:0.
|
62
|
1197 |
!
|
|
1198 |
|
|
1199 |
fetchExtent
|
111
|
1200 |
"fetch extent
|
|
1201 |
"
|
62
|
1202 |
|extent|
|
59
|
1203 |
|
111
|
1204 |
extent := forView computeExtent.
|
|
1205 |
|
|
1206 |
(aspects at:#leftOffset) value:(extent x).
|
|
1207 |
(aspects at:#rightOffset) value:(extent y).
|
|
1208 |
|
62
|
1209 |
!
|
|
1210 |
|
|
1211 |
fetchLayoutFrame
|
|
1212 |
"fetch layoutFrame
|
|
1213 |
"
|
70
|
1214 |
|layout|
|
59
|
1215 |
|
111
|
1216 |
layout := UIPainterView asLayoutFrameFromView:forView.
|
59
|
1217 |
|
111
|
1218 |
(aspects at:#leftOffset) value:(layout leftOffset).
|
|
1219 |
(aspects at:#leftFraction) value:(layout leftFraction).
|
|
1220 |
(aspects at:#topOffset) value:(layout topOffset).
|
|
1221 |
(aspects at:#topFraction) value:(layout topFraction).
|
|
1222 |
(aspects at:#rightOffset) value:(layout rightOffset).
|
|
1223 |
(aspects at:#bottomOffset) value:(layout bottomOffset).
|
|
1224 |
(aspects at:#rightFraction) value:(layout rightFraction).
|
|
1225 |
(aspects at:#bottomFraction) value:(layout bottomFraction).
|
62
|
1226 |
!
|
59
|
1227 |
|
62
|
1228 |
fetchLayoutOrigin
|
|
1229 |
"fetch layoutOrigin
|
|
1230 |
"
|
70
|
1231 |
|layout|
|
59
|
1232 |
|
111
|
1233 |
layout := UIPainterView asLayoutFrameFromView:forView.
|
62
|
1234 |
|
111
|
1235 |
(aspects at:#leftOffset) value:(layout leftOffset).
|
|
1236 |
(aspects at:#leftFraction) value:(layout leftFraction).
|
|
1237 |
(aspects at:#topOffset) value:(layout topOffset).
|
|
1238 |
(aspects at:#topFraction) value:(layout topFraction).
|
62
|
1239 |
!
|
59
|
1240 |
|
62
|
1241 |
fetchPoint
|
|
1242 |
"fetch point
|
|
1243 |
"
|
70
|
1244 |
|origin|
|
62
|
1245 |
|
111
|
1246 |
origin := forView computeOrigin.
|
|
1247 |
|
|
1248 |
(aspects at:#absLeft) value:(origin x).
|
|
1249 |
(aspects at:#absTop) value:(origin y).
|
|
1250 |
|
56
|
1251 |
!
|
|
1252 |
|
62
|
1253 |
fetchRectangle
|
|
1254 |
"fetch rectangle
|
|
1255 |
"
|
70
|
1256 |
|origin corner|
|
62
|
1257 |
|
111
|
1258 |
origin := forView computeOrigin.
|
|
1259 |
corner := forView computeCorner.
|
56
|
1260 |
|
111
|
1261 |
(aspects at:#leftOffset) value:(origin x).
|
|
1262 |
(aspects at:#rightOffset) value:(corner x).
|
|
1263 |
(aspects at:#topOffset) value:(origin y).
|
|
1264 |
(aspects at:#bottomOffset) value:(corner y).
|
59
|
1265 |
|
56
|
1266 |
! !
|
|
1267 |
|
111
|
1268 |
!UIPropertyView::Dimension methodsFor:'layout make align'!
|
56
|
1269 |
|
68
|
1270 |
makeAlignBottomCenter
|
|
1271 |
self makeAlignLeft:0.5 top:1
|
|
1272 |
|
111
|
1273 |
|
68
|
1274 |
!
|
|
1275 |
|
|
1276 |
makeAlignBottomLeft
|
|
1277 |
self makeAlignLeft:0 top:1
|
|
1278 |
|
111
|
1279 |
|
68
|
1280 |
!
|
|
1281 |
|
|
1282 |
makeAlignBottomRight
|
|
1283 |
self makeAlignLeft:1 top:1
|
|
1284 |
|
111
|
1285 |
|
68
|
1286 |
!
|
|
1287 |
|
|
1288 |
makeAlignCenter
|
|
1289 |
self makeAlignLeft:0.5 top:0.5
|
|
1290 |
|
|
1291 |
!
|
|
1292 |
|
70
|
1293 |
makeAlignLeft:leftAlignmentFraction top:topAlignmentFraction
|
|
1294 |
|lAF tAF lO tO ext|
|
68
|
1295 |
|
111
|
1296 |
lAF := (aspects at:#leftAlignmentFraction) value ? 0.
|
|
1297 |
tAF := (aspects at:#topAlignmentFraction) value ? 0.
|
|
1298 |
ext := forView computeExtent.
|
68
|
1299 |
|
111
|
1300 |
(aspects at:#leftAlignmentFraction) value:leftAlignmentFraction.
|
|
1301 |
(aspects at:#topAlignmentFraction) value:topAlignmentFraction.
|
70
|
1302 |
|
111
|
1303 |
lO := (aspects at:#leftOffset) value ? 0.
|
|
1304 |
tO := (aspects at:#topOffset) value ? 0.
|
68
|
1305 |
|
70
|
1306 |
lO := lO + (ext x * (leftAlignmentFraction - lAF)).
|
|
1307 |
tO := tO + (ext y * (topAlignmentFraction - tAF)).
|
68
|
1308 |
|
111
|
1309 |
(aspects at:#leftOffset) value:(lO rounded).
|
|
1310 |
(aspects at:#topOffset) value:(tO rounded).
|
68
|
1311 |
!
|
|
1312 |
|
|
1313 |
makeAlignLeftCenter
|
|
1314 |
self makeAlignLeft:0 top:0.5
|
|
1315 |
|
|
1316 |
!
|
|
1317 |
|
|
1318 |
makeAlignRightCenter
|
|
1319 |
self makeAlignLeft:1 top:0.5
|
|
1320 |
|
|
1321 |
!
|
|
1322 |
|
|
1323 |
makeAlignTopCenter
|
|
1324 |
self makeAlignLeft:0.5 top:0
|
|
1325 |
|
|
1326 |
!
|
|
1327 |
|
|
1328 |
makeAlignTopLeft
|
|
1329 |
self makeAlignLeft:0 top:0
|
|
1330 |
|
|
1331 |
!
|
|
1332 |
|
|
1333 |
makeAlignTopRight
|
|
1334 |
self makeAlignLeft:1 top:0
|
|
1335 |
|
111
|
1336 |
|
|
1337 |
! !
|
|
1338 |
|
|
1339 |
!UIPropertyView::Dimension methodsFor:'layout make relative/absolute'!
|
68
|
1340 |
|
56
|
1341 |
makeLayout:what xOrY:xOrY offset:aBool
|
70
|
1342 |
|extent fraction offset fractSymb offsetSymb|
|
56
|
1343 |
|
111
|
1344 |
extent := (forView superView computeExtent) perform:xOrY.
|
56
|
1345 |
fractSymb := (what, 'Fraction') asSymbol.
|
|
1346 |
offsetSymb := (what, 'Offset') asSymbol.
|
|
1347 |
|
111
|
1348 |
fraction := (aspects at:fractSymb) value.
|
|
1349 |
offset := (aspects at:offsetSymb) value.
|
56
|
1350 |
|
70
|
1351 |
aBool ifTrue:[
|
|
1352 |
offset := offset + ((fraction * extent) asInteger).
|
|
1353 |
fraction := 0.
|
|
1354 |
] ifFalse:[
|
|
1355 |
fraction := (fraction + (offset / extent)) asFloat.
|
56
|
1356 |
|
70
|
1357 |
(fraction > 1.0) ifTrue:[ fraction := 1.0 ].
|
|
1358 |
(fraction < 0.0) ifTrue:[ fraction := 0 ].
|
|
1359 |
offset := 0.
|
|
1360 |
].
|
111
|
1361 |
(aspects at:offsetSymb) value:offset.
|
|
1362 |
(aspects at:fractSymb) value:fraction.
|
56
|
1363 |
!
|
|
1364 |
|
|
1365 |
makeOffsetAll
|
|
1366 |
self makeOffsetLeft.
|
|
1367 |
self makeOffsetTop.
|
|
1368 |
self makeOffsetRight.
|
|
1369 |
self makeOffsetBottom.
|
|
1370 |
|
111
|
1371 |
|
56
|
1372 |
!
|
|
1373 |
|
|
1374 |
makeOffsetBottom
|
|
1375 |
self makeLayout:'bottom' xOrY:#y offset:true.
|
|
1376 |
|
111
|
1377 |
|
56
|
1378 |
!
|
|
1379 |
|
|
1380 |
makeOffsetLeft
|
|
1381 |
self makeLayout:'left' xOrY:#x offset:true.
|
|
1382 |
|
|
1383 |
!
|
|
1384 |
|
62
|
1385 |
makeOffsetLeftTop
|
|
1386 |
self makeOffsetLeft.
|
|
1387 |
self makeOffsetTop.
|
111
|
1388 |
|
62
|
1389 |
!
|
|
1390 |
|
56
|
1391 |
makeOffsetRight
|
|
1392 |
self makeLayout:'right' xOrY:#x offset:true.
|
|
1393 |
|
|
1394 |
!
|
|
1395 |
|
|
1396 |
makeOffsetTop
|
|
1397 |
self makeLayout:'top' xOrY:#y offset:true.
|
|
1398 |
|
|
1399 |
!
|
|
1400 |
|
|
1401 |
makeRelativeAll
|
|
1402 |
self makeRelativeLeft.
|
|
1403 |
self makeRelativeTop.
|
|
1404 |
self makeRelativeRight.
|
|
1405 |
self makeRelativeBottom.
|
|
1406 |
|
111
|
1407 |
|
56
|
1408 |
!
|
|
1409 |
|
|
1410 |
makeRelativeBottom
|
|
1411 |
self makeLayout:'bottom' xOrY:#y offset:false.
|
|
1412 |
|
111
|
1413 |
|
56
|
1414 |
!
|
|
1415 |
|
|
1416 |
makeRelativeLeft
|
|
1417 |
self makeLayout:'left' xOrY:#x offset:false.
|
|
1418 |
|
|
1419 |
!
|
|
1420 |
|
62
|
1421 |
makeRelativeLeftTop
|
|
1422 |
self makeRelativeLeft.
|
|
1423 |
self makeRelativeTop.
|
111
|
1424 |
|
62
|
1425 |
!
|
|
1426 |
|
56
|
1427 |
makeRelativeRight
|
|
1428 |
self makeLayout:'right' xOrY:#x offset:false.
|
|
1429 |
|
|
1430 |
!
|
|
1431 |
|
|
1432 |
makeRelativeTop
|
|
1433 |
self makeLayout:'top' xOrY:#y offset:false.
|
|
1434 |
|
|
1435 |
! !
|
|
1436 |
|
111
|
1437 |
!UIPropertyView::Dimension methodsFor:'selection'!
|
|
1438 |
|
|
1439 |
selection
|
|
1440 |
^ selection
|
74
|
1441 |
|
111
|
1442 |
!
|
|
1443 |
|
|
1444 |
selection:aLayoutType
|
|
1445 |
|spec idx|
|
74
|
1446 |
|
111
|
1447 |
selection == aLayoutType ifFalse:[
|
|
1448 |
(selection := aLayoutType) notNil ifTrue:[
|
|
1449 |
self perform:(('fetch', selection asString) asSymbol).
|
|
1450 |
spec := ('specification', selection asString) asSymbol.
|
|
1451 |
spec := self class perform:spec.
|
|
1452 |
].
|
|
1453 |
self buildFromSpec:spec.
|
126
|
1454 |
] ifTrue:[
|
|
1455 |
selection notNil ifTrue:[
|
122
|
1456 |
self perform:(('fetch', selection asString) asSymbol).
|
126
|
1457 |
self modified:false.
|
|
1458 |
]
|
111
|
1459 |
].
|
122
|
1460 |
idx := layoutTypes findFirst:[:type| type == aLayoutType ].
|
|
1461 |
noteBook setSelection:idx.
|
74
|
1462 |
|
59
|
1463 |
! !
|
|
1464 |
|
140
|
1465 |
!UIPropertyView::Specification methodsFor:'accessing'!
|
|
1466 |
|
|
1467 |
specEdited
|
|
1468 |
"gets current edit specification
|
|
1469 |
"
|
|
1470 |
^ specEdited
|
|
1471 |
|
|
1472 |
|
|
1473 |
!
|
|
1474 |
|
|
1475 |
specEdited:aSpec
|
|
1476 |
"sets current edit specification
|
|
1477 |
"
|
|
1478 |
|aspects|
|
|
1479 |
|
|
1480 |
self modified:false.
|
|
1481 |
|
|
1482 |
aSpec isNil ifTrue:[
|
|
1483 |
specChannel := nil.
|
|
1484 |
specEdited := nil.
|
|
1485 |
] ifFalse:[
|
|
1486 |
specEdited class == aSpec class ifTrue:[
|
|
1487 |
specEdited := aSpec.
|
|
1488 |
specChannel value:specEdited.
|
|
1489 |
^ self modified:false.
|
|
1490 |
].
|
|
1491 |
specEdited := aSpec.
|
|
1492 |
aspects := IdentityDictionary new.
|
|
1493 |
specChannel := specEdited asValue.
|
|
1494 |
specEdited class addBindingsTo:aspects for:specEdited channel:specChannel
|
|
1495 |
].
|
|
1496 |
self aspects:aspects.
|
|
1497 |
self buildFromSpec:nil.
|
|
1498 |
|
|
1499 |
|
|
1500 |
! !
|
|
1501 |
|
|
1502 |
!UIPropertyView::Specification methodsFor:'action'!
|
|
1503 |
|
|
1504 |
reload
|
|
1505 |
"reload specification
|
|
1506 |
"
|
|
1507 |
specChannel notNil ifTrue:[
|
|
1508 |
specChannel value:specEdited.
|
|
1509 |
self modified:false.
|
|
1510 |
]
|
|
1511 |
|
|
1512 |
|
|
1513 |
! !
|
|
1514 |
|
56
|
1515 |
!UIPropertyView class methodsFor:'documentation'!
|
|
1516 |
|
|
1517 |
version
|
|
1518 |
^ '$Header$'
|
|
1519 |
! !
|