UIObjectView.st
changeset 1581 d7afe06ebbae
parent 1577 9dddcd2d77ab
child 1672 5e89f5959780
--- a/UIObjectView.st	Wed Aug 21 18:29:35 2002 +0200
+++ b/UIObjectView.st	Thu Aug 22 13:08:41 2002 +0200
@@ -89,34 +89,37 @@
     layout := aView geometryLayout.
 
     layout isNil ifTrue:[
-	type == #Extent ifTrue:[
-	    layout := aView bounds asLayout
-	]
+        type == #Extent ifTrue:[
+            layout := aView bounds asLayout
+        ]
     ].
 
     (type isNil or:[layout isNil]) ifTrue:[
-	^ nil
+        ^ nil
     ].
 
     type == #LayoutFrame ifTrue:[
-	^ layout copy
+        ^ layout copy
     ].
 
     layout isLayout ifFalse:[
-	type == #Rectangle ifTrue:[
-	    lO := layout left.
-	    tO := layout top.
-	    rO := layout right.
-	    bO := layout bottom.
-	] ifFalse:[
-	    lO := layout x.
-	    tO := layout y.
-	    rO := lO + aView extent x.
-	    bO := tO + aView extent y.
-	].
-
-	^ LayoutFrame leftFraction:0 offset:lO  rightFraction:0 offset:rO
-		       topFraction:0 offset:tO bottomFraction:0 offset:bO
+        type == #Rectangle ifTrue:[
+            lO := layout left.
+            tO := layout top.
+            rO := layout right.
+            bO := layout bottom.
+        ] ifFalse:[
+            lO := layout x.
+            tO := layout y.
+            rO := lO + aView extent x.
+            bO := tO + aView extent y.
+        ].
+
+        ^ LayoutFrame 
+                leftFraction:0 offset:lO  
+                rightFraction:0 offset:rO
+                topFraction:0 offset:tO 
+                bottomFraction:0 offset:bO
     ].
 
     lF := layout leftFraction.
@@ -128,25 +131,29 @@
     rF := lF.
     rO := lO + aView extent x.
 
-    newLyt := LayoutFrame leftFraction:lF offset:lO  rightFraction:rF offset:rO
-			   topFraction:tF offset:tO bottomFraction:bF offset:bO.
+    newLyt := LayoutFrame 
+                leftFraction:lF offset:lO  
+                rightFraction:rF offset:rO
+                topFraction:tF offset:tO 
+                bottomFraction:bF offset:bO.
 
     (    (type == #AlignmentOrigin)
      and:[layout leftAlignmentFraction ~~ 0
       or:[layout topAlignmentFraction  ~~ 0]]
     ) ifTrue:[
-	|svRc prBd dlta|
-
-	svRc := aView superView viewRectangle.
-	prBd := aView preferredBounds.
-	dlta := (  ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
-		 - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
-		) rounded.
-
-	newLyt leftOffset:(lO + dlta x).
-	newLyt rightOffset:(rO + dlta x).
-	newLyt topOffset:(tO + dlta y).
-	newLyt bottomOffset:(bO + dlta y).
+        |svRc prBd dlta|
+
+        svRc := aView superView viewRectangle.
+        prBd := aView preferredBounds.
+        dlta := (  ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
+                 - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
+                ) rounded.
+
+        newLyt 
+            leftOffset:(lO + dlta x)
+            rightOffset:(rO + dlta x)
+            topOffset:(tO + dlta y)
+            bottomOffset:(bO + dlta y).
     ].
   ^ newLyt.
 
@@ -1964,23 +1971,22 @@
     |lmost delta sel|
 
     (sel := self moveableSelection) notNil ifTrue:[
-	self withSelectionHiddenDo:[
-	    self numberOfSelections > 1 ifTrue:[
-		lmost := (sel first) computeOrigin x.
-
-		self transaction:#alignLeft selectionDo:[:v|
-		    (delta := lmost - (v computeOrigin x)) ~~ 0 ifTrue:[
-			self shiftLayout:v left:delta right:delta
-		    ]
-		]
-	    ] ifFalse:[
-		self extentToFrame:#Left do:[:aLayout|
-		    aLayout leftOffset:0.
-		    aLayout leftFraction:0.0.
-		]
-	    ]
-	].
-	self layoutChanged
+        self withSelectionHiddenDo:[
+            self numberOfSelections > 1 ifTrue:[
+                lmost := (sel first) computeOrigin x.
+
+                self transaction:#alignLeft selectionDo:[:v|
+                    (delta := lmost - (v computeOrigin x)) ~~ 0 ifTrue:[
+                        self shiftLayout:v left:delta right:delta
+                    ]
+                ]
+            ] ifFalse:[
+                self extentToFrame:#Left do:[:aLayout|
+                    aLayout leftFraction:0.0 offset:0.
+                ]
+            ]
+        ].
+        self layoutChanged
     ]
 !
 
@@ -1991,38 +1997,35 @@
     |lmost rmost sel|
 
     (sel := self moveableSelection) notNil ifTrue:[
-	self withSelectionHiddenDo:[
-	    self numberOfSelections > 1 ifTrue:[
-		lmost := (sel first) computeOrigin x.
-		rmost := (sel first) computeCorner x.
-
-		self transaction:#alignLeftRight selectionDo:[:aView|
-		    |layout|
-		    layout := self class asLayoutFrameFromView:aView.
-
-		    layout notNil ifTrue:[
-			self createUndoLayout:aView.
-			aView geometryLayout:layout.
-
-			undoHistory withoutTransactionDo:[    
-			    self shiftLayout:aView left:(lmost - (aView computeOrigin x))
-						  right:(rmost - (aView computeCorner x)).
-			].
-			self elementChangedSize:aView
-		    ]
-		]
-	    ] ifFalse:[
-		self extentToFrame:#LeftRight do:[:aLayout|
-		    aLayout leftOffset:0.
-		    aLayout leftFraction:0.0.
-		    aLayout rightOffset:0.
-		    aLayout rightFraction:1.0.
-		]
-	    ]
-	].
-	self layoutChanged
+        self withSelectionHiddenDo:[
+            self numberOfSelections > 1 ifTrue:[
+                lmost := (sel first) computeOrigin x.
+                rmost := (sel first) computeCorner x.
+
+                self transaction:#alignLeftRight selectionDo:[:aView|
+                    |layout|
+                    layout := self class asLayoutFrameFromView:aView.
+
+                    layout notNil ifTrue:[
+                        self createUndoLayout:aView.
+                        aView geometryLayout:layout.
+
+                        undoHistory withoutTransactionDo:[    
+                            self shiftLayout:aView left:(lmost - (aView computeOrigin x))
+                                                  right:(rmost - (aView computeCorner x)).
+                        ].
+                        self elementChangedSize:aView
+                    ]
+                ]
+            ] ifFalse:[
+                self extentToFrame:#LeftRight do:[:aLayout|
+                    aLayout leftFraction:0.0 offset:0.
+                    aLayout rightFraction:1.0 offset:0.
+                ]
+            ]
+        ].
+        self layoutChanged
     ].
-
 !
 
 alignSelectionRight