ObjectView.st
changeset 256 c55a4f8d8a70
parent 216 d35b116e03a6
child 262 d2c946b6a5b4
--- a/ObjectView.st	Thu Dec 14 21:15:25 1995 +0100
+++ b/ObjectView.st	Thu Dec 14 21:17:30 1995 +0100
@@ -11,15 +11,15 @@
 "
 
 View subclass:#ObjectView
-	 instanceVariableNames:'contents sorted lastButt pressAction releaseAction
-                shiftPressAction doublePressAction motionAction keyPressAction
-                selection gridShown gridPixmap scaleMetric dragObject
-                leftHandCursor oldCursor movedObject moveStartPoint moveDelta
-                documentFormat canDragOutOfView rootMotion rootView aligning
-                gridAlign aligningMove'
-	 classVariableNames:''
-	 poolDictionaries:''
-	 category:'Views-Basic'
+	instanceVariableNames:'contents sorted lastButt pressAction releaseAction
+		shiftPressAction doublePressAction motionAction keyPressAction
+		selection gridShown gridPixmap scaleMetric dragObject
+		leftHandCursor oldCursor movedObject moveStartPoint moveDelta
+		documentFormat canDragOutOfView rootMotion rootView aligning
+		gridAlign aligningMove'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Views-Basic'
 !
 
 !ObjectView class methodsFor:'documentation'!
@@ -1226,114 +1226,116 @@
     showDocumentBoundary := params at:7.
 
     transformation notNil ifTrue:[
-	mmH := mmH * transformation scale x.
-	mmV := mmV * transformation scale y.
-	bigStepH := bigStepH * transformation scale x.
-	bigStepV := bigStepV * transformation scale y.
-	littleStepH notNil ifTrue:[
-	    littleStepH := littleStepH * transformation scale x.
-	].
-	littleStepV notNil ifTrue:[
-	    littleStepV := littleStepV * transformation scale y.
-	].
+        mmH := mmH * transformation scale x.
+        mmV := mmV * transformation scale y.
+        bigStepH := bigStepH * transformation scale x.
+        bigStepV := bigStepV * transformation scale y.
+        littleStepH notNil ifTrue:[
+            littleStepH := littleStepH * transformation scale x.
+        ].
+        littleStepV notNil ifTrue:[
+            littleStepV := littleStepV * transformation scale y.
+        ].
     ].
 
     bigStepH isNil ifTrue:[^ self].
 
