Kod: Tümünü seç
unit Print;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
PrintPort=(Lpt1,Lpt2);
FPrint = class(TComponent)
private
{ Private declarations }
Prt :PrintPort;
TrControl :Boolean;
function Kontrol(Deg:String):String;
function Yaz(Kar:Byte):Boolean;
Procedure SetPort(Value:PrintPort);
// Procedure SetTr(Value:Boolean);
protected
{ Protected declarations }
public
{ Public declarations }
procedure Lprint(Han:Boolean;Deg:String);
Procedure Dar;
Procedure Normal;
Procedure Genis;
published
Property Lpt:PrintPort Read Prt Write SetPort;
// Property Turkce_Kontrol:Boolean Read TrControl Write SetTr Default True;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Facom', [FPrint]);
end;
{Procedure FPrint.SetTr(Value:Boolean);
begin
TrControl:=Value;
end;}
Procedure FPrint.SetPort(Value:PrintPort);
begin
Prt:=Value;
end;
Procedure FPrint.Genis;
begin
Yaz(14);
end;
Procedure FPrint.Dar;
begin
Yaz(15);
Yaz(15);
end;
Procedure FPrint.Normal;
begin
Yaz(18);
end;
function FPrint.Kontrol(Deg:String):String;
var A:Integer;
begin
FOR a := 1 TO Length(Deg) do
if copy(Deg, A, 1) = 'İ' Then
Deg[A]:= '˜'
else if copy(Deg, A, 1) = 'ı' Then
Deg[A]:= ''
else if copy(Deg, A, 1) = 'Ü' Then
Deg[A]:= 'š'
else if copy(Deg, A, 1) = 'Ş' Then
Deg[A]:= 'ž'
else if copy(Deg, A, 1) = 'Ç' Then
Deg[A]:= '€'
else if copy(Deg, A,1) = 'Ö' Then
Deg[A]:= '™'
else if copy(Deg, A, 1) = 'ö' Then
Deg[A]:= '”'
else if copy(Deg, A, 1) = 'ç' Then
Deg[A]:= '‡'
else if copy(Deg, A, 1) = 'Ğ' Then
Deg[A]:= '¦'
else if copy(Deg, A, 1) = 'ğ' Then
Deg[A]:= '§'
else if copy(Deg, A, 1) = 'ü' Then
Deg[A]:= ''
else if copy(Deg, A, 1) = 'ş' Then
Deg[A]:= 'Ÿ'
else if copy(Deg, A, 1) = '' Then
Deg[A]:= '';
Result:=Deg;
end;
function FPrint.Yaz(Kar:Byte):Boolean;
var Han:Word;
begin
if Prt=Lpt1 then
Han:=0
else if Prt=Lpt2 then
Han:=1
else Han:=0;
asm
mov ah,0
mov Al,Kar
mov Dx,Han
Int 17h
end;
end;
procedure FPrint.Lprint(Han:Boolean;Deg:String);
var A:Integer;
begin
// if TrControl then
Deg:=Kontrol(Deg);
for a:=1 to Length(Deg) do
Yaz(Ord(Deg[a]));
if Han Then
begin
Yaz(10);
Yaz(13);
end;
end;
end.
Bu da komponenti Arşivimden