--- a/ListView.st Tue Jul 31 23:57:34 2018 +0200
+++ b/ListView.st Sat Aug 04 14:54:21 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
@@ -1949,6 +1951,92 @@
!ListView methodsFor:'drawing'!
+drawLine:line inVisible:visLineNr with:fg and:bg
+ "draw a given string at visible lines position in fg/bg"
+
+ self drawLine:line atX:(textStartLeft - viewOrigin x) inVisible:visLineNr with:fg and:bg
+!
+
+drawVisibleLine:visLineNr col:col with:fg and:bg
+ "draw single character at col index of visible line in fg/bg"
+
+ self
+ drawLine:(self visibleAt:visLineNr)
+ inVisible:visLineNr
+ col:col
+ with:fg and:bg
+!
+
+drawVisibleLine:visLineNr from:startCol to:endCol with:fg and:bg
+ "draw part of a visible line in fg/bg"
+
+ self
+ drawLine:(self visibleAt:visLineNr)
+ inVisible:visLineNr
+ from:startCol to:endCol
+ with:fg and:bg
+!
+
+drawVisibleLine:visLineNr from:startCol with:fg and:bg
+ "draw right part of a visible line from startCol to end of line in fg/bg"
+
+ self
+ drawLine:(self visibleAt:visLineNr)
+ inVisible:visLineNr
+ from:startCol
+ with:fg and:bg
+!
+
+drawVisibleLine:visLineNr with:fg and:bg
+ "draw a visible line in fg/bg"
+
+ self
+ drawLine:(self visibleAt:visLineNr)
+ atX:(textStartLeft - viewOrigin x)
+ inVisible:visLineNr
+ with:fg
+ and:bg
+
+ "Modified: 28.2.1996 / 19:30:23 / cg"
+!
+
+fillRectangleX:x y:y width:w height:h
+ "fill rectangle; checks whether the rectangle already is filled with
+ the current paint (#redrawX:y:w:h)."
+
+ backgroundAlreadyClearedColor ~~ self paint ifTrue:[
+ super fillRectangleX:x y:y width:w height:h
+ ]
+!
+
+invalidateLine:line
+ "invalidate the area of a single line.
+ This arranges for that line to be redrawn asynchronously (later).
+ If multiple such invalidations arrive, those areas may be lumped
+ together for a block update.
+ The update takes place when the windowGroup process gets a chance to
+ process expose events."
+
+ |yTop visLineNr|
+
+ visLineNr := self listLineToVisibleLine:line.
+ visLineNr notNil ifTrue:[
+ yTop := self yOfVisibleLine:visLineNr.
+ yTop isNil ifTrue:[^ self]. "/ not visible
+ (yTop + fontHeight) < 0 ifTrue:[^ self]. "/ not visible
+ self
+ invalidateDeviceRectangle:(Rectangle
+ left:margin top:yTop-(lineSpacing//2)
+ width:(width - (2 * margin)) height:fontHeight)
+ repairNow:false.
+ ]
+
+ "Created: / 5.3.1998 / 01:24:19 / cg"
+ "Modified: / 5.3.1998 / 13:41:31 / cg"
+! !
+
+!ListView methodsFor:'drawing-basic'!
+
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg
"draw a visible line range in fg/bg"
@@ -2026,12 +2114,13 @@
width:(width - (2 * margin))
height:fontHeight+extraBelow.
].
+
line notNil ifTrue:[
gc paint:fg on:bg.
- "/ remove lines color emphasis, to enforce color.
+ "/ remove line's color emphasis, to enforce color.
"/ otherwise blue text is not visible if selection-bg is blue.
- "/ this is only done in EditTextViews and subClasses.
+ "/ This is only done in EditTextViews and subClasses.
self suppressEmphasisInSelection ifTrue:[
l := self withoutColorEmphasis:line ifFg:fg andBg:bg.
] ifFalse:[
@@ -2051,7 +2140,8 @@
].
].
- "Modified: / 15.12.1999 / 23:19:46 / cg"
+ "Modified: / 15-12-1999 / 23:19:46 / cg"
+ "Modified: / 04-08-2018 / 14:50:54 / Claus Gittinger"
!
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg
@@ -2265,90 +2355,6 @@
]
"Modified: / 15.12.1999 / 23:24:40 / cg"
-!
-
-drawLine:line inVisible:visLineNr with:fg and:bg
- "draw a given string at visible lines position in fg/bg"
-
- self drawLine:line atX:(textStartLeft - viewOrigin x) inVisible:visLineNr with:fg and:bg
-!
-
-drawVisibleLine:visLineNr col:col with:fg and:bg
- "draw single character at col index of visible line in fg/bg"
-
- self
- drawLine:(self visibleAt:visLineNr)
- inVisible:visLineNr
- col:col
- with:fg and:bg
-!
-
-drawVisibleLine:visLineNr from:startCol to:endCol with:fg and:bg
- "draw part of a visible line in fg/bg"
-
- self
- drawLine:(self visibleAt:visLineNr)
- inVisible:visLineNr
- from:startCol to:endCol
- with:fg and:bg
-!
-
-drawVisibleLine:visLineNr from:startCol with:fg and:bg
- "draw right part of a visible line from startCol to end of line in fg/bg"
-
- self
- drawLine:(self visibleAt:visLineNr)
- inVisible:visLineNr
- from:startCol
- with:fg and:bg
-!
-
-drawVisibleLine:visLineNr with:fg and:bg
- "draw a visible line in fg/bg"
-
- self
- drawLine:(self visibleAt:visLineNr)
- atX:(textStartLeft - viewOrigin x)
- inVisible:visLineNr
- with:fg
- and:bg
-
- "Modified: 28.2.1996 / 19:30:23 / cg"
-!
-
-fillRectangleX:x y:y width:w height:h
- "fill rectangle; checks whether the rectangle already is filled with
- the current paint (#redrawX:y:w:h)."
-
- backgroundAlreadyClearedColor ~~ self paint ifTrue:[
- super fillRectangleX:x y:y width:w height:h
- ]
-!
-
-invalidateLine:line
- "invalidate the area of a single line.
- This arranges for that line to be redrawn asynchronously (later).
- If multiple such invalidations arrive, those areas may be lumped
- together for a block update.
- The update takes place when the windowGroup process gets a chance to
- process expose events."
-
- |yTop visLineNr|
-
- visLineNr := self listLineToVisibleLine:line.
- visLineNr notNil ifTrue:[
- yTop := self yOfVisibleLine:visLineNr.
- yTop isNil ifTrue:[^ self]. "/ not visible
- (yTop + fontHeight) < 0 ifTrue:[^ self]. "/ not visible
- self
- invalidateDeviceRectangle:(Rectangle
- left:margin top:yTop-(lineSpacing//2)
- width:(width - (2 * margin)) height:fontHeight)
- repairNow:false.
- ]
-
- "Created: / 5.3.1998 / 01:24:19 / cg"
- "Modified: / 5.3.1998 / 13:41:31 / cg"
! !
!ListView methodsFor:'event handling'!