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