--- a/ListView.st Wed Sep 30 19:06:38 1998 +0200
+++ b/ListView.st Fri Oct 02 19:52:40 1998 +0200
@@ -19,7 +19,7 @@
wordCheck includesNonStrings widthOfWidestLine listMsg viewOrigin
listChannel backgroundAlreadyClearedColor'
classVariableNames:'DefaultForegroundColor DefaultBackgroundColor DefaultTabPositions
- DefaultLeftMargin DefaultTopMargin'
+ DefaultLeftMargin DefaultTopMargin'
poolDictionaries:''
category:'Views-Text'
!
@@ -3223,43 +3223,43 @@
"/ compute valid horizontal offset x
(x := dltOrg x) ~~ 0 ifTrue:[
- tmp := leftOffset + x.
-
- x < 0 ifTrue:[ "/ scrolling left
- tmp < 0 ifTrue:[x := 1 - leftOffset]
- ] ifFalse:[ "/ scrolling right
- "/ allows scrolling to the right of widest line
- max := self widthOfContents + 10.
-
- tmp + width > max ifTrue:[
- x := (max - leftOffset - width) max:0
- ]
- ]
+ tmp := leftOffset + x.
+
+ x < 0 ifTrue:[ "/ scrolling left
+ tmp < 0 ifTrue:[x := 1 - leftOffset]
+ ] ifFalse:[ "/ scrolling right
+ "/ allows scrolling to the right of widest line
+ max := self widthOfContents + 10.
+
+ tmp + width > max ifTrue:[
+ x := (max - leftOffset - width) max:0
+ ]
+ ]
].
"/ compute valid vertical offset measured in lines
(y := dltOrg y // fontHeight) ~~ 0 ifTrue:[
- tmp := firstLineShown + y.
-
- y < 0 ifTrue:[ "/ scrolling up
- tmp < 1 ifTrue:[y := 1 - firstLineShown]
- ] ifFalse:[ "/ scrolling down
- max := self size.
-
- tmp + nFullLinesShown > max ifTrue:[
- y := (max - firstLineShown - nFullLinesShown + 1) max:0
- ]
- ]
+ tmp := firstLineShown + y.
+
+ y < 0 ifTrue:[ "/ scrolling up
+ tmp < 1 ifTrue:[y := 1 - firstLineShown]
+ ] ifFalse:[ "/ scrolling down
+ max := self size.
+
+ tmp + nFullLinesShown > max ifTrue:[
+ y := (max - firstLineShown - nFullLinesShown + 1) max:0
+ ]
+ ]
].
(x == 0 and:[y == 0]) ifTrue:[ "/ has viewOrigin changed ?
- ^ self
+ ^ self
].
(noLn := y) ~~ 0 ifTrue:[
- y := y * fontHeight
+ y := y * fontHeight
].
delta := (x @ y).
@@ -3268,11 +3268,11 @@
newLeftOffset := newViewOrigin x.
(shown and:[doRedraw]) ifFalse:[
- self originWillChange.
- firstLineShown := newFirstLine.
- viewOrigin := newViewOrigin.
- leftOffset := newLeftOffset.
- ^ self originChanged:delta
+ self originWillChange.
+ firstLineShown := newFirstLine.
+ viewOrigin := newViewOrigin.
+ leftOffset := newLeftOffset.
+ ^ self originChanged:delta
].
"/ (self sensor notNil and: [self sensor hasExposeEventFor:self]) ifTrue:[ "/ outstanding expose events
@@ -3285,12 +3285,12 @@
or:[(noLn abs) >= nLinesShown "/ at least one area is
or:[(x abs) > (width // 4 * 3)]] "/ big enough to redraw all
) ifTrue:[
- self originWillChange.
- firstLineShown := newFirstLine.
- viewOrigin := newViewOrigin.
- leftOffset := newLeftOffset.
- self invalidate.
- ^ self originChanged:delta
+ self originWillChange.
+ firstLineShown := newFirstLine.
+ viewOrigin := newViewOrigin.
+ leftOffset := newLeftOffset.
+ self invalidate.
+ ^ self originChanged:delta
].
self repairDamage.
@@ -3304,52 +3304,54 @@
x == 0 ifTrue:[ "/ scrolling vertical
- y0 := textStartTop + (y abs).
- h := height - margin - y0.
- w := width - margin.
-
- y > 0 ifTrue:[ "/ copy down
- self copyFrom:self
- x:0 y:y0 toX:0 y:textStartTop
- width:w height:h async:true.
- y1 := h.
- ] ifFalse:[ "/ copy up
- self copyFrom:self
- x:margin y:textStartTop toX:margin y:y0
- width:w height:h async:true.
- y1 := 0.
- ].
-
- self redrawX:margin y:y1 width:w height:y0.
+ y0 := textStartTop + (y abs).
+ h := height - margin - y0.
+ w := width - margin.
+
+ y > 0 ifTrue:[ "/ copy down
+ self copyFrom:self
+ x:0 y:y0 toX:0 y:textStartTop
+ width:w height:h async:true.
+ y1 := h.
+ ] ifFalse:[ "/ copy up
+ self copyFrom:self
+ x:margin y:textStartTop toX:margin y:y0
+ width:w height:h async:true.
+ y1 := 0.
+ ].
+
+ self invalidate:((margin@y1) extent:(w@y0)).
+ "/ self redrawX:margin y:y1 width:w height:y0.
] ifFalse:[ "/ scrolling horizontal
- x > 0 ifTrue:[ "/ scrolling right
- y0 := margin + x.
- y1 := width - y0.
- ] ifFalse:[ "/ scrolling left
- y0 := margin - x.
- y1 := 0.
- ].
- h := height - margin - margin.
- w := width - margin - y0.
-
- x > 0 ifTrue:[ "/ copy right
- self copyFrom:self x:y0 y:margin toX:margin y:margin
- width:w height:h async:true.
- ] ifFalse:[ "/ copy left
- "/self copyFrom:self x:textStartLeft y:margin toX:y0 y:margin
- self copyFrom:self x:margin y:margin toX:y0 y:margin
- width:w height:h async:true.
- ].
-
- self redrawX:y1 y:margin width:y0 height:h.
+ x > 0 ifTrue:[ "/ scrolling right
+ y0 := margin + x.
+ y1 := width - y0.
+ ] ifFalse:[ "/ scrolling left
+ y0 := margin - x.
+ y1 := 0.
+ ].
+ h := height - margin - margin.
+ w := width - margin - y0.
+
+ x > 0 ifTrue:[ "/ copy right
+ self copyFrom:self x:y0 y:margin toX:margin y:margin
+ width:w height:h async:true.
+ ] ifFalse:[ "/ copy left
+ "/self copyFrom:self x:textStartLeft y:margin toX:y0 y:margin
+ self copyFrom:self x:margin y:margin toX:y0 y:margin
+ width:w height:h async:true.
+ ].
+
+ self invalidate:((y1@margin) extent:(y0@h)).
+ "/ self redrawX:y1 y:margin width:y0 height:h.
].
self waitForExpose.
self originChanged:delta.
- "Modified: / 18.6.1998 / 19:07:31 / cg"
+ "Modified: / 2.10.1998 / 01:13:16 / cg"
! !
!ListView methodsFor:'searching'!
@@ -3819,5 +3821,5 @@
!ListView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.174 1998-09-28 09:25:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.175 1998-10-02 17:52:40 cg Exp $'
! !