LazReport, support in pdf export for roundrect shadows

git-svn-id: trunk@33473 -
This commit is contained in:
jesus 2011-11-11 08:37:23 +00:00
parent fe098f786f
commit d99960207b
3 changed files with 660 additions and 14 deletions

1
.gitattributes vendored
View File

@ -1531,6 +1531,7 @@ components/lazreport/samples/editor/db/companies.dbf -text
components/lazreport/samples/editor/db/countries.dbf -text
components/lazreport/samples/editor/db/disco.dbf -text
components/lazreport/samples/editor/db/disco.mdx -text
components/lazreport/samples/editor/frroundrecttester.lrf svneol=native#text/xml
components/lazreport/samples/editor/languages/calleditorwithpkg.de.po svneol=native#text/plain
components/lazreport/samples/editor/languages/calleditorwithpkg.es.po svneol=native#text/plain
components/lazreport/samples/editor/languages/calleditorwithpkg.fr.po svneol=native#text/plain

View File

@ -0,0 +1,634 @@
<?xml version="1.0" encoding="utf-8"?>
<CONFIG>
<LazReport>
<Version Value="25"/>
<Title Value=""/>
<Subject Value=""/>
<KeyWords Value=""/>
<Comments Value=""/>
<ReportVersionBuild Value=""/>
<ReportVersionMajor Value=""/>
<ReportVersionMinor Value=""/>
<ReportVersionRelease Value=""/>
<ReportAutor Value=""/>
<Pages>
<PrintToDefault Value="False"/>
<DoublePass Value="True"/>
<SelectedPrinter Value="Microsoft Office Document Image Writer"/>
<PageCount Value="1"/>
<Page1>
<Name Value="Page1"/>
<ClassName Value="TfrPageReport"/>
<Visible Value="1"/>
<Width Value="1"/>
<Height Value="1" PageType="0"/>
<PgSize Value="9"/>
<Margins>
<left Value="0"/>
<Top Value="0"/>
<Right Value="0"/>
<Bottom Value="0"/>
</Margins>
<Orientation Value="poPortrait"/>
<UseMargins Value="True"/>
<PrintToPrevPage Value="False"/>
<ColCount Value="1"/>
<ColGap Value="0"/>
<LayoutOrder Value="loColumns"/>
<ObjectCount Value="12"/>
<Object1>
<Name Value="RoundRect1"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="56"/>
<Top Value="44"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value=""/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Curva 10&#xD;&#xA;Ancho de sombra 6&#xD;&#xA;Sin enmarcar&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="0"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="1"/>
<RoundRectCurve Value="10"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object1>
<Object2>
<Name Value="RoundRect2"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="212"/>
<Top Value="44"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clRed"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Curva 10&#xD;&#xA;Ancho de sombra 6&#xD;&#xA;Enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="0"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="1"/>
<RoundRectCurve Value="10"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object2>
<Object3>
<Name Value="RoundRect3"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="368"/>
<Top Value="44"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clYellow"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Curva 20&#xD;&#xA;Ancho de sombra 10&#xD;&#xA;Enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="0"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="10"/>
<RoundRect Value="1"/>
<RoundRectCurve Value="20"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object3>
<Object4>
<Name Value="RoundRect4"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="60"/>
<Top Value="160"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value=""/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Curva disabled&#xD;&#xA;Ancho de sombra 6&#xD;&#xA;Sin enmarcar&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="0"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="0"/>
<RoundRectCurve Value="10"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object4>
<Object5>
<Name Value="RoundRect5"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="216"/>
<Top Value="160"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Curva disabled&#xD;&#xA;Ancho de sombra 6&#xD;&#xA;Enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="0"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="0"/>
<RoundRectCurve Value="10"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object5>
<Object6>
<Name Value="RoundRect6"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="372"/>
<Top Value="160"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clAqua"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="2"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Curva disabled&#xD;&#xA;Ancho de sombra 10&#xD;&#xA;Enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="0"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="10"/>
<RoundRect Value="0"/>
<RoundRectCurve Value="20"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object6>
<Object7>
<Name Value="RoundRect7"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="60"/>
<Top Value="272"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value=""/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Degradado&#xD;&#xA;Vertical&#xD;&#xA;Sin enmarcar&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="1"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="0"/>
<RoundRectCurve Value="0"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object7>
<Object8>
<Name Value="RoundRect8"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="216"/>
<Top Value="272"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Degradado&#xD;&#xA;Horizontal&#xD;&#xA;Enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="1"/>
<GradianStyle Value="gsVertical"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="0"/>
<RoundRectCurve Value="0"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object8>
<Object9>
<Name Value="RoundRect9"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="376"/>
<Top Value="272"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="degradado&#xD;&#xA;Eliptico&#xD;&#xA;Enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="1"/>
<GradianStyle Value="gsElliptic"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="10"/>
<RoundRect Value="0"/>
<RoundRectCurve Value="0"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object9>
<Object10>
<Name Value="RoundRect10"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="60"/>
<Top Value="384"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value=""/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Degradado&#xD;&#xA;rectangulol&#xD;&#xA;Sin enmarcar&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="1"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="1"/>
<RoundRectCurve Value="0"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object10>
<Object11>
<Name Value="RoundRect11"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="216"/>
<Top Value="384"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Degradado&#xD;&#xA;centro horiz.&#xD;&#xA;enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="1"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="1"/>
<RoundRectCurve Value="0"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object11>
<Object12>
<Name Value="RoundRect12"/>
<ClassName Value="TfrRoundRectView"/>
<Visible Value="1"/>
<Typ Value="gtAddIn"/>
<StreamMode Value="0"/>
<Size>
<Left Value="376"/>
<Top Value="384"/>
<Width Value="140"/>
<Height Value="90"/>
</Size>
<Flags Value="3"/>
<FillColor Value="clNone"/>
<Frames>
<FrameColor Value="clBlack"/>
<FrameStyle Value="frsSolid"/>
<FrameWidth Value="1"/>
<FrameBorders Value="frbLeft,frbTop,frbRight,frbBottom"/>
</Frames>
<Data>
<Format Value="558"/>
<FormatStr Value=""/>
<Memo Value="Degradado&#xD;&#xA;centro vert.&#xD;&#xA;enmarcado&#xD;&#xA;"/>
<Script Value=""/>
<ShowGradian Value="1"/>
<GradianStyle Value="gsHorizontal"/>
<ShadowColor Value="clGray"/>
<ShadowWidth Value="6"/>
<RoundRect Value="1"/>
<RoundRectCurve Value="0"/>
</Data>
<Font>
<Name Value="Arial"/>
<Size Value="10"/>
<Color Value="clBlack"/>
<Charset Value="0"/>
<Style Value=""/>
</Font>
<Highlight>
<FontStyle Value="2"/>
<FontColor Value="clBlack"/>
<FillColor Value="clWhite"/>
<HighlightStr Value=""/>
</Highlight>
<Alignment Value="taLeftJustify"/>
<Layout Value="tlTop"/>
<Angle Value="0"/>
</Object12>
</Page1>
<FVal>
<Count Value="0"/>
</FVal>
<ParentVars Value=""/>
</Pages>
</LazReport>
</CONFIG>

