2588 granny isNil ifTrue:[ |
2588 granny isNil ifTrue:[ |
2589 "/ cg: why that ? |
2589 "/ cg: why that ? |
2590 "/ self breakPoint:#cg. |
2590 "/ self breakPoint:#cg. |
2591 ^ true |
2591 ^ true |
2592 ]. |
2592 ]. |
2593 parent contents spec class isLayoutContainer ifTrue:[ |
2593 ^ parent contents spec class isLayoutContainer not |
2594 "/ self breakPoint:#cg. |
|
2595 ^ false |
|
2596 ]. |
|
2597 ^ true |
|
2598 ! |
2594 ! |
2599 |
2595 |
2600 canExchangeSelectionLayouts |
2596 canExchangeSelectionLayouts |
2601 "returns true if the selection size is exactly 2 |
2597 "returns true if the selection size is exactly 2 |
2602 and all elements in the selection can be moved or aligned |
2598 and all elements in the selection can be moved or aligned |
2603 " |
2599 " |
2604 selection size == 2 ifFalse:[ |
2600 selection size ~~ 2 ifTrue:[ |
2605 ^ false |
2601 ^ false |
2606 ]. |
2602 ]. |
2607 ^ self canMoveOrAlignSelection |
2603 ^ self canMoveOrAlignSelection |
2608 |
|
2609 ! |
2604 ! |
2610 |
2605 |
2611 canGroup |
2606 canGroup |
2612 "test whether selected elements can be grouped; minimum two elements |
2607 "test whether selected elements can be grouped; minimum two elements |
2613 must be selected and all must have the same parent" |
2608 must be selected and all must have the same parent" |
2653 canMoveOrAlignSelection |
2648 canMoveOrAlignSelection |
2654 "returns true if a selection exists and all elements in the selection |
2649 "returns true if a selection exists and all elements in the selection |
2655 can be moved or aligned |
2650 can be moved or aligned |
2656 " |
2651 " |
2657 ^ self canMove:(self selection) |
2652 ^ self canMove:(self selection) |
|
2653 ! |
|
2654 |
|
2655 canResize:something |
|
2656 "checks whether something is not nil and if all widgets derived from |
|
2657 something can be resized." |
|
2658 |
|
2659 something notNil ifTrue:[ |
|
2660 self forEach:something do:[:aView| |
|
2661 (self canResizeView:aView) ifFalse:[^ false] |
|
2662 ]. |
|
2663 ^ true |
|
2664 ]. |
|
2665 ^ false |
|
2666 ! |
|
2667 |
|
2668 canResizeSelection |
|
2669 "returns true if a selection exists and all elements in the selection |
|
2670 can be resized" |
|
2671 |
|
2672 ^ self canResize:(self selection) |
|
2673 ! |
|
2674 |
|
2675 canResizeView:aView |
|
2676 "returns true if the view can be resized. |
|
2677 This is dependent on its parent view." |
|
2678 |
|
2679 |item parent| |
|
2680 |
|
2681 item := treeView itemOfView:aView. |
|
2682 item isNil ifTrue:[ |
|
2683 "/ I dont know anything about that view (cg: how can this happen ?) |
|
2684 "/ self breakPoint:#cg. |
|
2685 ^ false |
|
2686 ]. |
|
2687 parent := item parent. |
|
2688 parent isNil ifTrue:[ |
|
2689 "/ that view has no parent (cg: does this mean its the canvas itself ?) |
|
2690 "/ self breakPoint:#cg. |
|
2691 ^ false |
|
2692 ]. |
|
2693 ^ parent contents spec class canResizeSubComponents |
2658 ! |
2694 ! |
2659 |
2695 |
2660 canUngroup |
2696 canUngroup |
2661 "test whether the selected element can be ungrouped; only one |
2697 "test whether the selected element can be ungrouped; only one |
2662 element is selected and has children" |
2698 element is selected and has children" |