mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 12:39:32 +02:00
LazReport, cairo exporter, enable clipping for memo views
git-svn-id: trunk@41013 -
This commit is contained in:
parent
58b3af40f7
commit
589747856a
@ -74,6 +74,7 @@ type
|
|||||||
procedure ShowShape(View: TfrShapeView; x, y, h, w: integer);
|
procedure ShowShape(View: TfrShapeView; x, y, h, w: integer);
|
||||||
procedure OnText(X, Y: Integer; const Text: string; View: TfrView); override;
|
procedure OnText(X, Y: Integer; const Text: string; View: TfrView); override;
|
||||||
procedure OnData(x, y: Integer; View: TfrView); override;
|
procedure OnData(x, y: Integer; View: TfrView); override;
|
||||||
|
procedure OnExported(x, y: Integer; View: TfrView); override;
|
||||||
public
|
public
|
||||||
property Backend: TlrCairoBackend read fBackend write fBackend;
|
property Backend: TlrCairoBackend read fBackend write fBackend;
|
||||||
end;
|
end;
|
||||||
@ -786,6 +787,14 @@ begin
|
|||||||
|
|
||||||
DataRect := Rect(nx, ny, nx+ndx, ny+ndy);
|
DataRect := Rect(nx, ny, nx+ndx, ny+ndy);
|
||||||
|
|
||||||
|
// enable global clipping only for this view classes
|
||||||
|
// others classes might need clipping only in some cases or
|
||||||
|
// may need another clipping shape.
|
||||||
|
if
|
||||||
|
(View is TfrMemoView)
|
||||||
|
then
|
||||||
|
SaveClipping(@DataRect);
|
||||||
|
|
||||||
if View is TfrShapeView then begin
|
if View is TfrShapeView then begin
|
||||||
|
|
||||||
ShowShape(TfrShapeView(View), nx, ny, ndy, ndx);
|
ShowShape(TfrShapeView(View), nx, ny, ndy, ndx);
|
||||||
@ -799,6 +808,11 @@ begin
|
|||||||
DefaultShowView(View, nx, ny, ndy, ndx);
|
DefaultShowView(View, nx, ny, ndy, ndx);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TlrCairoExportFilter.OnExported(x, y: Integer; View: TfrView);
|
||||||
|
begin
|
||||||
|
RestoreClipping;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
frRegisterExportFilter(TlrCairoExportFilter, 'Cairo Adobe Acrobat PDF (*.pdf)', '*.pdf');
|
frRegisterExportFilter(TlrCairoExportFilter, 'Cairo Adobe Acrobat PDF (*.pdf)', '*.pdf');
|
||||||
frRegisterExportFilter(TlrCairoExportFilter, 'Cairo Postscript (*.ps)', '*.ps');
|
frRegisterExportFilter(TlrCairoExportFilter, 'Cairo Postscript (*.ps)', '*.ps');
|
||||||
|
Loading…
Reference in New Issue
Block a user