📄 stepmain.~pas
字号:
end;//case
for i:=0 to 2 do begin
MListfilename(listbox,Path,GShow_title(tmp,',',3),fintli);
tmp:=GShow_title(tmp,',',4);
end;
end;
Procedure TmainF.ClearAllObject;
begin
with MainF do begin
LabelTop.Visible:=false;
Panel3.Visible:=false;
Panel4.Visible:=false;
Panel5.Visible:=false;
Panel6.Visible:=false;
Panel7.Visible:=false;
Panel8.Visible:=false;
Panel9.Visible:=false;
labelend.Visible:=false;
//************************//
//alClient
LabelTop.Align:=alNone;
panel3.Align:=alNone;
Panel4.Align:=alNone;
Panel5.Align:=alNone;
Panel6.Align:=alNone;
Panel7.Align:=alNone;
Panel8.Align:=alNone;
Panel9.Align:=alNone;
labelend.Align:=alNone;
end;
end;
Procedure TheEndFunction(li:integer);
var i:integer;
begin
with mainf do
for i:=0 to listbox3.Items.Count-1 do begin
GProOption.IJPeg.Free;
GProOption.IBmp.Free;
GProOption.IJPeg := TJPegImage.Create;
GProOption.IBmp := TBitmap.Create;
GProOption.FileName:=ShellTreeView1.Path+'\'+ListBox3.Items[i];
if uppercase(GShow_title(GProOption.FileName,'.',4)) = uppercase('bmp')
then begin
GProOption.IBmp.LoadFromFile(GProOption.FileName);
GProOption.IJPeg:=G_BMPToJPeg(GProOption.IBmp);
end
else if uppercase(GShow_title(GProOption.FileName,'.',4)) = uppercase('jpg')
then begin
GProOption.IJPeg.LoadFromFile(GProOption.FileName);
GProOption.IBmp:=G_JPegToBMP(GProOption.IJPeg);
end;
image7.Picture.Bitmap:=GProOption.IBmp;
MDraw_(image7,RadioGroup3.ItemIndex,M_address[i]);
case li of
0:image7.Picture.SaveToFile(GShow_title(GProOption.filename,'.',3)+'spr.bmp');
1:G_savejpeg(image7.Picture.Bitmap, GShow_title(GProOption.filename,'.',3)+'spr.jpg',TrackBar1.Position);
end;
ProgressBar1.Position:=i;
end;
end;
Procedure TmainF.StepProcedure;
var add,i:integer;
begin
ClearAllObject;
case MStep of
-1:begin
LabelTop.Visible:=true;
LabelTop.Align:=alClient;
label11.Caption:='您正在使用的版为: '+GShow_title(about.Label9.Caption,'.',2)+' 中组部识别号:'+
GShow_title(GShow_title(about.Label9.Caption,'.',1),'(',3);
Button1.Enabled:=false;
Button2.Caption:='开始使用';
Button3.Enabled:=true;
GroupBox1.Caption:=' 十分感谢您下载并使用此程序-----SPR中央宣传部 '
end;
0:begin
GroupBox1.Caption:='第一步 选择原始路径或文件';
label11.Caption:='';
Button1.Enabled:=true;
Button3.Enabled:=false;
Button2.Caption:='下一步';
Panel3.Visible:=true;
panel3.Align:=alClient;
MCreateListfile(listbox1,ShellTreeView1.Path,GProOption.FFileName,GProOption.FindLi,0);
Label11.Caption:='所选路径:'+ShellTreeView1.Path+'\';
end;
1:begin
Label10.Caption:='欢迎使用此向导';
if listbox1.Items.Count = 0
then begin
//步数跳转
Label10.Caption:='错误:没有任何支持文件,不能继续';
MStep:=0;
StepProcedure;
end
else begin
Panel4.Visible:=true;
panel4.Align:=alClient;
case RadioGroup1.ItemIndex of
0:begin
CheckListBox1.Items.Clear;
CheckListBox1.Items:=listbox1.Items;
GroupBox1.Caption:='选择路径文件';
end;
1:begin//路径添加
//步数跳转
CheckListBox1.Items.Clear;
for i:=0 to listbox1.Items.Count-1 do
if listbox1.Selected[i] = true
then begin
CheckListBox1.Items.Add(listbox1.Items[i]);
CheckListBox1.Checked[0]:=true;
break;
end;
Inc(MStep);
StepProcedure;
end;
end;
end;
end;//1
2:begin
add:=0;
GroupBox1.Caption:='第二步 渗入类型选择';
ListBox2.ItemS.Clear;
ListBox3.ItemS.Clear;
ListBox4.ItemS.Clear;
ComboBox7.Items.Clear;
Panel5.Visible:=true;
panel5.Align:=alClient;
for i:=0 to CheckListBox1.Items.Count-1 do begin
if CheckListBox1.Checked[i] = true
then begin
add:=add+1;
listbox2.Items.Add(CheckListBox1.Items[i]);
ListBox3.Items.Add(CheckListBox1.Items[i]);
ListBox4.ItemS.Add(CheckListBox1.Items[i]);
ComboBox7.ItemS.Add(CheckListBox1.Items[i]);
end;
end;
ListBox2.ItemIndex:=0;
ListBox3.ItemIndex:=0;
ListBox4.ItemIndex:=0;
ComboBox7.ItemIndex:=0;
ComboBox7.Text:=ComboBox7.Items[0];
{***************************************************}
MReadPoint('9');
{***************************************************}
setlength(M_address,add);
for i:=0 to high(M_address) do begin
M_address[i].IAddpoint_Top:=GProOption.Point_top;
M_address[i].IAddpoint_bott:=GProOption.Point_bott;
M_address[i].Itype:=1;
M_address[i].mIstrBrushStyle:=bsclear;
M_address[i].mIstrBrushColor:=image4.Canvas.Brush.Color;
M_address[i].mIstrFontName:=edit4.Font.Name;
M_address[i].mIstrFontSize:=edit4.Font.Size;
M_address[i].mIstrFontColor:=edit4.Font.Color;
M_address[i].mIdateType:=1;
M_address[i].SIFileSuf:='_SPR';
M_address[i].SIjpgzip:=65;
end;
end;//2
3:begin
GroupBox1.Caption:='第三步 选择设置';
Panel6.Visible:=true;
panel6.Align:=alClient;
case RadioGroup2.ItemIndex of
0:begin//预设文件
//步数跳转
{case GFileClass(edit1.Text) of
90:begin
GOpen_PHO(edit1.Text);
//draw(image3);
end;
end;//case}
end;
1:begin//自定义
end;
2:begin//程序预设
//步数跳转
end;
end;
if GProOption.AllOption
then begin
ListBox4.ItemS.Clear;
ListBox4.ItemS.Add(ListBox3.Items[0]);
ListBox2.ItemS.Clear;
ListBox2.ItemS.Add(ListBox3.Items[0]);
end
else begin
ListBox2.ItemS:=ListBox3.ItemS;
ListBox4.ItemS:=ListBox3.ItemS;
end;
end;//3
4:begin
GroupBox1.Caption:='第四步 位置设定';
Panel7.Visible:=true;
panel7.Align:=alClient;
FOR i:=0 to listbox4.Items.Count-1 do
case M_address[i].Itype of
2:begin
M_address[i].IAddpoint_bott.x:=M_address[i].IAddpoint_bott.x+M_address[i].mIstrFontSize*
length(M_address[i].Istr);
M_address[i].IAddpoint_bott.y:=M_address[i].IAddpoint_bott.y+M_address[i].mIstrFontSize;
end;
3:begin
M_address[i].IAddpoint_bott.x:=M_address[i].IAddpoint_bott.x+M_address[i].mIstrFontSize*
length(DateformatToStr(M_address[i].mIdateformat+'\'+inttostr(M_address[i].mIdateType),datetostr(M_address[i].mIdatestr)));
M_address[i].IAddpoint_bott.y:=M_address[i].IAddpoint_bott.y+M_address[i].mIstrFontSize;
end;
end;//case
end;//4
5:begin//
if GProOption.AllOption
then for i:=0 to high(M_address) do
M_address[i]:=M_address[0];
GroupBox1.Caption:='第五步 预览添加';
Panel8.Visible:=true;
panel8.Align:=alClient;
button2.Caption:='下一步';
end;//5
6:begin//
GroupBox1.Caption:='第六步 选择输出格式';
Panel9.Visible:=true;
panel9.Align:=alClient;
Panel9_1.Caption:=ShellTreeView1.Path;
button2.Caption:='完 成';
end;//6
7:begin//
//处理结束
labelend.Visible:=true;
labelend.Align:=alClient;
ProgressBar1.Max:=listbox3.Items.Count;
TheEndFunction(RadioGroup4.ItemIndex);
MStep:=-1;
StepProcedure;
end;//7
8:begin//
end;//8
9:begin//
end;//9
end;//case
end;
procedure TmainF.FormShow(Sender: TObject);
begin
GProOption.AllOption:=true;
Gindex_filename:=ExtractFilePath(Application.Exename)+'BusII.ini';
ShellTreeView1.Path:= ExtractFilePath(Application.Exename);
OpenDialog1.InitialDir:=ExtractFilePath(Application.Exename);
OpenPictureDialog1.InitialDir:=ExtractFilePath(Application.Exename);
OpenPictureDialog1.InitialDir:=ExtractFilePath(Application.Exename);
OpenDialog1.InitialDir:=ExtractFilePath(Application.Exename);
if not FileExists(Gindex_filename)
then begin G_Write_IndexINI(Gindex_filename,
'index',
'name;num;zzb02;FindLi;FFileName;',
'aboutBus_II;0;Sw2Y;0;bmp,jpg,jpeg,;'
,';',5);
end;
if trim(G_Read_IndexINI(Gindex_filename,'index','zzb02',0)) <> ''
then if Uppercase(GShow_title(about.Label9.Caption,'(',5)) = Uppercase('true')
then about.Label9.Caption:=GShow_title(about.Label9.Caption,'.',2)+'.'+G_Read_IndexINI(Gindex_filename,'index','zzb02',0)+'('+GShow_title(about.Label9.Caption,'(',4)
else about.Label9.Caption:=GShow_title(about.Label9.Caption,'.',2)+'.'+G_Read_IndexINI(Gindex_filename,'index','zzb02',0);
////////////////////////////////////////////////////////////////////////
if trim(G_Read_IndexINI(Gindex_filename,'index','FindLi',0)) <> ''
then GProOption.FindLi:=strtoint(G_Read_IndexINI(Gindex_filename,'index','FindLi',0))
else GProOption.FindLi:=0;
if trim(G_Read_IndexINI(Gindex_filename,'index','FFileName',0)) <> ''
then GProOption.FFileName:=G_Read_IndexINI(Gindex_filename,'index','FFileName',0)
else GProOption.FFileName:='bmp,jpg,jpeg,';
MCreateListfile(listbox1,ExtractFilePath(Application.Exename),GProOption.FFileName,GProOption.FindLi,0);
////////////////////////////////////////////////////////////////////////
if trim(G_Read_IndexINI(Gindex_filename,'index','FindDIR',0)) <> ''
then about.Image2.Visible:=true;
if FileExists(Gindex_filename)
then begin
if uppercase(G_Read_IndexINI(Gindex_filename,'index','Spr',0)) = uppercase('1')
then begin
// XPMenu1.Active:=false;
// FALSEmenu1.Visible:=false;
end
else begin
// XPMenu1.Active:=true;
// FALSEmenu1.Visible:=true;
// ModifyMenu(MainMenu1.Handle,3,mf_byposition or mf_Popup or mf_Help,MainMenu1.handle,'->');
end;
end;
option.Edit1.Text:=GProOption.FFileName;
option.ComboBox1.Text:=option.ComboBox1.Items[GProOption.FindLi];
MStep:=-1;
StepProcedure;
end;
procedure TmainF.Button1Click(Sender: TObject);
begin
if MStep-1 <= 0
then MStep:=-1
else begin
if (RadioGroup1.ItemIndex = 1) and (MStep = 2)
then MStep:=MStep-2
else case RadioGroup2.ItemIndex of
0:;
2:;
else Dec(MStep);
end;
end;
StepProcedure;
end;
procedure TmainF.Button3Click(Sender: TObject);
begin
if FileExists(ExtractFilePath(Application.Exename)+'drawTool.exe')
then winexec('drawTool.exe',sw_showna)
else showmessage(' 绘制程序不存在,请联系程序版权人'+#13+
'BaiSpr13Game@yahoo.com.cn'+'注意:此邮箱不接受附件'
);
end;
procedure TmainF.Button2Click(Sender: TObject);
begin
Inc(MStep);
StepProcedure;
end;
procedure TmainF.ShellTreeView1MouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
MCreateListfile(listbox1,ShellTreeView1.Path,GProOption.FFileName,GProOption.FindLi,0);
Label11.Caption:='所选路径:'+ShellTreeView1.Path+'\';
RadioGroup1.ItemIndex:=0;
end;
procedure TmainF.ListBox1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if listbox1.ItemIndex >-1
then Label11.Caption:='文件:'+ShellTreeView1.Path+'\'+listbox1.Items[listbox1.ItemIndex]
else Label11.Caption:='文件:'+ShellTreeView1.Path+'\*.*)';
end;
procedure TmainF.ListBox1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if listbox1.ItemIndex >-1
then begin
RadioGroup1.ItemIndex:=1;
Label11.Caption:='文件:'+ShellTreeView1.Path+'\'+listbox1.Items[listbox1.ItemIndex];
end
else Label11.Caption:='文件:'+ShellTreeView1.Path+'\*.*)';
end;
procedure TmainF.ShellTreeView1MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
begin
Label11.Caption:='所选路径:'+ShellTreeView1.Path+'\'
end;
procedure TmainF.CheckListBox1MouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var tmp:string;
begin
if CheckListBox1.ItemIndex >-1
then begin
GProOption.IJPeg.Free;
GProOption.IBmp.Free;
GProOption.IJPeg := TJPegImage.Create;
GProOption.IBmp := TBitmap.Create;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -