'From Squeak2.8 of 13 June 2000 [latest update: #2359] on 5 November 2000 at 12:39:28 am'! "Change Set: CS3-ScrollBarPositionFix Date: 5 November 2000 Author: Doug Way, Camp Smalltalk 3 @ OOPSLA Fixes a longtime problem with updating the position of the scrollbar when the contents of a scroll pane increases or decreases significantly in length. Basically, the scrollbar position was not being updated before, and now it is. Also refactors things so that SimpleHierarchicalListMorph>>setScrollDeltas is removed. (The bug is easiest to reproduce in an object explorer, if you expand things and scroll down so that the scrollbar thumb is in the middle of its range, and then expand an item in the explorer which has a lot of children. Then if you click on the up arrow in the scrollbar, the pane will skip to the wrong place because the scrollbar position hadn't been updated.)"! !ScrollPane commentStamp: '' prior: 0! The scroller (a transform) of a scrollPane is driven by the scrollBar. The scroll values vary from 0.0, meaning zero offset to 1.0 meaning sufficient offset such that the bottom of the scrollable material appears 3/4 of the way down the pane. The total distance to achieve this range is called the totalScrollRange.! !ScrollPane methodsFor: 'initialization' stamp: 'dew 11/5/2000 00:22'! setScrollDeltas "Set the ScrollBar deltas, value and interval, based on the current scroll pane size, offset and range." | range delta | self hideOrShowScrollBar. scroller hasSubmorphs ifFalse: [scrollBar interval: 1.0. ^ self]. range _ self leftoverScrollRange. delta _ self scrollDeltaHeight. range = 0 ifTrue: [^ scrollBar scrollDelta: 0.02 pageDelta: 0.2; interval: 1.0]. "Set up for one line (for arrow scrolling), or a full pane less one line (for paging)." scrollBar scrollDelta: (delta / range) asFloat pageDelta: ((self innerBounds height - delta) / range) asFloat. scrollBar interval: ((self innerBounds height - delta) / self totalScrollRange) asFloat. scrollBar value: (scroller offset y / self leftoverScrollRange) asFloat.! ! !SimpleHierarchicalListMorph methodsFor: 'as yet unclassified' stamp: 'dew 11/5/2000 00:15'! scrollDeltaHeight ^ scroller firstSubmorph height! ! SimpleHierarchicalListMorph removeSelector: #setScrollDeltas!