LazReport: PowerPDF exporter support for vertical and horizontal gradients (require PowerPDF v0.9.15)

git-svn-id: trunk@54156 -
This commit is contained in:
jesus 2017-02-15 07:24:22 +00:00
parent 8a827a4ea7
commit 7595876aee
2 changed files with 28 additions and 16 deletions

View File

@ -1,8 +1,9 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="4">
<PathDelim Value="\"/>
<Name Value="lazreportpdfexport"/>
<Type Value="RunAndDesignTime"/>
<AddToProjectUsesSection Value="True"/>
<Author Value="Jesus Reyes A."/>
<CompilerOptions>
@ -17,12 +18,9 @@
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Description Value="LazReport PDF exporter"/>
<Version Minor="8"/>
<Version Minor="9"/>
<Files Count="2">
<Item1>
<Filename Value="lr_e_pdf.pas"/>
@ -34,7 +32,6 @@
<UnitName Value="lr_pdfexp_reg"/>
</Item2>
</Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="5">
<Item1>
<PackageName Value="IDEIntf"/>
@ -44,7 +41,8 @@
</Item2>
<Item3>
<PackageName Value="pack_powerpdf"/>
<MinVersion Minor="9" Release="10" Valid="True"/>
<MaxVersion Minor="9" Release="10"/>
<MinVersion Minor="9" Release="15" Valid="True"/>
</Item3>
<Item4>
<PackageName Value="lazreport"/>

View File

@ -32,6 +32,8 @@ type
FrameColor: TColor;
Radius: Single;
Corners: TCornerSet;
GradientColor: TColor;
GradientDirection: TGradientDirection;
end;
TfrTNPDFExport = class(TComponent) // fake component
@ -108,6 +110,8 @@ begin
with TPRRect(CreateShape(TPRRect)) do begin
Radius := Data.Radius;
SquaredCorners := TPdfCorners(Data.Corners);
GradientColor := Data.GradientColor;
GradientDirection := Data.GradientDirection;
end;
frstTriangle:
@ -375,7 +379,7 @@ var
SWidth: Integer;
begin
if view.ShowGradian then
if view.ShowGradian and (View.GradianStyle in [gsElliptic, gsHorizCenter, gsVertCenter, gsRectangle]) then
// not supported yet
DefaultShowView(View, x, y, h, w)
@ -390,14 +394,24 @@ begin
Data.Corners:=View.SquaredCorners;
// draw shadow
Data.ShapeType := frstRoundRect;
Data.FillColor := ColorToRGB(View.ShadowColor);
Data.FrameColor := Data.FillColor; //ColorToRGB(View.FrameColor);
Data.FrameWidth := 0;
Data.FrameStyle := frsSolid;
SWidth := trunc(View.ShadowWidth * PDFEscx + 0.5);
if View.ShadowWidth>0 then
AddShape(Data, x + SWidth, y + SWidth, h - SWidth, w - SWidth);
if View.ShowGradian then
begin
Data.GradientColor := View.ShadowColor;
case View.GradianStyle of
gsVertical: Data.GradientDirection := gdVertical;
gsHorizontal: Data.GradientDirection := gdHorizontal;
end;
end else
begin
Data.ShapeType := frstRoundRect;
Data.FillColor := ColorToRGB(View.ShadowColor);
Data.FrameColor := Data.FillColor; //ColorToRGB(View.FrameColor);
Data.FrameWidth := 0;
Data.FrameStyle := frsSolid;
SWidth := trunc(View.ShadowWidth * PDFEscx + 0.5);
if View.ShadowWidth>0 then
AddShape(Data, x + SWidth, y + SWidth, h - SWidth, w - SWidth);
end;
// draw roundrect
Data.ShapeType := frstRoundRect;