diff options
author | Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr> | 2011-03-28 14:16:22 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-03-28 14:16:22 +0200 |
commit | e8c4e7ec1ee4f757be230bf96cbe90fe6ae7e0e0 (patch) | |
tree | 962210fa48167d4b56c87c910cf34ebcca85f468 | |
parent | 70ee92aeba31b4325342ed86f6b7032db4ef88a3 (diff) | |
download | fpGUI-e8c4e7ec1ee4f757be230bf96cbe90fe6ae7e0e0.tar.xz |
PDF reports: grid improvement in managing borders and
colors.
-rw-r--r-- | extras/contributed/report_tool/demo/u_demo.pas | 94 | ||||
-rw-r--r-- | extras/contributed/report_tool/reportengine/u_imprime.pas | 91 |
2 files changed, 129 insertions, 56 deletions
diff --git a/extras/contributed/report_tool/demo/u_demo.pas b/extras/contributed/report_tool/demo/u_demo.pas index 7ce96c01..0759bbec 100644 --- a/extras/contributed/report_tool/demo/u_demo.pas +++ b/extras/contributed/report_tool/demo/u_demo.pas @@ -1106,11 +1106,12 @@ with Imprime do // write page number and total of pages on each page NumPagePied(cnRight,lnFin,'Page','of',True,ColDefaut,FtTexte,IlTexte); // draw thin frame rectangle at margins - CadreMarges(TsFin); +// CadreMarges(TsFin); // draw thick frame rectangle at header CadreEnTete(TsEpais); // draw thick frame rectangle at footer CadrePied(TsNorm); + CadrePage(TsEpais); // preparation is finished, so create PDF objects Fin; end; @@ -1232,12 +1233,25 @@ end; procedure TF_Demo.ImprimeGrid(Preview: Boolean); var - FtTitre,FtTexte,FtSTitre: Integer; - TsFinNoir: Integer; + FtTitre,FtTexte,FtTexteBlue,FtTexteRed,FtSTitre: Integer; + TsFinNoir,TsEpaisBleu: Integer; IlTitre,IlTexte: Integer; + FdBeige: Integer; Col: array[1..5] of Integer; - BdColn,BdFinCol: Integer; + BdColn,BdColnG,BdColnD: Integer; CptLig,CptCol: Integer; + PosHoriz,PredPosHoriz: Single; +const + Col1Pos= 20; + Col1Wid= 40; + Col2Pos= 60; + Col2Wid= 35; + Col3Pos= 95; + Col3Wid= 35; + Col4Pos= 130; + Col4Wid= 35; + Col5Pos= 165; + Col5Wid= 35; begin with Imprime do begin @@ -1248,21 +1262,27 @@ with Imprime do // create the fonts to be used (use one of the 14 Adobe PDF standard fonts) FtTitre:= Fonte('helvetica-15:bold',clBlack); FtTexte:= Fonte('helvetica-7',clBlack); + FtTexteBlue:= Fonte('helvetica-7',clBlue); + FtTexteRed:= Fonte('helvetica-7',clRed); FtSTitre:= Fonte('helvetica-9:bold:italic',clBlue); // create the style of lines to be used - TsFinNoir:= StyleTrait(1,clBlack,lsSolid); + TsFinNoir:= StyleTrait(0.5,clBlack,lsSolid); + TsEpaisBleu:= StyleTrait(1.5,clBlue,lsSolid); // create line spacings to be used IlTitre:= Interligne(3,0,3); IlTexte:= Interligne(1,0,0); + // define column background color + FdBeige:= Fond(clBeige); // define column borders - BdColn:= Bordure([bcGauche,bcDroite,bcHaut],TsFinNoir); - BdFinCol:= Bordure([bcGauche,bcDroite,bcHaut,bcBas],TsFinNoir); + BdColn:= Bordure([bcGauche,bcDroite],TsFinNoir); + BdColnG:= Bordure([bcGauche],TsEpaisBleu); + BdColnD:= Bordure([bcDroite],TsEpaisBleu); // create columns to be used - Col[1]:= Colonne(20,40,2); - Col[2]:= Colonne(60,35,2); - Col[3]:= Colonne(95,35,2); - Col[4]:= Colonne(130,35,2); - Col[5]:= Colonne(165,35,2); + Col[1]:= Colonne(Col1Pos,Col1Wid,2); + Col[2]:= Colonne(Col2Pos,Col2Wid,2); + Col[3]:= Colonne(Col3Pos,Col3Wid,2); + Col[4]:= Colonne(Col4Pos,Col4Wid,2); + Col[5]:= Colonne(Col5Pos,Col5Wid,2); // write title on each page EcritEnTete(cnCenter,lnFin,'SHOWING GRIDS',ColDefaut,FtTitre,IlTitre); // write page number and total of pages on each page @@ -1278,22 +1298,56 @@ with Imprime do EcritPage(cnLeft,lnCourante,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte); EspacePage(5); // write a grid with borders - EcritPage(cnCenter,lnFin,'Grid with borders',ColDefaut,FtSTitre,IlTitre); + PosHoriz:= EcritPage(cnCenter,lnFin,'Grid with borders and colors',ColDefaut,FtSTitre,IlTitre); + TraitPage(Col1Pos,PosHoriz,Col5Pos+Col5Wid,PosHoriz,TsEpaisBleu); for CptLig:= 1 to 10 do for CptCol:= 1 to 5 do - if CptCol= 5 + if CptCol= 1 then - if CptLig= 10 + if CptLig mod 2= 0 then - EcritPage(cnLeft,lnFin,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,-1,BdFinCol) + EcritPage(cnLeft,lnCourante,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,FdBeige,BdColnG) else - EcritPage(cnLeft,lnFin,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,-1,BdColn) + EcritPage(cnLeft,lnCourante,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexteBlue,IlTexte,-1,BdColnG) else - if CptLig= 10 + if CptCol= 5 then - EcritPage(cnLeft,lnCourante,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,-1,BdFinCol) + if CptLig= 10 + then + begin + PredPosHoriz:= PosHoriz; + PosHoriz:= EcritPage(cnLeft,lnFin,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexteRed,IlTexte,FdBeige,BdColnD); + TraitPage(Col1Pos,PredPosHoriz,Col5Pos+Col5Wid,PredPosHoriz,TsFinNoir); + TraitPage(Col1Pos,PosHoriz,Col5Pos+Col5Wid,PosHoriz,TsEpaisBleu); + TraitPage(Col5Pos,PredPosHoriz,Col5Pos,PosHoriz,TsFinNoir); + end + else + begin + if CptLig= 1 + then + PosHoriz:= EcritPage(cnLeft,lnFin,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,-1,BdColnD) + else + if CptLig mod 2= 0 + then + begin + PredPosHoriz:= PosHoriz; + PosHoriz:= EcritPage(cnLeft,lnFin,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexteRed,IlTexte,FdBeige,BdColnD); + TraitPage(Col1Pos,PredPosHoriz,Col5Pos+Col5Wid,PredPosHoriz,TsFinNoir); + TraitPage(Col5Pos,PredPosHoriz,Col5Pos,PosHoriz,TsFinNoir); + end + else + begin + PredPosHoriz:= PosHoriz; + PosHoriz:= EcritPage(cnLeft,lnFin,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,-1,BdColnD); + TraitPage(Col1Pos,PredPosHoriz,Col5Pos+Col5Wid,PredPosHoriz,TsFinNoir); + end; + end else - EcritPage(cnLeft,lnCourante,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,-1,BdColn); + if CptLig mod 2= 0 + then + EcritPage(cnLeft,lnCourante,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexte,IlTexte,FdBeige,BdColn) + else + EcritPage(cnLeft,lnCourante,'line '+IntToStr(CptLig)+' ; column '+IntToStr(CptCol),Col[CptCol],FtTexteBlue,IlTexte,-1,BdColn); // preparation is finished, so create PDF objects Fin; end; diff --git a/extras/contributed/report_tool/reportengine/u_imprime.pas b/extras/contributed/report_tool/reportengine/u_imprime.pas index 415f8590..1cced2b4 100644 --- a/extras/contributed/report_tool/reportengine/u_imprime.pas +++ b/extras/contributed/report_tool/reportengine/u_imprime.pas @@ -57,6 +57,7 @@ type FGroupe: Boolean; FDefaultFile: string; function Dim2Pixels(Value: Single): Single; + function Pixels2Dim(Value: Single): Single; function AddLineBreaks(const Txt: TfpgString; AMaxLineWidth: integer; AFnt: TfpgFont): string; function TxtHeight(AWid: Integer; const ATxt: TfpgString; AFnt: TfpgFont; ALSpace: Integer= 2): Integer; function ConvertitEnAlpha(Valeur: Integer): string; @@ -69,11 +70,11 @@ type procedure DecaleLignesPied(Decalage: Single); procedure DecaleLigne(Decalage: Single); procedure DecaleGroupe(Decalage: Single); - procedure EcritLigne(PosX,PosY: Single; Colonne,Texte,FonteNum,FondNum,BordNum,InterL: Integer; - TxtFlags: TFTextFlags; Zone: TZone); - procedure EcritNum(PosX,PosY: Single; Colonne,TexteNum,TexteTot,FonteNum,FondNum,BordNum,InterL: Integer; - TxtFlags: TFTextFlags; Total,Alpha: Boolean; Zone: TZone; SPNum: TSectPageNum); - procedure InsereEspace(PosY: Single; Colonne: Integer; EspHeight: Single; FondNum: Integer; Zone: TZone); + function EcritLigne(PosX,PosY: Single; Colonne,Texte,FonteNum,FondNum,BordNum,InterL: Integer; + TxtFlags: TFTextFlags; Zone: TZone): Single; + function EcritNum(PosX,PosY: Single; Colonne,TexteNum,TexteTot,FonteNum,FondNum,BordNum,InterL: Integer; + TxtFlags: TFTextFlags; Total,Alpha: Boolean; Zone: TZone; SPNum: TSectPageNum): Single; + function InsereEspace(PosY: Single; Colonne: Integer; EspHeight: Single; FondNum: Integer; Zone: TZone): Single; procedure FinLigne(Zone: TZone); procedure TraceCadre(StTrait: Integer; Zone: TZone); procedure TraceTrait(XDebut,YDebut,XFin,YFin: Single; StTrait: Integer); @@ -135,9 +136,9 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 - procedure EcritPage(Horiz,Verti: Single; Texte: string; ColNum: Integer= 0; FonteNum: Integer= 0; - InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); + // BordNum = border reference, if > -1 + function EcritPage(Horiz,Verti: Single; Texte: string; ColNum: Integer= 0; FonteNum: Integer= 0; + InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1): Single; // Horiz = horizontal position in column (cnLeft,cnCenter,cnRight) // or numeric value in the measurement unit (msMM or msInch) // Verti = line position in column (lnCourante,lnFin) @@ -147,7 +148,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure EcritPied(Horiz,Verti: Single; Texte: string; ColNum: Integer= 0; FonteNum: Integer= 0; InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); // Horiz = horizontal position in column (cnLeft,cnCenter,cnRight) @@ -159,7 +160,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure NumSectionEnTete(Horiz,Verti: Single; TexteSect: string= ''; TexteTot: string= ''; Total: Boolean= False; Alpha: Boolean= False; ColNum: Integer= 0; FonteNum: Integer= 0; InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); @@ -175,7 +176,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure NumSectionPied(Horiz,Verti: Single; TexteSect: string= ''; TexteTot: string= ''; Total: Boolean= False; Alpha: Boolean= False; ColNum: Integer= 0; FonteNum: Integer= 0; InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); @@ -191,7 +192,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure NumPageEnTete(Horiz,Verti: Single; TextePage: string= ''; TexteTotal: string= ''; Total: Boolean= False; ColNum: Integer= 0; FonteNum: Integer= 0; InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); @@ -206,7 +207,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure NumPagePied(Horiz,Verti: Single; TextePage: string= ''; TexteTotal: string= ''; Total: Boolean= False; ColNum: Integer= 0; FonteNum: Integer= 0; InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); @@ -221,7 +222,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure NumPageSectionEnTete(Horiz,Verti: Single; TexteSect: string= ''; TexteTot: string= ''; Total: Boolean= False; Alpha: Boolean= False; ColNum: Integer= 0; FonteNum: Integer= 0; InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); @@ -236,7 +237,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure NumPageSectionPied(Horiz,Verti: Single; TexteSect: string= ''; TexteTot: string= ''; Total: Boolean= False; Alpha: Boolean= False; ColNum: Integer= 0; FonteNum: Integer= 0; InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); @@ -251,7 +252,7 @@ type // FonteNum = font reference // InterNum = space between lines reference // CoulFdNum = background color reference, if > -1, replaces the column background color if any - // BordNum = border reference, if> -1 + // BordNum = border reference, if > -1 procedure TraitHorizEnTete(EspAvant,EspApres: Single; ColNum: Integer= 0; StyleNum: Integer= 0); // EspAvant = empty space before the horizontal line : numeric value in the measurement unit (msMM or msInch) // EspApres = empty space after the horizontal line : numeric value in the measurement unit (msMM or msInch) @@ -434,6 +435,7 @@ const cnLeft= -2; cnCenter= -3; cnRight= -4; + PPI= 72; implementation @@ -442,7 +444,6 @@ uses const InchToMM= 25.4; - PPI= 72; Cent= 100; function T_Imprime.Dim2Pixels(Value: Single): Single; @@ -454,6 +455,15 @@ else Result:= Value*PPI; end; +function T_Imprime.Pixels2Dim(Value: Single): Single; +begin +if FMesure= msMM +then + Result:= Value*InchToMM/PPI +else + Result:= Value/PPI; +end; + function T_Imprime.AddLineBreaks(const Txt: TfpgString; AMaxLineWidth: integer; AFnt: TfpgFont): string; var i,n,ls: integer; @@ -904,8 +914,8 @@ with AGroupe do end; end; -procedure T_Imprime.EcritLigne(PosX,PosY: Single; Colonne,Texte,FonteNum,FondNum,BordNum,InterL: Integer; - TxtFlags: TFTextFlags; Zone: TZone); +function T_Imprime.EcritLigne(PosX,PosY: Single; Colonne,Texte,FonteNum,FondNum,BordNum,InterL: Integer; + TxtFlags: TFTextFlags; Zone: TZone): Single; var PosH,PosV,IntlInt,IntLSup,IntLInf,EpaisTrait: Single; HTxt,HautTxt,Half,CoulTrait,Cpt: Integer; @@ -1103,13 +1113,14 @@ with T_Section(Sections[Pred(NumeroSection)]) do PosH:= T_Colonne(Colonnes[Colonne]).GetTextPos; if (txtRight in TxtFlags) then - PosH:= PosH+T_Colonne(Colonnes[ColDefaut]).ColWidth-Fnt.TextWidth(Textes[Texte])-T_Colonne(Colonnes[ColDefaut]).ColMargin; + PosH:= PosH+T_Colonne(Colonnes[Colonne]).ColWidth-Fnt.TextWidth(Textes[Texte])-T_Colonne(Colonnes[Colonne]).ColMargin; if (txtHCenter in TxtFlags) then - PosH:= PosH+(T_Colonne(Colonnes[ColDefaut]).ColWidth-Fnt.TextWidth(Textes[Texte]))/2; + PosH:= PosH+(T_Colonne(Colonnes[Colonne]).ColWidth-Fnt.TextWidth(Textes[Texte]))/2; end; FPosRef.X:= PosH+Fnt.TextWidth(Textes[Texte]+' '); ALigne.LoadTexte(PosH,PosV,Colonne,Texte,FonteNum,HTxt,FondNum,BordNum,InterL,UseCurFont,TxtFlags); + Result:= Pixels2Dim(FPosRef.Y); if FinDeLigne then begin @@ -1333,8 +1344,8 @@ with T_Section(Sections[Pred(NumeroSection)]) do end; end; -procedure T_Imprime.EcritNum(PosX,PosY: Single; Colonne,TexteNum,TexteTot,FonteNum,FondNum,BordNum,InterL: Integer; - TxtFlags: TFTextFlags; Total,Alpha: Boolean; Zone: TZone; SPNum: TSectPageNum); +function T_Imprime.EcritNum(PosX,PosY: Single; Colonne,TexteNum,TexteTot,FonteNum,FondNum,BordNum,InterL: Integer; + TxtFlags: TFTextFlags; Total,Alpha: Boolean; Zone: TZone; SPNum: TSectPageNum): Single; function BuildChaine: string; var @@ -1510,24 +1521,25 @@ with T_Section(Sections[Pred(NumeroSection)]) do PosH:= PosX else begin - PosH:= T_Colonne(Colonnes[Colonne]).GetTextPos-T_Colonne(Colonnes[ColDefaut]).ColMargin; + PosH:= T_Colonne(Colonnes[Colonne]).GetTextPos-T_Colonne(Colonnes[Colonne]).ColMargin; if (txtRight in TxtFlags) then if Total then - PosH:= PosH+T_Colonne(Colonnes[ColDefaut]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 '+Textes[TexteTot]+' 0 ')-T_Colonne(Colonnes[ColDefaut]).ColMargin + PosH:= PosH+T_Colonne(Colonnes[Colonne]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 '+Textes[TexteTot]+' 0 ')-T_Colonne(Colonnes[Colonne]).ColMargin else - PosH:= PosH+T_Colonne(Colonnes[ColDefaut]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 ')-T_Colonne(Colonnes[ColDefaut]).ColMargin; + PosH:= PosH+T_Colonne(Colonnes[Colonne]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 ')-T_Colonne(Colonnes[Colonne]).ColMargin; if (txtHCenter in TxtFlags) then if Total then - PosH:= PosH+(T_Colonne(Colonnes[ColDefaut]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 '+Textes[TexteTot]+' 0 '))/2 + PosH:= PosH+(T_Colonne(Colonnes[Colonne]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 '+Textes[TexteTot]+' 0 '))/2 else - PosH:= PosH+(T_Colonne(Colonnes[ColDefaut]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 '))/2; + PosH:= PosH+(T_Colonne(Colonnes[Colonne]).ColWidth-Fnt.TextWidth(Textes[TexteNum]+' 0 '))/2; end; FPosRef.X:= PosH+Fnt.TextWidth(Textes[TexteNum]+' 0 '+Textes[TexteTot]+' 0 '); ALigne.LoadNumero(PosH,PosV,Colonne,TexteNum,TexteTot,FonteNum,HTxt,FondNum,BordNum,InterL,UseCurFont,TxtFlags,Total,Alpha,SPNum); + Result:= Pixels2Dim(FPosRef.Y); if FinDeLigne then begin @@ -1720,7 +1732,7 @@ with T_Section(Sections[Pred(NumeroSection)]) do end; end; -procedure T_Imprime.InsereEspace(PosY: Single; Colonne: Integer; EspHeight: Single; FondNum: Integer; Zone: TZone); +function T_Imprime.InsereEspace(PosY: Single; Colonne: Integer; EspHeight: Single; FondNum: Integer; Zone: TZone): Single; var PosV: Single; begin @@ -1768,6 +1780,7 @@ with T_Section(Sections[Pred(NumeroSection)]) do if FGroupe then LoadEspaceGroupe(EspHeight); + Result:= Pixels2Dim(FPosRef.Y); FinLigne(Zone); end; ppVisualise: @@ -1867,8 +1880,8 @@ with T_Section(Sections[Pred(NumeroSection)]) do begin DrawLine(MargeL+Half,MargeT+EnTeteH,MargeL+Half,MargeB-PiedH); // gauche DrawLine(MargeR-Half,MargeT+EnTeteH,MargeR-Half,MargeB-PiedH); // droite - DrawLine(MargeL,MargeT+EnTeteH+Half,MargeR,MargeT+EnTeteH+Half); // haute - DrawLine(MargeL,MargeB-PiedH-Half,MargeR,MargeB-PiedH-Half); // basse + DrawLine(MargeL,MargeT+EnTeteH-Half,MargeR,MargeT+EnTeteH-Half); // haute + DrawLine(MargeL,MargeB-PiedH+Half,MargeR,MargeB-PiedH+Half); // basse end; zPied: begin @@ -1911,8 +1924,8 @@ with T_Section(Sections[Pred(NumeroSection)]) do zPage: begin FGauche:= L; - FBas:= Paper.H-B-FPiedHeight; - FHaut:= Paper.H-T-FEnTeteHeight-B-FPiedHeight; + FBas:= Paper.H-B+FPiedHeight; + FHaut:= B-T-FEnTeteHeight-FPiedHeight; FLarg:= R-L; end; zPied: @@ -2316,6 +2329,12 @@ ABord:= T_Bord.Create(BdFlags,BdStyle); Result:= Bords.Add(ABord); end; +//function T_Imprime.Bordure(BdFlags: TFBordFlags; StFlags: array of Integer): Integer; +//begin +//ABord:= T_Bord.Create(BdFlags,BdStyle); +//Result:= Bords.Add(ABord); +//end; + function T_Imprime.Colonne(ClnPos,ClnWidth: Single; ClnMargin: Single= 0; ClnColor: TfpgColor= clWhite): Integer; var CPos,CWidth,CMargin: Single; @@ -2368,8 +2387,8 @@ then EcritLigne(Horiz,Verti,ColNum,RefTexte,FonteNum,CoulFdNum,BordNum,InterNum,Flags,ZEnTete); end; -procedure T_Imprime.EcritPage(Horiz,Verti: Single; Texte: string; ColNum: Integer= 0; FonteNum: Integer= 0; - InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1); +function T_Imprime.EcritPage(Horiz,Verti: Single; Texte: string; ColNum: Integer= 0; FonteNum: Integer= 0; + InterNum: Integer= 0; CoulFdNum: Integer= -1; BordNum: Integer= -1): Single; var RefTexte: Integer; Flags: TFTextFlags; @@ -2397,7 +2416,7 @@ RefTexte:= Textes.IndexOf(Texte); if RefTexte= -1 then RefTexte:= Textes.Add(Texte); -EcritLigne(Horiz,Verti,ColNum,RefTexte,FonteNum,CoulFdNum,BordNum,InterNum,Flags,ZPage); +Result:= EcritLigne(Horiz,Verti,ColNum,RefTexte,FonteNum,CoulFdNum,BordNum,InterNum,Flags,ZPage); end; procedure T_Imprime.EcritPied(Horiz,Verti: Single; Texte: string; ColNum: Integer= 0; FonteNum: Integer= 0; |