📄 newlayerdlg.~pas
字号:
unit NewLayerDlg;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls, ExtCtrls, ComCtrls;
type
TNewLayerFrm = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
RadioGroup1: TRadioGroup;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Panel3: TPanel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
Label1: TLabel;
Edit1: TEdit;
SpeedButton1: TSpeedButton;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
Edit3: TEdit;
UpDown1: TUpDown;
GroupBox1: TGroupBox;
ListBox1: TListBox;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit4: TEdit;
Label8: TLabel;
ComboBox1: TComboBox;
Label9: TLabel;
Edit5: TEdit;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
Handle: THandle;
public
{ Public declarations }
procedure FormShow(aHandle: THandle);
end;
var
NewLayerFrm: TNewLayerFrm;
implementation
uses uMsgConst;
{$R *.dfm}
{ TNewLayerFrm }
procedure TNewLayerFrm.FormShow(aHandle: THandle);
begin
NewLayerFrm:= TNewLayerFrm.Create(nil);
NewLayerFrm.Handle:= aHandle;
with NewLayerFrm do
begin
Panel2.Height:= 1;
Panel3.Height:= Panel3.Height+40;
Bitbtn1.Top:= Bitbtn1.Top+20;
Bitbtn2.Top:= Bitbtn2.Top+20;
ShowModal;
end;
end;
procedure TNewLayerFrm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:= caFree;
end;
procedure TNewLayerFrm.RadioButton1Click(Sender: TObject);
begin
if RadioButton1.Checked then
begin
Panel2.Visible:= true;
Panel2.Height:= 40;
Panel3.Height:= Panel3.Height-40;
Bitbtn1.Top:= Bitbtn1.Top-20;
Bitbtn2.Top:= Bitbtn2.Top-20;
end;
end;
procedure TNewLayerFrm.RadioButton2Click(Sender: TObject);
begin
if RadioButton2.Checked then
begin
Panel2.Visible:= False;
Panel2.Height:= 1;
Panel3.Height:= Panel3.Height+40;
Bitbtn1.Top:= Bitbtn1.Top+20;
Bitbtn2.Top:= Bitbtn2.Top+20;
end;
end;
procedure TNewLayerFrm.BitBtn1Click(Sender: TObject);
var
AMessage: TMessage;
begin
if RadioButton1.Checked then
if Edit1.Text = '' then
begin
Application.MessageBox('请选择保存路径!','提示信息!',mb_Ok);
Self.ModalResult:= mrNone;
end;
if Edit1.Text = '' then
begin
Application.MessageBox('请输入图层名称!','提示信息!',mb_Ok);
Self.ModalResult:= mrNone;
end;
if ListBox1.Items.Count = 0 then
begin
Application.MessageBox('请创建字段!','提示信息!',mb_Ok);
Self.ModalResult:= mrNone;
end;
if Self.ModalResult = mrOK then
begin
AMessage.Msg:= CREATE_NEW_LAYER_MSG; // 信息齐全了,让地图去创建
SendMessage(Handle,AMessage.Msg,0,0);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -