📄 mappivw.cpp
字号:
// mappivw.cpp : implementation of the CMappingView class
//
#include "stdafx.h"
#include "mapping.h"
#include "mappidoc.h"
#include "mappivw.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMappingView
IMPLEMENT_DYNCREATE(CMappingView, CView)
BEGIN_MESSAGE_MAP(CMappingView, CView)
//{{AFX_MSG_MAP(CMappingView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMappingView construction/destruction
CMappingView::CMappingView()
{
// TODO: add construction code here
}
CMappingView::~CMappingView()
{
}
/////////////////////////////////////////////////////////////////////////////
// CMappingView drawing
void CMappingView::OnDraw(CDC* pDC)
{
CMappingDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDC->SetMapMode(MM_HIMETRIC);
pDC->Ellipse(0,0,200,-1000);
// draws an ellipse 2mm by 10mm in upper left corner
pDC->SetMapMode(MM_LOENGLISH);
pDC->Ellipse(0,0,200,-1000);
// draws an ellipse 0.2 inches by 1.0 inches
// in upper left corner
pDC->SetMapMode(MM_TEXT);
pDC->Ellipse(0,0,200,+1000);
// draws an ellipse 200 pixels by 1000 pixels
// in upper left corner
}
/////////////////////////////////////////////////////////////////////////////
// CMappingView printing
BOOL CMappingView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CMappingView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CMappingView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CMappingView diagnostics
#ifdef _DEBUG
void CMappingView::AssertValid() const
{
CView::AssertValid();
}
void CMappingView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CMappingDoc* CMappingView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMappingDoc)));
return (CMappingDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMappingView message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -