unit Darstellen;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPMan,
DB, DBTables, StdCtrls, DBCtrls, ExtCtrls, Mask, ImgList,
ComCtrls, printers, ToolWin;
type
TForm5 =
class(TForm)
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Label25: TLabel;
Label1: TLabel;
Label26: TLabel;
Label27: TLabel;
DBText1: TDBText;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
DBEdit7: TDBEdit;
DBEdit8: TDBEdit;
DBEdit9: TDBEdit;
DBEdit10: TDBEdit;
DBEdit12: TDBEdit;
DBEdit13: TDBEdit;
DBEdit14: TDBEdit;
DBEdit15: TDBEdit;
DBEdit16: TDBEdit;
DBEdit17: TDBEdit;
DBMemo1: TDBMemo;
Button5: TButton;
Table1: TTable;
DataSource1: TDataSource;
XPManifest1: TXPManifest;
ImageList1: TImageList;
PrintDialog1: TPrintDialog;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton3: TToolButton;
ToolButton6: TToolButton;
ToolButton7: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton8: TToolButton;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure ToolButton4Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton6Click(Sender: TObject);
procedure ToolButton7Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form5: TForm5;
implementation
uses Anzeige;
{$R *.dfm}
procedure TForm5.Button1Click(Sender: TObject);
begin
table1.Prior;
end;
procedure TForm5.Button3Click(Sender: TObject);
begin
table1.next;
end;
procedure TForm5.Button4Click(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm5.ToolButton2Click(Sender: TObject);
begin
close;
end;
procedure TForm5.ToolButton3Click(Sender: TObject);
begin
close;
end;
procedure TForm5.ToolButton4Click(Sender: TObject);
begin
table1.Prior;
end;
procedure TForm5.ToolButton5Click(Sender: TObject);
begin
table1.next;
end;
procedure TForm5.ToolButton6Click(Sender: TObject);
var zeile, x, y: integer;
breite, hoehe, randlinks, randoben: integer;
begin
if PrintDialog1.Execute
then begin
Printer.BeginDoc;
//Druckjob beginnen
//Blattgröße in 1/10 mm ermitteln:
breite:=GetDeviceCaps(Printer.Canvas.Handle, HORZSIZE)*10;
hoehe:=GetDeviceCaps(Printer.Canvas.Handle, VERTSIZE)*10;
randlinks:=250;
//2,5 cm
randoben:=250;
//2,5 cm
x:=randlinks;
y:=randoben*-1;
if -y>(hoehe-2*randoben)
then begin
y:=randoben*-1;
Printer.NewPage;
end;
SetMapMode(Printer.Canvas.Handle, MM_LOMETRIC);
//Umstellen auf 1/10 mm
//Schrift-Einstellungen:
Printer.Canvas.Font.
Name:='
Courier New';
Printer.Canvas.Brush.Color:=clWhite;
Printer.Canvas.Font.Height:=50;
//5 mm
if y=-randoben
then begin
Printer.Canvas.Font.Style:=[fsbold];
Printer.Canvas.TextOut(x, y, '
Seite '+
IntToStr(Printer.PageNumber));
Printer.Canvas.Font.Style:=[];
end;
form5.print;
end;
Printer.EndDoc;
end;
procedure TForm5.ToolButton7Click(Sender: TObject);
begin
Form2.Show;
end;
end.