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