-    self withCursor:(Cursor wait) do:[
-	|xp yp y x|
-
-	"
-	 up to next full unit
-	"
-	gridW := ((gridW // bigStepH) + 1 * bigStepH) asInteger.
-	gridH := ((gridH // bigStepV) + 1 * bigStepV) asInteger.
-
-	gridPixmap := Form width:gridW height:gridH depth:1.
-	gridPixmap colorMap:(Array with:White with:Black).
-	gridPixmap clear.
-	gridPixmap paint:(Color colorId:1).
-
-	"draw first row point-by-point"
-	yp := 0.0.
-	xp := 0.0.
-	y := yp asInteger.
-	[xp <= gridW] whileTrue:[
-	    x := xp rounded.
-	    hires ifTrue:[
-		gridPixmap displayPointX:(x + 1) y:y.
-		gridPixmap displayPointX:(x + 2) y:y
-	    ].
-	    gridPixmap displayPointX:x y:y.
-	    littleStepH notNil ifTrue:[
-		xp := xp + littleStepH
-	    ] ifFalse:[
-		xp := xp + bigStepH
-	    ]
-	].
-
-	"copy rest from what has been drawn already"
-	yp := yp + bigStepV.
-	[yp <= gridH] whileTrue:[
-	    y := yp rounded.
-	    hires ifTrue:[
-		gridPixmap copyFrom:gridPixmap x:0 y:0 
-					     toX:0 y:(y + 1)
-					   width:gridW height:1.
-		gridPixmap copyFrom:gridPixmap x:0 y:0 
-					     toX:0 y:(y + 2)
-					   width:gridW height:1
-	    ].
-	    gridPixmap copyFrom:gridPixmap x:0 y:0 
-					 toX:0 y:y
-				       width:gridW height:1.
-	    yp := yp + bigStepV
-	].
-
-	"draw first col point-by-point"
-	xp := 0.0.
-	yp := 0.0.
-	x := xp asInteger.
-	[yp <= gridH] whileTrue:[
-	    y := yp rounded.
-	    hires ifTrue:[
-		gridPixmap displayPointX:x y:(y + 1).
-		gridPixmap displayPointX:x y:(y + 2)
-	    ].
-	    gridPixmap displayPointX:x y:y.
-	    littleStepV notNil ifTrue:[
-		yp := yp + littleStepV
-	    ] ifFalse:[
-		yp := yp + bigStepV
-	    ]
-	].
-
-	"copy rest from what has been drawn already"
-	xp := xp + bigStepH.
-	[xp <= gridW] whileTrue:[
-	    x := xp rounded.
-	    hires ifTrue:[
-		gridPixmap copyFrom:gridPixmap x:0 y:0 
-					     toX:(x + 1) y:0
-					   width:1 height:gridH.
-		gridPixmap copyFrom:gridPixmap x:0 y:0 
-					     toX:(x + 2) y:0
-					   width:1 height:gridH
-	    ].
-	    gridPixmap copyFrom:gridPixmap x:0 y:0 
-					 toX:x y:0
-				       width:1 height:gridH.
-	    xp := xp + bigStepH
-	].
-
-	showDocumentBoundary ifTrue:[
-	     "
-	     mark the right-end and bottom of the document
-	    "
-	    gridPixmap displayLineFromX:gridW-1 y:0 toX:gridW-1 y:gridH-1.
-	    gridPixmap displayLineFromX:0 y:gridH-1 toX:gridW-1 y:gridH-1.
-	].
+    self withWaitCursorDo:[
+        |xp yp y x|
+
+        "
+         up to next full unit
+        "
+        gridW := ((gridW // bigStepH) + 1 * bigStepH) asInteger.
+        gridH := ((gridH // bigStepV) + 1 * bigStepV) asInteger.
+
+        gridPixmap := Form width:gridW height:gridH depth:1.
+        gridPixmap colorMap:(Array with:White with:Black).
+        gridPixmap clear.
+        gridPixmap paint:(Color colorId:1).
+
+        "draw first row point-by-point"
+        yp := 0.0.
+        xp := 0.0.
+        y := yp asInteger.
+        [xp <= gridW] whileTrue:[
+            x := xp rounded.
+            hires ifTrue:[
+                gridPixmap displayPointX:(x + 1) y:y.
+                gridPixmap displayPointX:(x + 2) y:y
+            ].
+            gridPixmap displayPointX:x y:y.
+            littleStepH notNil ifTrue:[
+                xp := xp + littleStepH
+            ] ifFalse:[
+                xp := xp + bigStepH
+            ]
+        ].
+
+        "copy rest from what has been drawn already"
+        yp := yp + bigStepV.
+        [yp <= gridH] whileTrue:[
+            y := yp rounded.
+            hires ifTrue:[
+                gridPixmap copyFrom:gridPixmap x:0 y:0 
+                                             toX:0 y:(y + 1)
+                                           width:gridW height:1.
+                gridPixmap copyFrom:gridPixmap x:0 y:0 
+                                             toX:0 y:(y + 2)
+                                           width:gridW height:1
+            ].
+            gridPixmap copyFrom:gridPixmap x:0 y:0 
+                                         toX:0 y:y
+                                       width:gridW height:1.
+            yp := yp + bigStepV
+        ].
+
+        "draw first col point-by-point"
+        xp := 0.0.
+        yp := 0.0.
+        x := xp asInteger.
+        [yp <= gridH] whileTrue:[
+            y := yp rounded.
+            hires ifTrue:[
+                gridPixmap displayPointX:x y:(y + 1).
+                gridPixmap displayPointX:x y:(y + 2)
+            ].
+            gridPixmap displayPointX:x y:y.
+            littleStepV notNil ifTrue:[
+                yp := yp + littleStepV
+            ] ifFalse:[
+                yp := yp + bigStepV
+            ]
+        ].
+
+        "copy rest from what has been drawn already"
+        xp := xp + bigStepH.
+        [xp <= gridW] whileTrue:[
+            x := xp rounded.
+            hires ifTrue:[
+                gridPixmap copyFrom:gridPixmap x:0 y:0 
+                                             toX:(x + 1) y:0
+                                           width:1 height:gridH.
+                gridPixmap copyFrom:gridPixmap x:0 y:0 
+                                             toX:(x + 2) y:0
+                                           width:1 height:gridH
+            ].
+            gridPixmap copyFrom:gridPixmap x:0 y:0 
+                                         toX:x y:0
+                                       width:1 height:gridH.
+            xp := xp + bigStepH
+        ].
+
+        showDocumentBoundary ifTrue:[
+             "
+             mark the right-end and bottom of the document
+            "
+            gridPixmap displayLineFromX:gridW-1 y:0 toX:gridW-1 y:gridH-1.
+            gridPixmap displayLineFromX:0 y:gridH-1 toX:gridW-1 y:gridH-1.
+        ].
     ]
+
+    "Modified: 14.12.1995 / 20:59:38 / cg"
 !
 
 getAlignParameters
@@ -2193,41 +2195,43 @@
      (allows fileIn of multiple files doing a single redraw at the end)."
 
     binary ifTrue:[
-	aStream binary
+        aStream binary
     ].
-    self topView withCursor:(Cursor read) do:[
-	|newObject chunk individualRedraw|
-
-	self unselect.
-	individualRedraw := redraw.
-	new ifTrue:[
-	    self removeAll.
-	    individualRedraw := false.
-	].
-	[aStream atEnd] whileFalse:[
-	    binary ifTrue:[
-		newObject := Object readBinaryFrom:aStream
-	    ] ifFalse:[
-		chunk := aStream nextChunk.
-		(chunk notNil and:[chunk isEmpty not]) ifTrue:[
-		    newObject := Compiler evaluate:chunk.
-		] ifFalse:[
-		    newObject := nil
-		]
-	    ].
-	    newObject notNil ifTrue:[
-		self initializeFileInObject:newObject.
-		individualRedraw ifFalse:[
-		    self addObjectWithoutRedraw:newObject
-		] ifTrue:[
-		    self addObject:newObject
-		]
-	    ]
-	].
-	(new and:[redraw]) ifTrue:[
-	    self redraw
-	]
+    self topView withReadCursorDo:[
+        |newObject chunk individualRedraw|
+
+        self unselect.
+        individualRedraw := redraw.
+        new ifTrue:[
+            self removeAll.
+            individualRedraw := false.
+        ].
+        [aStream atEnd] whileFalse:[
+            binary ifTrue:[
+                newObject := Object readBinaryFrom:aStream
+            ] ifFalse:[
+                chunk := aStream nextChunk.
+                (chunk notNil and:[chunk isEmpty not]) ifTrue:[
+                    newObject := Compiler evaluate:chunk.
+                ] ifFalse:[
+                    newObject := nil
+                ]
+            ].
+            newObject notNil ifTrue:[
+                self initializeFileInObject:newObject.
+                individualRedraw ifFalse:[
+                    self addObjectWithoutRedraw:newObject
+                ] ifTrue:[
+                    self addObject:newObject
+                ]
+            ]
+        ].
+        (new and:[redraw]) ifTrue:[
+            self redraw
+        ]
     ]
+
+    "Modified: 14.12.1995 / 20:59:49 / cg"
 !
 
 initializeFileInObject:anObject
@@ -2702,5 +2706,5 @@
 !ObjectView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.29 1995-11-27 22:28:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.30 1995-12-14 20:17:30 cg Exp $'
 ! !