unit mt_Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
SUIForm, StdCtrls, RzLabel, ExtCtrls, SUIImagePanel, SUIGroupBox,
RzSpnEdt, RzTrkBar, se_controls, KsSkinSpinButtons, KsSkinButtons, jpeg,
Grids, DBGrids ,inifiles,ActnList,suiThemes, SUITrackBar, RzEdit, SUIEdit,
RzButton, SUIButton, SUIComboBox, RzPanel, Mask, RzDBEdit, RzDBSpin;
type
Tmt_form = class(TForm)
suiMDIForm1: TsuiMDIForm;
RzGroupBox1: TRzGroupBox;
RzGroupBox2: TRzGroupBox;
RzLabel1: TRzLabel;
RzLabel2: TRzLabel;
RzLabel3: TRzLabel;
gypc: TRzEdit;
RzLabel11: TRzLabel;
zy: TRzTrackBar;
zyEdit: TRzSpinEdit;
RzLabel12: TRzLabel;
sx: TRzTrackBar;
sxEdit: TRzSpinEdit;
RzLabel6: TRzLabel;
zy1: TRzSpinEdit;
RzLabel7: TRzLabel;
zy2: TRzSpinEdit;
RzLabel8: TRzLabel;
zy3: TRzSpinEdit;
RzLabel9: TRzLabel;
zy4: TRzSpinEdit;
RzLabel4: TRzLabel;
nd: TRzSpinEdit;
RzLabel5: TRzLabel;
sd: TRzSpinEdit;
RzLabel13: TRzLabel;
zt: TRzSpinEdit;
ComboBox1: TsuiComboBox;
RzButton1: TRzButton;
RzButton2: TRzButton;
qsz: TRzEdit;
RzLabel10: TRzLabel;
dysl: TRzEdit;
RzLabel14: TRzLabel;
RzLabel15: TRzLabel;
zjj: TRzSpinEdit;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure RzButton1Click(Sender: TObject);
procedure zyChange(Sender: TObject);
procedure sxChange(Sender: TObject);
procedure zyEditChange(Sender: TObject);
procedure sxEditChange(Sender: TObject);
procedure RzButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
mt_form: Tmt_form;
aa:string;
implementation
uses dm_unit,Main,usefunction, login_unit;
{$R *.DFM}
var
OldWindowProc: Pointer;
function NewWindowProc(WindowHandle: THandle; TheMessage: LongInt; ParamW: LongInt; ParamL: LongInt): LongInt{$IFDEF WIN32}stdcall;{$ELSE}; export; {$ENDIF}
begin
{ Process the message of your choice here }
if TheMessage = WM_NCLBUTTONDOWN then
begin
if paramW=HTCAPTION then
exit;
end;
{ Exit here and return zero if you want }
{ to stop further processing of the message }
{ Call the old Window procedure to }
{ allow processing of the message. }
NewWindowProc := CallWindowProc(OldWindowProc,WindowHandle,TheMessage,ParamW,ParamL);
end;
procedure Tmt_Form.FormCreate(Sender: TObject);
begin
OldWindowProc := Pointer(SetWindowLong(Handle,GWL_WNDPROC,LongInt(@NewWindowProc)));
// aqfh_form.Height := 586;
// aqfh_form.Width := 693;
end;
procedure Tmt_Form.FormDestroy(Sender: TObject);
begin
SetWindowLong(Handle,GWL_WNDPROC,LongInt(OldWindowProc));
end;
function hzm(hz: String): String;
var aa_:TBitmap;
bb_ : pbyteArray;
cc_ : String;
hz__ : String;
i,j:integer;
begin
Result := '';
aa_ := TBitmap.Create ;
aa_.Height := 32;
aa_.width := 32;
aa_.Canvas.Font.Size := 24;
aa_.Canvas.Font.Style := [fsBold];
aa_.PixelFormat := pf1bit;
aa_.Canvas.TextOut(0,0,hz);
for i := 0 to 31 do
begin
bb_ := pByteArray(aa_.Scanline[i]);
for j := 0 to 3 do
begin
bb_[j] := not bb_[j];
Result := Result + inttohex(bb_[j],2);
end;
end;
aa_.free;
end;
function hzm1(hz: String): String;
var aa_:TBitmap;
bb_ : pbyteArray;
cc_ : String;
hz__ : String;
i,j:integer;
begin
Result := '';
aa_ := TBitmap.Create ;
aa_.Height := 32;
aa_.width := 32;
aa_.Canvas.Font.Size := 13;
aa_.Canvas.Font.Style := [fsBold];
aa_.PixelFormat := pf1bit;
aa_.Canvas.TextOut(0,0,hz);
for i := 0 to 31 do
begin
bb_ := pByteArray(aa_.Scanline[i]);
for j := 0 to 3 do
begin
bb_[j] := not bb_[j];
Result := Result + inttohex(bb_[j],2);
end;
end;
aa_.free;
end;
//第一批面值代号
{procedure Tmt_form.ComboBox1Change(Sender: TObject);
begin
case combobox1.ItemIndex of
0: aa:='01';
1: aa:='02';
2: aa:='03';
3: aa:='04';
end;
end; }
//第二批面值代号
procedure Tmt_form.ComboBox1Change(Sender: TObject);
begin
case combobox1.ItemIndex of
0: aa:='03';
1: aa:='07';
2: aa:='09';
3: aa:='05';
end;
end;
//第三批面值代号
{procedure Tmt_form.ComboBox1Change(Sender: TObject);
begin
case combobox1.ItemIndex of
0: aa:='08';
1: aa:='06';
2: aa:='04';
3: aa:='02';
end;
end; }
//第4批面值代号
{procedure Tmt_form.ComboBox1Change(Sender: TObject);
begin
case combobox1.ItemIndex of
0: aa:='09';
1: aa:='01';
2: aa:='07';
3: aa:='03';
end;
end; }
procedure Tmt_form.RzButton1Click(Sender: TObject);
var f:textfile;
yue,kao,tm_,ys_,ys,dwmc,dwmc_,temp_Str,temp_str_,Comp_flag,comp_flag_,js_,js,CompA_str,compa_str_,qsx_,qsy_,hzdy_,hzdy_1,hzdy_2,hzdy_3,hzdy_4,hzdy_5,hzdy_6,hzdy_7,cpmcx_1,cpmcx_2,cpmcx_3,bqy_1,bqy_2,bqy_3,bqx_1,bqx_2,bqx_3: string;
zs,wz,wz_xx,i,j,l,m,zkCount,zkcount_,zkCount1,zkCount2,total_,sum_ : integer;
systime:Tsystemtime;
begin
if combobox1.Text = '' then
begin
normal_mess('请选择中奖值!',macos);
abort;
end;
if gypc.Text = '' then
begin
normal_mess('请输入供应批次!',macos);
abort;
end;
if qsz.Text = '' then
begin
normal_mess('请输入起始值!',macos);
abort;
end;
if dysl.Text = '' then
begin
normal_mess('请输入打印数量!',macos);
abort;
end;
if ty_mess('确认打印么?',macos) then
begin
if length(gypc.text) < 2 then gypc.Text:='0'+gypc.text;
total_:=strtoint(qsz.Text);
Getsystemtime(systime);
if systime.wmonth<10 then
yue := '0'+inttostr(systime.wmonth)
else
yue := inttostr(systime.wmonth);
AssignFile(F,'LPT1'); // LPT1 'e:\aaa.txt'
Rewrite(F);
Write(F,'~EG');
dwmc:= combobox1.Text;
dwmc_:='人民币';
Write(F,'~PP^XA^MD'+nd.Text+'^PR'+sd.Text+','+sd.Text+','+sd.Text+'^CF0,28');
kao:=qsz.text;
for i:=1 to 5-length(qsz.text) do
begin
kao:='0'+kao
end;
//第1
// tm_:=aa+gypc.text+copy(inttostr(systime.wyear),4,1)+yue+kao;
//第2
tm_:=gypc.text+copy(inttostr(systime.wyear),4,1)+yue+aa+kao;
//第3
// tm_:=gypc.text+aa+copy(inttostr(systime.wyear),4,1)+yue+kao;
//第4
// tm_:=gypc.text+copy(inttostr(systime.wyear),4,1)+aa+yue+kao;
write(F,'^XA^FO'+IntToStr(22+zy.Position+strtoint(zy1.text))+','+IntToStr(sx.Position+160)+'^BY2,2^BEN,30,Y,N^FV>;'+tm_+'^FS');
total_:=total_+1;
kao:=inttostr(total_);
for i:=1 to 5-length(inttostr(total_)) do
begin
kao:='0'+kao
end;
//第1
// tm_:=aa+gypc.text+copy(inttostr(systime.wyear),4,1)+yue+kao;
//第2
tm_:=gypc.text+copy(inttostr(systime.wyear),4,1)+yue+aa+kao;
//第3
// tm_:=gypc.text+aa+copy(inttostr(systime.wyear),4,1)+yue+kao;
//第4
// tm_:=gypc.text+copy(inttostr(systime.wyear),4,1)+aa+yue+kao;
write(F,'^FO'+IntToStr(296+zy.Position+strtoint(zy2.text))+','+IntToStr(sx.Position+160)+'^BY2,2^BEN,30,Y,N^FV>;'+tm_+'^FS');
total_:=total_+1;
kao:=inttostr(total_);
for i:=1 to 5-length(inttostr(total_)) do
begin
kao:='0'+kao
end;
//第1
// tm_:=aa+gypc.text+copy(inttostr(systime.wyear),4,1)+yue+kao;
//第2
tm_:=gypc.text+copy(inttostr(systime.wyear),4,1)+yue+aa+kao;
//第3
// tm_:=gypc.text+aa+copy(inttostr(systime.wyear),4,1)+yue+kao;
//第4
// tm_:=gypc.text+copy(inttostr(systime.wyear),4,1)+aa+yue+kao;
write(F,'^FO'+IntToStr(570+zy.Position+strtoint(zy3.text))+','+IntToStr(sx.Position+1
aa.rar_delphi打印_print_zebra delphi_打印_条码打印机
版权申诉
5星 · 超过95%的资源 146 浏览量
2022-09-22
17:47:48
上传
评论
收藏 4KB RAR 举报
邓凌佳
- 粉丝: 65
- 资源: 1万+
评论1