📄 frmpjgmainmap.pas
字号:
unit frmPJgMainMap;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtDlgs, StdCtrls, Buttons, ExtCtrls, JPEG, DB, ADODB;
type
TMainMap = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Image1: TImage;
Label1: TLabel;
Edit1: TEdit;
BitBtn1: TBitBtn;
PicDlg: TOpenPictureDialog;
Button1: TButton;
Button2: TButton;
adoConn: TADOConnection;
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
sFile: String;
public
{ Public declarations }
isChange: Boolean;
end;
var
MainMap: TMainMap;
implementation
{$R *.dfm}
uses uDMFunc, uVarUtils, uConstUtils , ComObj , types, uSystemIni;
procedure TMainMap.BitBtn1Click(Sender: TObject);
begin
if PicDlg.Execute then
begin
sFile := PicDlg.FileName;
if FileExists(sFile) then
begin
Image1.Picture.LoadFromFile(sFile);
end;
end;
end;
procedure TMainMap.FormCreate(Sender: TObject);
var
sCaption: String;
begin
isChange := False;
Edit1.Text := pubCaption;
sFile := ExtractFilePath(application.ExeName)+PMainMapFile;
ReadMainMap(sCaption,sFile);
Edit1.Text := sCaption;
if FileExists(sFile) then
try
Image1.Picture.LoadFromFile(sFile);
except
application.MessageBox('主地图文件格式不正确,不能装载!',PMsgCaption,48);
end;
end;
procedure TMainMap.Button1Click(Sender: TObject);
var
sCaption: String;
// sFile, sCaption: String;
begin
sCaption := trim(Edit1.Text);
// sFile := ExtractFilePath(application.ExeName)+PMainMapFile;
if WriteMainMap(sCaption,sFile)=0 then
begin
isChange := True;
WriteDptCaption(_PVNJGWEBSEVICE,sCaption);
Application.MessageBox('设置成功。',PMsgCaption,64);
close;
end
else
Application.MessageBox('存盘失败!',PMsgCaption,16);
end;
procedure TMainMap.Button2Click(Sender: TObject);
begin
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -