From 1eaf4364465a9c49f95f9c0ca09ef0b4139a596a Mon Sep 17 00:00:00 2001 From: jesus Date: Tue, 22 Feb 2011 22:05:06 +0000 Subject: [PATCH] LCL, fix dbgrid indicator appearing multiple times, problem introduced in r29577 #cb47ca2b93 git-svn-id: trunk@29655 - --- lcl/grids.pas | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lcl/grids.pas b/lcl/grids.pas index d6986a7d67..f9f09b1b89 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -1094,6 +1094,7 @@ type procedure InvalidateRange(const aRange: TRect); procedure InvalidateRow(ARow: Integer); function IscellVisible(aCol, aRow: Integer): Boolean; + function IsFixedCellVisible(aCol, aRow: Integer): boolean; procedure LoadFromFile(FileName: string); function MouseCoord(X,Y: Integer): TGridCoord; function MouseToCell(const Mouse: TPoint): TPoint; overload; @@ -6379,6 +6380,13 @@ begin Result:= (Left<=ACol)and(aCol<=Right)and(Top<=aRow)and(aRow<=Bottom); end; +function TCustomGrid.IsFixedCellVisible(aCol, aRow: Integer): boolean; +begin + with FGCache.VisibleGrid do + result := ((aCol=Top)and(aRow<=Bottom)))) or + ((aRow=Left)and(aCol<=Right)))); +end; + procedure TCustomGrid.InvalidateCol(ACol: Integer); var R: TRect; @@ -6799,7 +6807,7 @@ begin DebugLn(['InvalidateCell Col=',aCol, ' Row=',aRow,' Redraw=', Redraw]); {$Endif} - if HandleAllocated and IsCellVisible(aCol,aRow) then begin + if HandleAllocated and (IsCellVisible(aCol, aRow) or IsFixedCellVisible(aCol, aRow)) then begin R:=CellRect(aCol, aRow); InvalidateRect(Handle, @R, Redraw); end;