View File

@ -354,6 +354,7 @@ procedure TfrTNPDFExportFilter.ShowRoundRect(View: TfrRoundRectView; x, y, h,
w: integer);
var
Data: TShapeData;
SWidth: Integer;
begin
if view.ShowGradian then
@ -363,22 +364,32 @@ begin
else
begin
if View.RoundRect then begin
SWidth := Round((View.RoundRectCurve/2) * PDFEscx + 1);
if View.RoundRect then
Data.Radius := SWidth
else
Data.Radius := 0.0;
Data.ShapeType := frstRoundRect;
Data.FillColor := View.FillColor;
Data.FrameColor := View.FrameColor;
Data.FrameWidth := View.FrameWidth;
Data.FrameStyle := View.FrameStyle;
Data.Radius := View.RoundRectCurve div 2;
// draw shadow
Data.ShapeType := frstRoundRect;
Data.FillColor := ColorToRGB(View.ShadowColor);
Data.FrameColor := Data.FillColor; //ColorToRGB(View.FrameColor);
Data.FrameWidth := 0;
Data.FrameStyle := frsSolid;
SWidth := Round(View.ShadowWidth * PDFEscx + 1);
if View.ShadowWidth>0 then
AddShape(Data, x + SWidth, y + SWidth, h - SWidth, w - SWidth);
AddShape(Data, x, y, h, w);
end else begin
// not supported yet
DefaultShowView(View, x, y, h, w);
end;
// draw roundrect
Data.ShapeType := frstRoundRect;
Data.FillColor := ColorToRGB(View.FillColor);
if View.Frames=[] then
Data.FrameColor := Data.FillColor
else
Data.FrameColor := ColorToRGB(View.FrameColor);
Data.FrameWidth := View.FrameWidth;
Data.FrameStyle := View.FrameStyle;
AddShape(Data, x, y, h - SWidth, w - SWidth);
end;
end;