checkin from browser
authorClaus Gittinger <cg@exept.de>
Tue, 04 May 1999 19:14:41 +0200
changeset 1897 d66a3dbfebf0
parent 1896 2e9c0db359ed
child 1898 fe4300f57e1a
checkin from browser
Scroller.st
--- a/Scroller.st	Tue May 04 19:10:50 1999 +0200
+++ b/Scroller.st	Tue May 04 19:14:41 1999 +0200
@@ -614,75 +614,75 @@
      oldFrame oldTop oldBot oldLeft oldRight
      thumbTop thumbBot thumbLeft thumbRight
      tH "{ Class: SmallInteger }"
-     tW 
+     tW "{ Class: SmallInteger }"
      delta needFullDraw 
      bgLeft bgTop bgWidth bgHeight|
 
     aNumber isNil ifTrue:[
-	newOrigin := 0
+        newOrigin := 0
     ] ifFalse:[
-	org := aNumber.
-	rangeStep notNil ifTrue:[
-	    org := org roundTo:rangeStep.
-	    rangeStep isInteger ifTrue:[
-		org := org asInteger
-	    ]
-	].
-	newOrigin := (org - rangeStart) asFloat / (rangeEnd - rangeStart / 100).
+        org := aNumber.
+        rangeStep notNil ifTrue:[
+            org := org roundTo:rangeStep.
+            rangeStep isInteger ifTrue:[
+                org := org asInteger
+            ]
+        ].
+        newOrigin := (org - rangeStart) asFloat / (rangeEnd - rangeStart / 100).
     ].
 
     ((newOrigin + thumbHeight) > 100) ifTrue:[
-	realNewOrigin := 100 - thumbHeight
+        realNewOrigin := 100 - thumbHeight
     ] ifFalse: [
-	realNewOrigin := newOrigin
+        realNewOrigin := newOrigin
     ].
     (realNewOrigin > 100) ifTrue:[
-	realNewOrigin := 100
+        realNewOrigin := 100
     ] ifFalse: [
-	(realNewOrigin < 0) ifTrue:[
-	    realNewOrigin := 0
-	]
+        (realNewOrigin < 0) ifTrue:[
+            realNewOrigin := 0
+        ]
     ].
     ((realNewOrigin ~= thumbOrigin) or:[thumbFrame isNil]) ifTrue:[
-	thumbOrigin := realNewOrigin.
+        thumbOrigin := realNewOrigin.
 
-	shown ifTrue:[
-	    oldFrame := thumbFrame.
-	    self computeThumbFrame.
-	    (thumbHeight = 100) ifTrue:[
-		"/ full: don't draw
-		^ self
-	    ].
+        shown ifTrue:[
+            oldFrame := thumbFrame.
+            self computeThumbFrame.
+            (thumbHeight = 100) ifTrue:[
+                "/ full: don't draw
+                ^ self
+            ].
 
-	    (thumbFrame ~= oldFrame) ifTrue:[
-		oldFrame isNil ifTrue:[
-		    self invalidate.
-		    "/ self drawThumb.
-		    ^ self
-		].
-		tH := thumbFrame height.
-		tW := thumbFrame width.
+            (thumbFrame ~= oldFrame) ifTrue:[
+                oldFrame isNil ifTrue:[
+                    self invalidate.
+                    "/ self drawThumb.
+                    ^ self
+                ].
+                tH := thumbFrame height.
+                tW := thumbFrame width.
 
-		oldTop := oldFrame top.
-		oldBot := oldTop + tH.
-		oldLeft := oldFrame left.
-		oldRight := oldLeft + tW.
+                oldTop := oldFrame top.
+                oldBot := oldTop + tH.
+                oldLeft := oldFrame left.
+                oldRight := oldLeft + tW.
 
-		thumbTop := thumbFrame top.
-		thumbBot := thumbTop + tH.
-		thumbLeft := thumbFrame left.
-		thumbRight := thumbLeft + tW.
+                thumbTop := thumbFrame top.
+                thumbBot := thumbTop + tH.
+                thumbLeft := thumbFrame left.
+                thumbRight := thumbLeft + tW.
 
-		needFullDraw := self exposeEventPending
-				or:[((orientation == #vertical) and:[oldBot >= height])
-				or:[((orientation ~~ #vertical) and:[oldRight >= width])]].
+                needFullDraw := self exposeEventPending
+                                or:[((orientation == #vertical) and:[oldBot >= height])
+                                or:[((orientation ~~ #vertical) and:[oldRight >= width])]].
 
-		needFullDraw ifTrue:[
-		    "
-		     cannot copy since thumb was below the end
-		     or may be not available for the copy
-		    "
-		    self invalidate.
+                needFullDraw ifTrue:[
+                    "
+                     cannot copy since thumb was below the end
+                     or may be not available for the copy
+                    "
+                    self invalidate.
 "/                    (orientation == #vertical) ifTrue:[
 "/                        self drawThumbBackgroundInX:thumbLeft y:oldTop
 "/                                              width:tW height:(height - oldTop).
@@ -691,86 +691,86 @@
 "/                                              width:(width - oldLeft) height:tH.
 "/                    ].
 "/                    self drawThumb.
-		    ^ self
-		].
+                    ^ self
+                ].
 
-		self catchExpose.
-		"
-		 copy the thumbs pixels
-		"
-		(orientation == #vertical) ifTrue:[
-		    self 
-			copyFrom:self 
-			x:thumbLeft y:oldTop
-			toX:thumbLeft y:thumbTop
-			width:tW height:tH
-			async:true.
-		] ifFalse:[
-		    self 
-			copyFrom:self 
-			x:oldLeft y:thumbTop
-			toX:thumbLeft y:thumbTop
-			width:tW height:tH
-			async:true.
-		].
+                self catchExpose.
+                "
+                 copy the thumbs pixels
+                "
+                (orientation == #vertical) ifTrue:[
+                    self 
+                        copyFrom:self 
+                        x:thumbLeft y:oldTop
+                        toX:thumbLeft y:thumbTop
+                        width:tW height:tH
+                        async:true.
+                ] ifFalse:[
+                    self 
+                        copyFrom:self 
+                        x:oldLeft y:thumbTop
+                        toX:thumbLeft y:thumbTop
+                        width:tW height:tH
+                        async:true.
+                ].
 
-		"
-		 clear some of the previous thumbs area to background
-		"
-		(orientation == #vertical) ifTrue:[
-		    bgLeft := thumbLeft.
-		    bgWidth := tW.
-		    oldTop > thumbTop ifTrue:[
-			delta := oldTop - thumbTop.
-			oldTop > thumbBot ifTrue:[
-			    bgTop := oldTop.
-			    bgHeight := tH + 1
-			] ifFalse:[
-			    bgTop := thumbBot.
-			    bgHeight := delta
-			]
-		    ] ifFalse:[
-			delta := thumbTop - oldTop.
-			oldBot < thumbTop ifTrue:[
-			    bgTop := oldTop.
-			    bgHeight := tH + 1
-			] ifFalse:[
-			    bgTop := oldTop.
-			    bgHeight := delta
-			]
-		    ].
-		] ifFalse:[
-		    bgTop := thumbTop.
-		    bgHeight := tH.
-		    oldLeft > thumbLeft ifTrue:[
-			delta := oldLeft - thumbLeft.
-			oldLeft > thumbRight ifTrue:[
-			    bgLeft := oldLeft.
-			    bgWidth := tW + 1.
-			] ifFalse:[
-			    bgLeft := thumbRight.
-			    bgWidth := delta.
-			]
-		    ] ifFalse:[
-			delta := thumbLeft - oldLeft.
-			oldRight < thumbLeft ifTrue:[
-			    bgLeft := oldLeft.
-			    bgWidth := tW + 1.
-			] ifFalse:[
-			    bgLeft := oldLeft.
-			    bgWidth := delta.
-			]
-		    ].
-		].
-		self drawThumbBackgroundInX:bgLeft y:bgTop width:bgWidth height:bgHeight.
-		self waitForExpose
-	    ]
-	] ifFalse:[
-	    thumbFrame := nil
-	]
+                "
+                 clear some of the previous thumbs area to background
+                "
+                (orientation == #vertical) ifTrue:[
+                    bgLeft := thumbLeft.
+                    bgWidth := tW.
+                    oldTop > thumbTop ifTrue:[
+                        delta := oldTop - thumbTop.
+                        oldTop > thumbBot ifTrue:[
+                            bgTop := oldTop.
+                            bgHeight := tH + 1
+                        ] ifFalse:[
+                            bgTop := thumbBot.
+                            bgHeight := delta
+                        ]
+                    ] ifFalse:[
+                        delta := thumbTop - oldTop.
+                        oldBot < thumbTop ifTrue:[
+                            bgTop := oldTop.
+                            bgHeight := tH + 1
+                        ] ifFalse:[
+                            bgTop := oldTop.
+                            bgHeight := delta
+                        ]
+                    ].
+                ] ifFalse:[
+                    bgTop := thumbTop.
+                    bgHeight := tH.
+                    oldLeft > thumbLeft ifTrue:[
+                        delta := oldLeft - thumbLeft.
+                        oldLeft > thumbRight ifTrue:[
+                            bgLeft := oldLeft.
+                            bgWidth := tW + 1.
+                        ] ifFalse:[
+                            bgLeft := thumbRight.
+                            bgWidth := delta.
+                        ]
+                    ] ifFalse:[
+                        delta := thumbLeft - oldLeft.
+                        oldRight < thumbLeft ifTrue:[
+                            bgLeft := oldLeft.
+                            bgWidth := tW + 1.
+                        ] ifFalse:[
+                            bgLeft := oldLeft.
+                            bgWidth := delta.
+                        ]
+                    ].
+                ].
+                self drawThumbBackgroundInX:bgLeft y:bgTop width:bgWidth height:bgHeight.
+                self waitForExpose
+            ]
+        ] ifFalse:[
+            thumbFrame := nil
+        ]
     ]
 
-    "Modified: / 21.1.1998 / 19:16:32 / cg"
+    "Modified: / 4.5.1999 / 18:57:28 / cg"
 !
 
 thumbOrigin:originNumber thumbHeight:heightNumber
@@ -2343,5 +2343,5 @@
 !Scroller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.129 1999-05-04 17:10:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.130 1999-05-04 17:14:41 cg Exp $'
 ! !