--- a/Scroller.st Wed Jan 29 12:01:52 1997 +0100
+++ b/Scroller.st Wed Jan 29 13:22:07 1997 +0100
@@ -549,135 +549,143 @@
newOrigin := (aNumber - 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 drawThumb.
- ^ self
- ].
- tH := thumbFrame height.
- tW := thumbFrame width.
+ (thumbFrame ~~ oldFrame) ifTrue:[
+ oldFrame isNil ifTrue:[
+ 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
- "
- (orientation == #vertical) ifTrue:[
- self drawThumbBackgroundInX:thumbLeft y:oldTop
- width:tW height:(height - oldTop).
- ] ifFalse:[
- self drawThumbBackgroundInX:oldLeft y:thumbTop
- width:(width - oldLeft) height:tH.
- ].
- self drawThumb.
- ^ self
- ].
+ needFullDraw ifTrue:[
+ "
+ cannot copy since thumb was below the end
+ or may be not available for the copy
+ "
+ (orientation == #vertical) ifTrue:[
+ self drawThumbBackgroundInX:thumbLeft y:oldTop
+ width:tW height:(height - oldTop).
+ ] ifFalse:[
+ self drawThumbBackgroundInX:oldLeft y:thumbTop
+ width:(width - oldLeft) height:tH.
+ ].
+ self drawThumb.
+ ^ 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.
- ] ifFalse:[
- self copyFrom:self x:oldLeft y:thumbTop
- toX:thumbLeft y:thumbTop
- width:tW height:tH.
- ].
+ 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: 29.1.1997 / 13:07:46 / cg"
!
thumbOrigin:originNumber thumbHeight:heightNumber
@@ -1835,5 +1843,5 @@
!Scroller class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.69 1997-01-17 22:23:55 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.70 1997-01-29 12:22:07 cg Exp $'
! !