📄 uoption.pas
字号:
unit Uoption;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,MapXLib_TLB;
type
TFOption = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
ComboBox1: TComboBox;
Label1: TLabel;
GroupBox2: TGroupBox;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Label4: TLabel;
Edit2: TEdit;
Label5: TLabel;
Label6: TLabel;
ComboBox2: TComboBox;
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FOption: TFOption;
implementation
uses UMap;
{$R *.dfm}
procedure TFOption.Button2Click(Sender: TObject);
begin
close;
end;
procedure TFOption.FormCreate(Sender: TObject);
begin
if Fmap.UsePolyRuler = true then
radiobutton1.Checked:=true
else
radiobutton2.Checked:=true;
if (Fmap.ExportHeight = 0) Or (Fmap.ExportWidth = 0) Then
begin
Edit1.Text := FloatToStr(FMap.Map1.MapPaperHeight);
Edit2.Text := FloatToStr(Fmap.Map1.MapPaperWidth );
end
else
begin
Edit1.Text := FloatToStr(FMap.ExportHeight);
Edit2.Text := FloatToStr(FMap.ExportWidth );
end;
case FMap.ExportFormat of
0 : ComboBox2.ItemIndex:=0;
1 : ComboBox2.ItemIndex:=1;
2 : ComboBox2.ItemIndex:=2;
3 : ComboBox2.ItemIndex:=3;
4 : ComboBox2.ItemIndex:=4;
5 : ComboBox2.ItemIndex:=5;
6 : ComboBox2.ItemIndex:=6;
end;
Combobox2.ItemIndex :=FMap.RulerUnit;
end;
procedure TFOption.Button3Click(Sender: TObject);
begin
FMap.UsePolyRuler:= False;
FMap.UserLineRuler:= True;
radiobutton1.Checked:=True;
radiobutton2.Checked:=False;
Edit1.Text := FloatToStr(FMap.Map1.MapPaperHeight);
Edit2.Text := FloatToStr(FMap.Map1.MapPaperWidth);
Combobox1.ItemIndex := 1;
Combobox2.ItemIndex := 1;
end;
procedure TFOption.Button1Click(Sender: TObject);
begin
FMap.ExportHeight:=StrToFloat(Edit1.Text);
FMap.ExportWidth :=StrToFloat(Edit2.Text);
if (FMap.ExportHeight<=0.0) or (FMap.ExportHeight<=0.0) then
begin
messageDlg('请输入正确的高度和宽度',mtConfirmation,[mbOK],0);
end;
Fmap.UsePolyRuler := RadioButton2.Checked;
Fmap.UserLineRuler := RadioButton1.Checked;
if (Fmap.UsePolyRuler = true ) and (Fmap.Map1.CurrentTool = RulerToolID) then
Fmap.Map1.CurrentTool:= PolyRulerToolID ;
if (Fmap.UsePolyRuler = False) and (Fmap.Map1.CurrentTool = PolyRulerToolID) then
Fmap.Map1.CurrentTool:= RulerToolID;
Fmap.RulerUnitString := ComboBox1.Text;
case ComboBox1.ItemIndex of
0: FMap.RulerUnit := miUnitMile; //英里
1: FMap.RulerUnit := miUnitKilometer; //千米
2: FMap.RulerUnit := miUnitInch; // 英寸
3: FMap.RulerUnit := miUnitFoot; //英尺
4: FMap.RulerUnit := miUnitYard; //码
5: FMap.RulerUnit := miUnitMillimeter; //毫米
6: FMap.RulerUnit := miUnitCentimeter; //厘米
end;
case ComboBox2.ItemIndex of
0: begin //Windows Metafile (*.wmf)
FMap.ExportFormat := miFormatWMF;
FMap.ExportFormatString := 'Windows Metafile';
FMap.ExportFormatExt :='*.wmf';
end;
1: begin //Windows Bitmap (*.bmp)
FMap.ExportFormat := miFormatBMP;
FMap.ExportFormatString := 'Windows Bitmap';
FMap.ExportFormatExt :='*.bmp';
end;
2: begin //Graphics Interchange Format (*.gif)
FMap.ExportFormat := miFormatGIF;
FMap.ExportFormatString := 'Graphics Interchange Format';
FMap.ExportFormatExt :='*.gif';
end;
3: begin //JPEG (*.jpg)
FMap.ExportFormat := miFormatJPEG;
FMap.ExportFormatString := 'JPEG';
FMap.ExportFormatExt :='*.jpg';
end;
4: begin //TIFF (*.tif)
FMap.ExportFormat := miFormatTIF;
FMap.ExportFormatString := 'TIFF';
FMap.ExportFormatExt :='*.tif';
end;
5: begin
FMap.ExportFormat := miFormatPNG;
FMap.ExportFormatString := 'Portable Network Graphics';
FMap.ExportFormatExt :='*.png';
end;
6: begin
FMap.ExportFormat := miFormatPSD;
FMap.ExportFormatString := 'Photoshop';
FMap.ExportFormatExt :='*.psd';
end;
end;
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -