[FIX] TwoWayScrollPane

Yohei.Ikezoe Yohei.Ikezoe at is.titech.ac.jp
Fri Nov 26 11:50:23 UTC 1999


  Hi,

This is my first contribution to the community. I found TwoWayScrollPane 
recentry posted is quite useful, but the width of the horizontal scrollbar
become incorrect when there is no leftover of the vertical one.

The following is the fix for the probrem.

Regards,

'From Squeak2.6 of 11 October 1999 [latest update: #1559] on 26 November 1999 at 8:31:51 pm'!

!TwoWayScrollPane methodsFor: 'access' stamp: 'ike 11/26/1999 20:06'!
setScrollDeltas
	| range |
	scroller hasSubmorphs ifFalse: [scrollBar interval: 1.0. hsb interval: 1.0. ^ self].
	range _ self leftoverScrollRange.
	range = 0 ifTrue: [ scrollBar scrollDelta: 0.02 pageDelta: 0.2; interval: 1.0. 
						"hsb scrollDelta: 0.02 pageDelta: 0.2; interval: 1.0.
						^self"] 
	ifFalse: [scrollBar scrollDelta: (self scrollDeltaHeight / range) asFloat 
					pageDelta: ((self innerBounds height - self scrollDeltaHeight) / range) asFloat.
			scrollBar interval: ((self innerBounds height - self scrollDeltaHeight) / self 
					totalScrollRange) asFloat].
	range _ self bottomScrollRange.
	range = 0 ifTrue: [ hsb scrollDelta: 0.02 pageDelta: 0.2; interval: 1.0] 
	ifFalse: [hsb scrollDelta: (self scrollDeltaWidth / range) asFloat 
					pageDelta: ((self innerBounds width - self scrollDeltaWidth) / range) asFloat.
			hsb interval: ((self innerBounds width - self scrollDeltaWidth) / self 
					totalScrollRangeWidth) asFloat].! !





More information about the Squeak-dev mailing list