📄 griddlg.~pas
字号:
unit GridDlg;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls, StdCtrls, Buttons;
type
TGridFrm = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
ComboBox1: TComboBox;
BitBtn1: TBitBtn;
Label3: TLabel;
Label4: TLabel;
UpDown1: TUpDown;
Edit3: TEdit;
Edit4: TEdit;
UpDown2: TUpDown;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
SpeedButton1: TSpeedButton;
Panel1: TPanel;
ColorDialog1: TColorDialog;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Edit5: TEdit;
Label8: TLabel;
Edit6: TEdit;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure SpeedButton1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
Handle: THandle;
public
{ Public declarations }
procedure FormShow(aHandle: THandle; Layers: TStringList; BeginX,BeginY,EndX,EndY: Double;
CurrentLayer: string);
end;
var
GridFrm: TGridFrm;
implementation
uses NewLayerDlg;
{$R *.dfm}
procedure TGridFrm.FormShow(aHandle: THandle; Layers: TStringList; BeginX,BeginY,EndX,EndY: Double;
CurrentLayer: string);
var
i: Integer;
begin
GridFrm:= TGridFrm.Create(nil);
Handle:= aHandle;
with GridFrm do
begin
ComboBox1.Items.Assign(Layers);
Edit1.Text:= FloatToStr(BeginX);
Edit2.Text:= FloatToStr(BeginY);
Edit5.Text:= FloatToStr(EndX);
Edit6.Text:= FloatToStr(EndY);
for i:= 0 to ComboBox1.Items.Count-1 do
if ComboBox1.Items.Strings[i] = CurrentLayer then
ComboBox1.ItemIndex:= i;
Panel1.Color:= clBlack;
ShowModal;
end;
end;
procedure TGridFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:= caFree;
end;
procedure TGridFrm.SpeedButton1Click(Sender: TObject);
begin
if ColorDialog1.Execute then
Panel1.Color:= ColorDialog1.Color;
end;
procedure TGridFrm.BitBtn2Click(Sender: TObject);
begin
if ComboBox1.Text = '' then
begin
Application.MessageBox('请选择图层!','提示信息!',mb_Ok);
Self.ModalResult:= mrNone;
end
else
Self.ModalResult:= mrOk;
end;
procedure TGridFrm.BitBtn1Click(Sender: TObject);
begin
NewLayerFrm.FormShow(Handle);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -