
哪里可以下载MapObjects或者MapX的安装软件? 急用
哪里可以下载MapObjects或者MapX的安装软件?急用,但是网上不是不能下载就是下载了不能安装,请问有没有有这个软件的,发给我也行,121601558@qq.com...
哪里可以下载MapObjects或者MapX的安装软件?
急用,但是网上不是不能下载就是下载了不能安装,请问有没有有这个软件的,发给我也行,121601558@qq.com,谢谢~~ 展开
急用,但是网上不是不能下载就是下载了不能安装,请问有没有有这个软件的,发给我也行,121601558@qq.com,谢谢~~ 展开
2个回答
展开全部
利用GIS 工具软件生产厂家提供的建立在OCX 技术基础上的GIS 功能控件,如ESRI
的MapObjects、MapInfo 公司的MapX 等,在Delphi 等编程工具编制的应用程序中,直
接将GIS 功能嵌入其中,实现地理信息系统的各种功能。
需要先下载mapx控件,然后就可以在VC环境中,加入该控件,你当然可以选择在对话框上直接插入控件mapx,当做一个控件使用,也可以在文档视图中插入控件,将相应类文件加入其中,包含了mapx.h 文件后,可以定义相应变量,在OnCreate中创建,还可以做其他事情,下面是一个代码,仅供参考。
// GeoExpertView.h : interface of the CGeoExpertView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GEOEXPERTVIEW_H__3456F63F_3DC9_493F_8817_DAA44E0779AE__INCLUDED_)
#define AFX_GEOEXPERTVIEW_H__3456F63F_3DC9_493F_8817_DAA44E0779AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "MapX.h"
class CGeoExpertView : public CView
{
protected: // create from serialization only
CGeoExpertView();
DECLARE_DYNCREATE(CGeoExpertView)
// Attributes
public:
CGeoExpertDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeoExpertView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
CString m_strFilePath;
CMapX m_ctrlMapX;
virtual ~CGeoExpertView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGeoExpertView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnFileOpen();
afx_msg void OnMapToolArrow();
afx_msg void OnMapToolZoomin();
afx_msg void OnMapToolZoomout();
afx_msg void OnMapToolPan();
afx_msg void OnMapToolSelect();
afx_msg void OnMapToolRectangleselect();
afx_msg void OnMapToolRadiusselect();
afx_msg void OnViewLayercontrol();
afx_msg void OnMapToolEntire();
afx_msg void OnUpdateMapToolZoomin(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolZoomout(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolPan(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolArrow(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolSelect(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolRectangleselect(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolRadiusselect(CCmdUI* pCmdUI);
afx_msg void OnMapToolCenter();
afx_msg void OnUpdateMapToolCenter(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in GeoExpertView.cpp
inline CGeoExpertDoc* CGeoExpertView::GetDocument()
#endif
/////////////////////////////////////////////////////////////////////////////
//}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GEOEXPERTVIEW_H__3456F63F_3DC9_493F_8817_DAA44E0779AE__INCLUDED_)
// GeoExpertView.cpp : implementation of the CGeoExpertView class
//
#include "stdafx.h"
#include "GeoExpert.h"
#include "GeoExpertDoc.h"
#include "GeoExpertView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView
IMPLEMENT_DYNCREATE(CGeoExpertView, CView)
BEGIN_MESSAGE_MAP(CGeoExpertView, CView)
//{{AFX_MSG_MAP(CGeoExpertView)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_SETFOCUS()
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_MAP_TOOL_ARROW, OnMapToolArrow)
ON_COMMAND(ID_MAP_TOOL_ZOOMIN, OnMapToolZoomin)
ON_COMMAND(ID_MAP_TOOL_ZOOMOUT, OnMapToolZoomout)
ON_COMMAND(ID_MAP_TOOL_PAN, OnMapToolPan)
ON_COMMAND(ID_MAP_TOOL_SELECT, OnMapToolSelect)
ON_COMMAND(ID_MAP_TOOL_RECTANGLESELECT, OnMapToolRectangleselect)
ON_COMMAND(ID_MAP_TOOL_RADIUSSELECT, OnMapToolRadiusselect)
ON_COMMAND(ID_VIEW_LAYERCONTROL, OnViewLayercontrol)
ON_COMMAND(ID_MAP_TOOL_ENTIRE, OnMapToolEntire)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_ZOOMIN, OnUpdateMapToolZoomin)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_ZOOMOUT, OnUpdateMapToolZoomout)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_PAN, OnUpdateMapToolPan)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_ARROW, OnUpdateMapToolArrow)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_SELECT, OnUpdateMapToolSelect)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_RECTANGLESELECT, OnUpdateMapToolRectangleselect)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_RADIUSSELECT, OnUpdateMapToolRadiusselect)
ON_COMMAND(ID_MAP_TOOL_CENTER, OnMapToolCenter)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_CENTER, OnUpdateMapToolCenter)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView construction/destruction
CGeoExpertView::CGeoExpertView()
{
// TODO: add construction code here
}
CGeoExpertView::~CGeoExpertView()
{
}
BOOL CGeoExpertView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView drawing
void CGeoExpertView::OnDraw(CDC* pDC)
{
CGeoExpertDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView printing
BOOL CGeoExpertView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CGeoExpertView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CGeoExpertView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView diagnostics
#ifdef _DEBUG
void CGeoExpertView::AssertValid() const
{
CView::AssertValid();
}
void CGeoExpertView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CGeoExpertDoc* CGeoExpertView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeoExpertDoc)));
return (CGeoExpertDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView message handlers
int CGeoExpertView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
RECT windRect;
GetClientRect(&windRect);
if (!m_ctrlMapX.Create(NULL, WS_VISIBLE, windRect, this,IDC_MAP))
return -1;
return 0;
}
void CGeoExpertView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
//if (cx != 0 && cy != 0)
if (m_ctrlMapX.m_hWnd != NULL)
m_ctrlMapX.MoveWindow(0,0,cx,cy,TRUE);
}
void CGeoExpertView::OnSetFocus(CWnd* pOldWnd)
{
CView::OnSetFocus(pOldWnd);
// TODO: Add your message handler code here
m_ctrlMapX.SetFocus();
}
static char BASED_CODE szTabFilter[] = "MapInfo Map Files (*.gst)|*.gst|All Files (*.*)|*.*||";
void CGeoExpertView::OnFileOpen()
{
// TODO: Add your command handler code here
CFileDialog dlgFile(TRUE, "*.gst", NULL, OFN_HIDEREADONLY , szTabFilter, this);
dlgFile.m_ofn.lpstrTitle = "Open MapInfo Map";
if (dlgFile.DoModal() == IDCANCEL)
return;
m_strFilePath = dlgFile.GetPathName();
try {
// Close the existing set of map layers and load the Canada map
TRACE0("Old Geoset: " + m_ctrlMapX.GetGeoSet());
m_ctrlMapX.SetGeoSet(m_strFilePath);
//m_ctrlMapX.SetTitleText("");
TRACE0("New Geoset: " + m_ctrlMapX.GetGeoSet());
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
}
void CGeoExpertView::OnMapToolArrow()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miArrowTool);
}
void CGeoExpertView::OnMapToolZoomin()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miZoomInTool);
}
void CGeoExpertView::OnMapToolZoomout()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miZoomOutTool);
}
void CGeoExpertView::OnMapToolPan()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miPanTool);
}
void CGeoExpertView::OnMapToolSelect()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miSelectTool);
}
void CGeoExpertView::OnMapToolRectangleselect()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miRectSelectTool);
}
void CGeoExpertView::OnMapToolRadiusselect()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miRadiusSelectTool);
}
void CGeoExpertView::OnMapToolCenter()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miCenterTool);
}
void CGeoExpertView::OnMapToolEntire()
{
// TODO: Add your command handler code here
/*
try {
m_ctrlMapX.SetZoom(m_ctrlMapX.GetGeoSetWidth());
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
*/
m_ctrlMapX.SetGeoSet(m_strFilePath);
}
void CGeoExpertView::OnViewLayercontrol()
{
// TODO: Add your command handler code here
try {
VARIANT vHelpFile, vHelpID; // mark as optional since we don't have a helpfile
vHelpFile.vt = VT_ERROR;
vHelpFile.scode = DISP_E_PARAMNOTFOUND;
vHelpID.vt = VT_ERROR;
vHelpID.scode = DISP_E_PARAMNOTFOUND;
CMapXLayers layers = m_ctrlMapX.GetLayers();
layers.LayersDlg(vHelpFile, vHelpID);
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
}
void CGeoExpertView::OnUpdateMapToolArrow(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miArrowTool);
}
void CGeoExpertView::OnUpdateMapToolZoomin(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miZoomInTool);
}
void CGeoExpertView::OnUpdateMapToolZoomout(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miZoomOutTool);
}
void CGeoExpertView::OnUpdateMapToolPan(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miPanTool);
}
void CGeoExpertView::OnUpdateMapToolSelect(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miSelectTool);
}
void CGeoExpertView::OnUpdateMapToolRectangleselect(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miRectSelectTool);
}
void CGeoExpertView::OnUpdateMapToolRadiusselect(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miRadiusSelectTool);
}
void CGeoExpertView::OnUpdateMapToolCenter(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miCenterTool);
}
的MapObjects、MapInfo 公司的MapX 等,在Delphi 等编程工具编制的应用程序中,直
接将GIS 功能嵌入其中,实现地理信息系统的各种功能。
需要先下载mapx控件,然后就可以在VC环境中,加入该控件,你当然可以选择在对话框上直接插入控件mapx,当做一个控件使用,也可以在文档视图中插入控件,将相应类文件加入其中,包含了mapx.h 文件后,可以定义相应变量,在OnCreate中创建,还可以做其他事情,下面是一个代码,仅供参考。
// GeoExpertView.h : interface of the CGeoExpertView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GEOEXPERTVIEW_H__3456F63F_3DC9_493F_8817_DAA44E0779AE__INCLUDED_)
#define AFX_GEOEXPERTVIEW_H__3456F63F_3DC9_493F_8817_DAA44E0779AE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "MapX.h"
class CGeoExpertView : public CView
{
protected: // create from serialization only
CGeoExpertView();
DECLARE_DYNCREATE(CGeoExpertView)
// Attributes
public:
CGeoExpertDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeoExpertView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
CString m_strFilePath;
CMapX m_ctrlMapX;
virtual ~CGeoExpertView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGeoExpertView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnFileOpen();
afx_msg void OnMapToolArrow();
afx_msg void OnMapToolZoomin();
afx_msg void OnMapToolZoomout();
afx_msg void OnMapToolPan();
afx_msg void OnMapToolSelect();
afx_msg void OnMapToolRectangleselect();
afx_msg void OnMapToolRadiusselect();
afx_msg void OnViewLayercontrol();
afx_msg void OnMapToolEntire();
afx_msg void OnUpdateMapToolZoomin(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolZoomout(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolPan(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolArrow(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolSelect(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolRectangleselect(CCmdUI* pCmdUI);
afx_msg void OnUpdateMapToolRadiusselect(CCmdUI* pCmdUI);
afx_msg void OnMapToolCenter();
afx_msg void OnUpdateMapToolCenter(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in GeoExpertView.cpp
inline CGeoExpertDoc* CGeoExpertView::GetDocument()
#endif
/////////////////////////////////////////////////////////////////////////////
//}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GEOEXPERTVIEW_H__3456F63F_3DC9_493F_8817_DAA44E0779AE__INCLUDED_)
// GeoExpertView.cpp : implementation of the CGeoExpertView class
//
#include "stdafx.h"
#include "GeoExpert.h"
#include "GeoExpertDoc.h"
#include "GeoExpertView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView
IMPLEMENT_DYNCREATE(CGeoExpertView, CView)
BEGIN_MESSAGE_MAP(CGeoExpertView, CView)
//{{AFX_MSG_MAP(CGeoExpertView)
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_SETFOCUS()
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_MAP_TOOL_ARROW, OnMapToolArrow)
ON_COMMAND(ID_MAP_TOOL_ZOOMIN, OnMapToolZoomin)
ON_COMMAND(ID_MAP_TOOL_ZOOMOUT, OnMapToolZoomout)
ON_COMMAND(ID_MAP_TOOL_PAN, OnMapToolPan)
ON_COMMAND(ID_MAP_TOOL_SELECT, OnMapToolSelect)
ON_COMMAND(ID_MAP_TOOL_RECTANGLESELECT, OnMapToolRectangleselect)
ON_COMMAND(ID_MAP_TOOL_RADIUSSELECT, OnMapToolRadiusselect)
ON_COMMAND(ID_VIEW_LAYERCONTROL, OnViewLayercontrol)
ON_COMMAND(ID_MAP_TOOL_ENTIRE, OnMapToolEntire)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_ZOOMIN, OnUpdateMapToolZoomin)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_ZOOMOUT, OnUpdateMapToolZoomout)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_PAN, OnUpdateMapToolPan)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_ARROW, OnUpdateMapToolArrow)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_SELECT, OnUpdateMapToolSelect)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_RECTANGLESELECT, OnUpdateMapToolRectangleselect)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_RADIUSSELECT, OnUpdateMapToolRadiusselect)
ON_COMMAND(ID_MAP_TOOL_CENTER, OnMapToolCenter)
ON_UPDATE_COMMAND_UI(ID_MAP_TOOL_CENTER, OnUpdateMapToolCenter)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView construction/destruction
CGeoExpertView::CGeoExpertView()
{
// TODO: add construction code here
}
CGeoExpertView::~CGeoExpertView()
{
}
BOOL CGeoExpertView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView drawing
void CGeoExpertView::OnDraw(CDC* pDC)
{
CGeoExpertDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView printing
BOOL CGeoExpertView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CGeoExpertView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CGeoExpertView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView diagnostics
#ifdef _DEBUG
void CGeoExpertView::AssertValid() const
{
CView::AssertValid();
}
void CGeoExpertView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CGeoExpertDoc* CGeoExpertView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGeoExpertDoc)));
return (CGeoExpertDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGeoExpertView message handlers
int CGeoExpertView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
RECT windRect;
GetClientRect(&windRect);
if (!m_ctrlMapX.Create(NULL, WS_VISIBLE, windRect, this,IDC_MAP))
return -1;
return 0;
}
void CGeoExpertView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
//if (cx != 0 && cy != 0)
if (m_ctrlMapX.m_hWnd != NULL)
m_ctrlMapX.MoveWindow(0,0,cx,cy,TRUE);
}
void CGeoExpertView::OnSetFocus(CWnd* pOldWnd)
{
CView::OnSetFocus(pOldWnd);
// TODO: Add your message handler code here
m_ctrlMapX.SetFocus();
}
static char BASED_CODE szTabFilter[] = "MapInfo Map Files (*.gst)|*.gst|All Files (*.*)|*.*||";
void CGeoExpertView::OnFileOpen()
{
// TODO: Add your command handler code here
CFileDialog dlgFile(TRUE, "*.gst", NULL, OFN_HIDEREADONLY , szTabFilter, this);
dlgFile.m_ofn.lpstrTitle = "Open MapInfo Map";
if (dlgFile.DoModal() == IDCANCEL)
return;
m_strFilePath = dlgFile.GetPathName();
try {
// Close the existing set of map layers and load the Canada map
TRACE0("Old Geoset: " + m_ctrlMapX.GetGeoSet());
m_ctrlMapX.SetGeoSet(m_strFilePath);
//m_ctrlMapX.SetTitleText("");
TRACE0("New Geoset: " + m_ctrlMapX.GetGeoSet());
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
}
void CGeoExpertView::OnMapToolArrow()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miArrowTool);
}
void CGeoExpertView::OnMapToolZoomin()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miZoomInTool);
}
void CGeoExpertView::OnMapToolZoomout()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miZoomOutTool);
}
void CGeoExpertView::OnMapToolPan()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miPanTool);
}
void CGeoExpertView::OnMapToolSelect()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miSelectTool);
}
void CGeoExpertView::OnMapToolRectangleselect()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miRectSelectTool);
}
void CGeoExpertView::OnMapToolRadiusselect()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miRadiusSelectTool);
}
void CGeoExpertView::OnMapToolCenter()
{
// TODO: Add your command handler code here
m_ctrlMapX.SetCurrentTool(miCenterTool);
}
void CGeoExpertView::OnMapToolEntire()
{
// TODO: Add your command handler code here
/*
try {
m_ctrlMapX.SetZoom(m_ctrlMapX.GetGeoSetWidth());
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
*/
m_ctrlMapX.SetGeoSet(m_strFilePath);
}
void CGeoExpertView::OnViewLayercontrol()
{
// TODO: Add your command handler code here
try {
VARIANT vHelpFile, vHelpID; // mark as optional since we don't have a helpfile
vHelpFile.vt = VT_ERROR;
vHelpFile.scode = DISP_E_PARAMNOTFOUND;
vHelpID.vt = VT_ERROR;
vHelpID.scode = DISP_E_PARAMNOTFOUND;
CMapXLayers layers = m_ctrlMapX.GetLayers();
layers.LayersDlg(vHelpFile, vHelpID);
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
}
void CGeoExpertView::OnUpdateMapToolArrow(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miArrowTool);
}
void CGeoExpertView::OnUpdateMapToolZoomin(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miZoomInTool);
}
void CGeoExpertView::OnUpdateMapToolZoomout(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miZoomOutTool);
}
void CGeoExpertView::OnUpdateMapToolPan(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miPanTool);
}
void CGeoExpertView::OnUpdateMapToolSelect(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miSelectTool);
}
void CGeoExpertView::OnUpdateMapToolRectangleselect(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miRectSelectTool);
}
void CGeoExpertView::OnUpdateMapToolRadiusselect(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miRadiusSelectTool);
}
void CGeoExpertView::OnUpdateMapToolCenter(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (m_ctrlMapX.m_hWnd != NULL)
{
pCmdUI->Enable(TRUE);
}
else
{
pCmdUI->Enable(FALSE);
}
pCmdUI->SetCheck(m_ctrlMapX.GetCurrentTool() == miCenterTool);
}

2024-09-19 广告
作为北京饼干科技有限公司的工作人员,关于AIPPT免费生成PPT的功能,我可以简要介绍如下:AIPPT是一款基于人工智能技术的PPT制作工具,它为用户提供了免费生成PPT的便捷服务。用户只需简单输入PPT的主题或内容大纲,AIPPT便能智能...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询