1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40:
| Procedure DruAdrEd(IPCanvas:TCanvas; const Edit:TEdit; const LDR:integer; var DZ:integer; const FktZH, FktFo : double); var ZH:integer; Begin With IPCanvas do Begin Font:=Edit.Font; SetFontAusgl(IPCanvas, Edit.Font,FktFo); Textout(LDR,DZ,Edit.Text); ZH:=TextHeight('Y'); DZ:=DZ -Round(ZH*FktZH); End; End; Procedure DruckeAdresse(IPCanvas,:TCanvas; Frm:String; const LDR:integer; var DZ:integer; const FktZH, FktFo : double); if Frm = ' Form1' then begin with Form1 do Begin if EdAdr1.Text<>'' then DruAdrEd(IPCanvas,EdAdr1,LDR,DZ,FktZH,FktFo); if EdAdr2.Text<>'' then DruAdrEd(IPCanvas,EdAdr2,LDR,DZ,FktZH,FktFo); usw... end; end else begin if Frm = ' Form2' then with Form1 do Begin if EdAdr1.Text<>'' then DruckeAdrEd(IPCanvas,EdAdr1,LDR,DZ,FktZH,FktFo); if EdAdr2.Text<>'' then DruckeAdrEd(IPCanvas,EdAdr2,LDR,DZ,FktZH,FktFo); usw... end; end; Abfrage in Haupt-Dru-Routine: if Grid1 = Form1.StringGrid1 then Frm := 'Form1' else if Grid1 = Form2.StringGrid then Frm := ' Form2'; DruckeAdresse( … ); usw… |