geosetnamedlg.cpp

来自「mapX 开发GIS的源代码」· C++ 代码 · 共 109 行

CPP
109
字号
// GeosetNameDlg.cpp : implementation file
//

#include "stdafx.h"
#include "GeoExpert.h"
#include "GeosetNameDlg.h"
#include "MapX.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#define MYTOOL_SYMBOL 4
#define MYTOOL_LINE   5
#define MYTOOL_REGION 3
#define MYTOOL_TEXT   6
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGeosetNameDlg dialog


CGeosetNameDlg::CGeosetNameDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CGeosetNameDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CGeosetNameDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CGeosetNameDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CGeosetNameDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//DDX_Text(pDX, IDC_STATICX, m_strX);
    //DDX_Text(pDX, IDC_STATICY, m_strY);
	//}}AFX_DATA_MAP
	DDX_Control(pDX, IDC_MAP1, m_ctrlMapX);
}


BEGIN_MESSAGE_MAP(CGeosetNameDlg, CDialog)
	//{{AFX_MSG_MAP(CGeosetNameDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGeosetNameDlg message handlers

BOOL CGeosetNameDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	try {

 m_ctrlMapX.SetZoom(1000);  // zoom in to 1000 miles

 

 // create temporary layer on top for drawing on.

 CMapXLayer layer = m_ctrlMapX.GetLayers().CreateLayer("scratch layer",NULL,1);

 

 // make it the animation layer

 m_ctrlMapX.GetLayers().SetAnimationLayer(layer);

 

 // create some custom tools for object drawing

 m_ctrlMapX.CreateCustomTool(MYTOOL_SYMBOL, miToolTypePoint, miCrossCursor);

 m_ctrlMapX.CreateCustomTool(MYTOOL_LINE, miToolTypePoly,miCrossCursor);

 m_ctrlMapX.CreateCustomTool(MYTOOL_REGION, miToolTypePoly,miCrossCursor);

 m_ctrlMapX.CreateCustomTool(MYTOOL_TEXT, miToolTypePoint,miIBeamCursor);

 m_ctrlMapX.SetCurrentTool(MYTOOL_REGION);

 }

 catch (COleDispatchException *e) 
 {

 e->ReportError();

 e->Delete();

 }

 catch (COleException *e) 
 {

 e->ReportError();

 e->Delete();

 }
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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