⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainunit.pas

📁 GIS地理信息系统开发。 大名鼎鼎的MAPX+DELPHI7.0软件开发
💻 PAS
字号:
// This sample application and corresponding sample code is provided
// for example purposes only.  It has not undergone rigorous testing
// and as such should not be shipped as part of a final application
// without extensive testing on the part of the organization releasing
// the end-user product.

unit MainUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  OleCtrls, Menus, ComObj, MapXLib_TLB;

type
  TMapForm = class(TForm)
    MainMenu1: TMainMenu;
    File1: TMenuItem;
    Exit1: TMenuItem;
    Options1: TMenuItem;
    Find1: TMenuItem;
    OpenDialog1: TOpenDialog;
    Tools1: TMenuItem;
    ZoomIn1: TMenuItem;
    ZoomOut1: TMenuItem;
    Pan1: TMenuItem;
    MapXLayerControl1: TMenuItem;
    layerToDataset: TMenuItem;
    Map1: TMap;
    procedure Exit1Click(Sender: TObject);
    procedure Find1Click(Sender: TObject);
    procedure ZoomIn1Click(Sender: TObject);
    procedure ZoomOut1Click(Sender: TObject);
    procedure Pan1Click(Sender: TObject);
    procedure MapXLayerControl1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure layerToDatasetClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MapForm: TMapForm;

implementation

Uses
    layer2Dataset, FindDialog;
{$R *.DFM}

procedure TMapForm.Exit1Click(Sender: TObject);
begin
     Application.Terminate;
end;

procedure TMapForm.Find1Click(Sender: TObject);
begin
     // Display the find dialog
     FindDialog.FindForm.ShowModal
end;

procedure TMapForm.ZoomIn1Click(Sender: TObject);
begin
     // Make the zoom In tool the active tool
     Map1.CurrentTool := miZoomInTool;
end;

procedure TMapForm.ZoomOut1Click(Sender: TObject);
begin
     // Make the zoom Out tool the active tool
     Map1.CurrentTool := miZoomOutTool;
end;

procedure TMapForm.Pan1Click(Sender: TObject);
begin
     // Make the Pan tool the active tool
     Map1.CurrentTool := miPanTool;
end;

procedure TMapForm.MapXLayerControl1Click(Sender: TObject);
var
   unusedParam: OleVariant;
begin
     TVarData(unusedParam).vType := varError;
     TVarData(unusedParam).vError := 2147614724; // DISP_E_PARAMNOTFOUND;
     // Display the Stock MapX Layer Control Dialog
     Map1.Layers.LayersDlg(unusedParam, unusedParam);
end;

procedure TMapForm.FormCreate(Sender: TObject);
begin
//     Map1.Layers.AutoCreateDatasets := True;
end;

procedure TMapForm.layerToDatasetClick(Sender: TObject);
begin
     layerToDatasetForm.ShowModal;
     if Map1.Datasets.Count <> 0 then
        Find1.Enabled := True;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -