alignmentLayout
authorClaus Gittinger <cg@exept.de>
Fri, 28 Feb 1997 13:25:51 +0100
changeset 67 09e9d4b57142
parent 66 b4e629d9cfcb
child 68 889c3877baf0
alignmentLayout
UIObjectView.st
--- a/UIObjectView.st	Fri Feb 28 13:24:39 1997 +0100
+++ b/UIObjectView.st	Fri Feb 28 13:25:51 1997 +0100
@@ -102,8 +102,8 @@
     layout notNil ifTrue:[
         layout isLayout ifTrue:[
             layout isLayoutFrame        ifTrue:[ ^ #LayoutFrame ].
+            layout isAlignmentOrigin    ifTrue:[ ^ #AlignmentOrigin ].
             layout isLayoutOrigin       ifTrue:[ ^ #LayoutOrigin ].
-            layout isAlignmentOrigin    ifTrue:[ ^ #AlignmentOrigin ].
         ] ifFalse:[
             layout isRectangle          ifTrue:[ ^ #Rectangle ].
             layout isPoint              ifTrue:[ ^ #Point ].
@@ -115,6 +115,7 @@
     ].
     ^ nil
 
+    "Modified: 28.2.1997 / 13:02:16 / cg"
 ! !
 
 !UIObjectView methodsFor:'accessing'!
@@ -1431,8 +1432,11 @@
     "change extent for all selected objects
     "
     self transition:#layout dimensionDo:[:v|
+        v geometryLayout:nil.
         v extent:anExtent.
-    ].    
+    ].
+
+    "Modified: 28.2.1997 / 12:49:00 / cg"
 !
 
 setToDefaultExtent
@@ -1859,6 +1863,33 @@
     ]
 !
 
+alignSingleSelection:aBlock
+
+    |type layout|
+
+    self withSelectionHiddenDo:[
+        self transaction:#align selectionDo:[:aView|
+            type := self class layoutType:aView.
+
+            type notNil ifTrue:[
+                self undoLayoutView:aView.
+
+                layout := aView layout.
+
+                type == #LayoutFrame ifFalse:[
+                    layout := aView bounds asLayout
+                ].
+                aBlock value:layout.
+                aView geometryLayout:layout.
+            ]
+        ]
+    ].
+    self changed:#layout
+
+
+
+!
+
 centerSelection:aOneArgBlockXorY orientation:orientation
     "center selection horizontal or vertical dependant on the block result( x or y).
      The argument to the block is the point.