From c70a742cf7718d31bcab5def51a87e10e71321ec Mon Sep 17 00:00:00 2001 From: alexs75 Date: Sun, 3 Mar 2013 09:35:53 +0000 Subject: [PATCH] RxDBGrid - fix draw last row with active footer rows git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2693 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/rxdbgrid.pas | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index ff9ecbadd..3adad38f6 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -586,7 +586,7 @@ type procedure UpdateActive; override; procedure UpdateData; override; procedure MoveSelection; override; - //function GetBufferCount: integer; override; + function GetBufferCount: integer; override; procedure CMHintShow(var Message: TLMessage); message CM_HINTSHOW; procedure FFilterListEditorOnChange(Sender: TObject); procedure FFilterListEditorOnCloseUp(Sender: TObject); @@ -1909,9 +1909,13 @@ begin if rdgFilter in OptionsRx then begin if Assigned(FFilterListEditor) then + begin RowHeights[0] := RowHeights[0] + FFilterListEditor.Height + end else + begin RowHeights[0] := RowHeights[0] + DefaultRowHeight; + end; end; finally @@ -2726,7 +2730,7 @@ begin inherited DrawCell(aCol, aRow, aRect, aState); end; -procedure TRxDBGrid.LinkActive(Value: boolean); +procedure TRxDBGrid.LinkActive(Value: Boolean); var S: string; Pos: integer; @@ -3402,6 +3406,17 @@ begin // UpdateRowsHeight; end; +function TRxDBGrid.GetBufferCount: integer; +begin + Result := ClientHeight div DefaultRowHeight; + if dgTitles in Options then + begin + Dec(Result, RowHeights[0] div DefaultRowHeight); + end; + if FFooterOptions.Active then + Dec(Result, FFooterOptions.RowCount); +end; + procedure TRxDBGrid.CMHintShow(var Message: TLMessage); var Cell: TGridCoord;