summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorJean-Marc Levecque <jean-marc.levecque@jmlesite.fr>2011-12-22 06:55:08 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-01-18 17:21:37 +0200
commit66144885adf6ef748f710cae03a04727b0d9f590 (patch)
tree806c51e50665ec61eafee201d03df81454055378 /extras
parent1a7c56b8a4099c9cd1355248313d0c9da03437a3 (diff)
downloadfpGUI-66144885adf6ef748f710cae03a04727b0d9f590.tar.xz
Add image to header and footer
Add image to header and footer for display/print to each page of a section Signed-off-by: Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr>
Diffstat (limited to 'extras')
-rw-r--r--extras/contributed/report_tool/demo/u_demo.pas4
-rw-r--r--extras/contributed/report_tool/reportengine/u_command.pas29
2 files changed, 25 insertions, 8 deletions
diff --git a/extras/contributed/report_tool/demo/u_demo.pas b/extras/contributed/report_tool/demo/u_demo.pas
index 390a2a60..c42f9d3b 100644
--- a/extras/contributed/report_tool/demo/u_demo.pas
+++ b/extras/contributed/report_tool/demo/u_demo.pas
@@ -1531,13 +1531,15 @@ with FReport do
// write page number and total of pages on each page
NumPageFooter(cnRight,lnEnd,'Page','of',True,ColDefaut,FtText,IlText);
// paint some images
- ImagePage(30,30,'poppy.jpg',4);
+ ImageHeader(10,12,'poppy.jpg',4);
ImagePage(40,50,'poppy.jpg',3);
ImagePage(50,80,'poppy.jpg',2);
ImagePage(60,140,'poppy.jpg');
ImagePage(100,30,'radiobuttons.bmp');
Page;
ImagePage(80,30,'poppy-nb.jpg');
+ ImagePage(30,120,'poppy.jpg',2);
+ Page;
// preparation is finished, so create PDF objects
EndWrite;
end;
diff --git a/extras/contributed/report_tool/reportengine/u_command.pas b/extras/contributed/report_tool/reportengine/u_command.pas
index 876d9a71..2f51978b 100644
--- a/extras/contributed/report_tool/reportengine/u_command.pas
+++ b/extras/contributed/report_tool/reportengine/u_command.pas
@@ -26,7 +26,7 @@ uses
U_Pdf;
type
- TZone = (zEnTete,zPied,zPage,zMarges);
+ TZone = (zHeader,zFooter,zPage,zMargins);
TSectPageNum = (PageNum,SectNum,PSectNum);
TBorderFlags= set of (bfLeft,bfRight,bfTop,bfBottom);
@@ -76,12 +76,14 @@ type
procedure LoadSpaceGroup(AHeight: Single);
procedure LoadFrame(AStyle: Integer; AZone: TZone);
procedure LoadLine(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
- procedure LoadLineHorizEnTete(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
+ procedure LoadLineHorizHeader(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
procedure LoadLineHorizPage(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
- procedure LoadLineHorizPied(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
+ procedure LoadLineHorizFooter(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
procedure LoadLineHorizGroupe(AHeight: Single);
procedure LoadSurf(APos: T_Points; AColor: TfpgColor);
- procedure LoadImg(APosX,APosY,AImgNum: Integer);
+ procedure LoadImgHeader(APosX,APosY,AImgNum: Integer);
+ procedure LoadImgPage(APosX,APosY,AImgNum: Integer);
+ procedure LoadImgFooter(APosX,APosY,AImgNum: Integer);
function GetCmdPage(NumPage: Integer): TList;
property CmdHeader: TList read FHeader;
property CmdFooter: TList read FFooter;
@@ -353,6 +355,7 @@ var
Sections: TList;
// Columns: TList;
Texts: TStringList;
+ ImageNames: TStringList;
Fonts: TList;
LineSpaces: TList;
BackColors: TList;
@@ -546,7 +549,7 @@ VCommand:= T_Line.Create(APosXBegin,APosYBegin,AColumn,AStyle,APosXEnd,APosYEnd)
T_Page(Pages[Pred(FPages.Count)]).Commands.Add(VCommand);
end;
-procedure T_Section.LoadLineHorizEnTete(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single;
+procedure T_Section.LoadLineHorizHeader(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single;
AStyle: Integer);
begin
VCommand:= T_Line.Create(APosXBegin,APosYBegin,AColumn,AStyle,APosXEnd,APosYEnd);
@@ -559,7 +562,7 @@ VCommand:= T_Line.Create(APosXBegin,APosYBegin,AColumn,AStyle,APosXEnd,APosYEnd)
T_Page(Pages[Pred(FPages.Count)]).Commands.Add(VCommand);
end;
-procedure T_Section.LoadLineHorizPied(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
+procedure T_Section.LoadLineHorizFooter(APosXBegin,APosYBegin: Single; AColumn: Integer; APosXEnd,APosYEnd: Single; AStyle: Integer);
begin
VCommand:= T_Line.Create(APosXBegin,APosYBegin,AColumn,AStyle,APosXEnd,APosYEnd);
FFooter.Add(VCommand);
@@ -576,12 +579,24 @@ VCommand:= T_Surface.Create(APos,AColor);
T_Page(Pages[Pred(FPages.Count)]).Commands.Add(VCommand);
end;
-procedure T_Section.LoadImg(APosX,APosY,AImgNum: Integer);
+procedure T_Section.LoadImgHeader(APosX,APosY,AImgNum: Integer);
+begin
+VCommand:= T_Image.Create(APosX,APosY,AImgNum);
+FHeader.Add(VCommand);
+end;
+
+procedure T_Section.LoadImgPage(APosX,APosY,AImgNum: Integer);
begin
VCommand:= T_Image.Create(APosX,APosY,AImgNum);
T_Page(Pages[Pred(FPages.Count)]).Commands.Add(VCommand);
end;
+procedure T_Section.LoadImgFooter(APosX,APosY,AImgNum: Integer);
+begin
+VCommand:= T_Image.Create(APosX,APosY,AImgNum);
+FFooter.Add(VCommand);
+end;
+
function T_Section.GetCmdPage(NumPage: Integer): TList;
begin
Result:= T_Page(Pages[Pred(NumPage)]).Commands;