# HG changeset patch # User Claus Gittinger # Date 861236095 -7200 # Node ID c8f27edf064e12d1a662de34bd223be92fcac580 # Parent 909fd985eb2c6f09063e4ce54b501c3f8a26d147 use asyncronous invaluate, instead of synchronous redraw wherever possible when scrolling diff -r 909fd985eb2c -r c8f27edf064e ListView.st --- a/ListView.st Thu Apr 17 02:12:57 1997 +0200 +++ b/ListView.st Thu Apr 17 02:14:55 1997 +0200 @@ -391,6 +391,17 @@ "Modified: 5.7.1996 / 17:55:34 / cg" ! +fontHeight:pixels + "set the lines height - thats the number of pixels, + by which lines are vertically separated." + + fontHeight ~~ pixels ifTrue:[ + fontHeight := pixels. + ] + + "Created: 17.4.1997 / 01:41:33 / cg" +! + foregroundColor "return the foreground color" @@ -2568,15 +2579,17 @@ nLines := nFullLinesShown. (firstLineShown + nLines + nFullLinesShown > self size) ifTrue:[ - nLines := self size - firstLineShown - nFullLinesShown + 1 + nLines := self size - firstLineShown - nFullLinesShown + 1 ]. nLines <= 0 ifTrue:[^ self]. self originWillChange. firstLineShown := firstLineShown + nLines. self originChanged:0 @ (nLines * fontHeight). - self redrawFromVisibleLine:1 to:nLinesShown - + "/ self redrawFromVisibleLine:1 to:nLinesShown + self invalidate + + "Modified: 17.4.1997 / 01:46:34 / cg" ! pageUp @@ -2585,15 +2598,18 @@ |oldOrg| (firstLineShown == 1) ifFalse:[ - self originWillChange. - oldOrg := firstLineShown. - firstLineShown := firstLineShown - nFullLinesShown. - (firstLineShown < 1) ifTrue:[ - firstLineShown := 1 - ]. - self originChanged:0 @ (firstLineShown - oldOrg * fontHeight). - self redrawFromVisibleLine:1 to:nLinesShown + self originWillChange. + oldOrg := firstLineShown. + firstLineShown := firstLineShown - nFullLinesShown. + (firstLineShown < 1) ifTrue:[ + firstLineShown := 1 + ]. + self originChanged:0 @ (firstLineShown - oldOrg * fontHeight). + "/ self redrawFromVisibleLine:1 to:nLinesShown + self invalidate ] + + "Modified: 17.4.1997 / 01:46:57 / cg" ! scrollDown @@ -2633,7 +2649,8 @@ (count >= nLinesShown) ifTrue:[ firstLineShown := firstLineShown + count. viewOrigin := viewOrigin x @ (viewOrigin y + nPixel). - self redrawFromVisibleLine:1 to:nLinesShown. + "/ self redrawFromVisibleLine:1 to:nLinesShown. + self invalidate ] ifFalse:[ m2 := margin * 2. w := self widthForScrollBetween:firstLineShown @@ -2672,7 +2689,7 @@ ]. self originChanged:(0 @ nPixel). - "Modified: 29.1.1997 / 13:30:23 / cg" + "Modified: 17.4.1997 / 01:47:46 / cg" ! scrollDownPixels:pix @@ -2782,16 +2799,19 @@ newLeftOffset := leftOffset - nPixel. newLeftOffset <= 0 ifTrue:[ - leftOffset == 0 ifTrue:[^ self]. - newLeftOffset := 0 + leftOffset == 0 ifTrue:[^ self]. + newLeftOffset := 0 ]. self originWillChange. delta := newLeftOffset - leftOffset. leftOffset := newLeftOffset. viewOrigin := newLeftOffset @ viewOrigin y. - self redrawFromVisibleLine:1 to:nLinesShown. + "/ self redrawFromVisibleLine:1 to:nLinesShown. + self invalidate. self originChanged:(delta @ 0) + + "Modified: 17.4.1997 / 01:48:34 / cg" ! scrollRight @@ -2819,15 +2839,18 @@ " wMax := self widthOfContents + 10. (leftOffset + nPixel + width > wMax) ifTrue:[ - cnt := wMax - leftOffset - width + cnt := wMax - leftOffset - width ]. " " cnt <= 0 ifTrue:[^ self]. self originWillChange. leftOffset := leftOffset + cnt. viewOrigin := leftOffset @ viewOrigin y. - self redrawFromVisibleLine:1 to:nLinesShown. + "/ self redrawFromVisibleLine:1 to:nLinesShown. + self invalidate. self originChanged:(cnt @ 0) + + "Modified: 17.4.1997 / 01:48:27 / cg" ! scrollSelectDown @@ -2989,7 +3012,8 @@ (count >= nLinesShown) ifTrue:[ firstLineShown := firstLineShown - count. viewOrigin := viewOrigin x @ (viewOrigin y - nPixel). - self redrawFromVisibleLine:1 to:nLinesShown. + "/ self redrawFromVisibleLine:1 to:nLinesShown. + self invalidate. ] ifFalse:[ w := self widthForScrollBetween:firstLineShown and:(firstLineShown + nLinesShown). @@ -3010,7 +3034,7 @@ ]. self originChanged:(0 @ (nPixel negated)). - "Modified: 29.1.1997 / 13:06:33 / cg" + "Modified: 17.4.1997 / 01:48:50 / cg" ! scrollUpPixels:pix @@ -3585,5 +3609,5 @@ !ListView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.128 1997-04-02 22:01:04 cg Exp $' + ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.129 1997-04-17 00:14:55 cg Exp $' ! !