view.h
来自「c++中MO添加图层的方法」· C头文件 代码 · 共 107 行
H
107 行
// View.h : interface of the CAddShapeView class
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INCLUDES()
#include "map.h"
//}}AFX_INCLUDES
class CMoPolyArray : public CTypedPtrArray<CPtrArray, CMoPolygon*> {};
class CMoLineArray : public CTypedPtrArray<CPtrArray, CMoLine*> {};
class CMoPointArray : public CTypedPtrArray<CPtrArray, CMoPoint*> {};
class CMoRectangleArray : public CTypedPtrArray<CPtrArray, CMoRectangle*> {};
class CMoEllipseArray : public CTypedPtrArray<CPtrArray, CMoEllipse*> {};
class CAddShapeView : public CFormView
{
public:
protected:
CMoPointArray m_points; // Points to be saved.
CMoLineArray m_lines; // Lines to be saved.
CMoPolyArray m_polys; // Polygons to be saved.
CMoRectangleArray m_rectangles; // rectangles to be saved.
CMoEllipseArray m_ellipses; // Polygons to be saved.
CString m_path; // Name of shape file
UINT m_curTool; // Current shape
void ReleasePoints();
void ReleaseLines();
void ReleasePolygons();
void SavePoints(CMoDataConnection& conn, CMoTableDesc& tableDesc);
void SavePolygons(CMoDataConnection& conn, CMoTableDesc& tableDesc);
void SaveLines(CMoDataConnection& conn, CMoTableDesc& tableDesc);
void SaveEllipses(CMoDataConnection& conn, CMoTableDesc& tableDesc);
void SaveRectangles(CMoDataConnection& conn, CMoTableDesc& tableDesc);
//
// Class Wizard generated stuff...
//
protected: // create from serialization only
CAddShapeView();
DECLARE_DYNCREATE(CAddShapeView)
public:
//{{AFX_DATA(CAddShapeView)
enum { IDD = IDD_ADDSHAPE_FORM };
CMap1 m_map;
//}}AFX_DATA
// Attributes
public:
CAddShapeDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAddShapeView)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnInitialUpdate();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
void ReleaseEllipses();
void ReleaseRectangles();
virtual ~CAddShapeView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CAddShapeView)
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMapSaveShapes();
afx_msg void OnMapMouseDown(short Button, short Shift, long x, long y);
afx_msg void OnMapAfterTrackingLayerDraw(long hDC);
afx_msg void OnMapAddPoint();
afx_msg void OnMapAddPoly();
afx_msg void OnMapAddLine();
afx_msg void OnUpdateMapTool(CCmdUI* pCmdUI);
afx_msg void OnFileNew();
afx_msg void OnZoomIn();
afx_msg void OnZoomout();
afx_msg void OnPan();
afx_msg void OnFileOpen();
afx_msg void OnAddellipse();
afx_msg void OnAddrect();
afx_msg void OnFullextent();
DECLARE_EVENTSINK_MAP()
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in View.cpp
inline CAddShapeDoc* CAddShapeView::GetDocument()
{ return (CAddShapeDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?