# HG changeset patch # User ca # Date 1033194029 -7200 # Node ID f1a236f5bd480c133decf6ae1fe650a8d1c69d88 # Parent 5268b9c3be4a50341633c7f43af0009e6f304b33 horizontal scrolling and documentation diff -r 5268b9c3be4a -r f1a236f5bd48 HierarchicalListView.st --- a/HierarchicalListView.st Sat Sep 28 06:57:55 2002 +0200 +++ b/HierarchicalListView.st Sat Sep 28 08:20:29 2002 +0200 @@ -77,6 +77,13 @@ levelOfLastItem keeps the level of the last item; in case of a delete last items from list we know were to redraw lines from + + autoScrollHorizontal true, than automatically scroll horizontal upto + the text label of the current selected line. + + expandOnSelect true, than the item selected by a buttonPress + event will be immediately expanded. + [author:] Claus Atzkern @@ -513,8 +520,9 @@ super lineChangedAt:aLnNr with:arg. (arg ~~ #redraw and:[widthOfContents notNil]) ifTrue:[ - x0 := self xOfStringLevel:aLnNr. - x0 := x0 + (item widthOn:self) + 5. + x0 := (self xOfStringLevel:(item level)) + + (item widthOn:self) + + (viewOrigin x). x0 > widthOfContents ifTrue:[ widthOfContents := x0. @@ -1333,7 +1341,7 @@ computeViewOriginXat:aLnrNr "compute the visible viewOrigin x for the item at a line " - |item xLft xRgt xOrg level viewOriginX offset| + |item xLft xRgt xOrg level viewOriginX offset used| aLnrNr == 1 ifTrue:[^ 0]. @@ -1362,11 +1370,10 @@ ^ viewOriginX ]. xOrg := xLft + viewOriginX. + used := xRgt - xLft + (width // 4). - [ (xLft := xLft - offset) >= margin - and:[(xRgt := xRgt - offset) > width] - ] whileTrue:[ - xOrg := xOrg + offset + [ (used := used + offset) < width ] whileTrue:[ + xOrg := xOrg - offset. ]. ^ xOrg ! @@ -1415,5 +1422,5 @@ !HierarchicalListView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.49 2002-09-27 12:16:14 penk Exp $' + ^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.50 2002-09-28 06:20:29 ca Exp $' ! !