GridPrinter: Fix custom painting of cell broken by previous commit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8633 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-11-26 18:54:48 +00:00
parent 8bb47927c9
commit debd0c4b9c

View File

@ -220,7 +220,8 @@ type
procedure DoLinePrinted(ARow, ALastCol: Integer); virtual;
procedure DoNewPage(AStartCol, AStartRow, AEndCol, AEndRow: Integer); virtual;
procedure DoPrepareCanvas(ACol, ARow: Integer); virtual;
procedure DoPrintCell(ACanvas: TCanvas; ACol, ARow: Integer; ARect: TRect); virtual;
procedure DoPrintCell(ACanvas: TCanvas; ACol, ARow: Integer; ARect: TRect;
var Done: boolean); virtual;
procedure DoUpdatePreview; virtual;
procedure Execute(ACanvas: TCanvas);
function GetBrushColor(AColor: TColor): TColor;
@ -752,13 +753,14 @@ begin
end;
procedure TGridPrinter.DoPrintCell(ACanvas: TCanvas; ACol, ARow: Integer;
ARect: TRect);
ARect: TRect; var Done: Boolean);
begin
if Assigned(FOnPrintCell) then
begin
FOnPrintCell(Self, FGrid, ACanvas, ACol, ARow, ARect);
exit;
end;
Done := true;
end else
Done := false;
end;
procedure TGridPrinter.DoUpdatePreview;
@ -1295,8 +1297,11 @@ var
col: TGridColumn;
lGrid: TGridAccess;
checkedState: TCheckboxState;
done: Boolean;
begin
DoPrintCell(ACanvas, ACol, ARow, ARect);
DoPrintCell(ACanvas, ACol, ARow, ARect, done);
if done then
exit;
lGrid := TGridAccess(FGrid);