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

📄 ex3_3view.cpp

📁 mfc实验例题也是高教得配套资料 刚找到得 这部分应该是自学的内容
💻 CPP
字号:
// Ex3_3View.cpp : implementation of the CEx3_3View class
//

#include "stdafx.h"
#include "Ex3_3.h"

#include "Ex3_3Doc.h"
#include "Ex3_3View.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CEx3_3View

IMPLEMENT_DYNCREATE(CEx3_3View, CScrollView)

BEGIN_MESSAGE_MAP(CEx3_3View, CScrollView)
	//{{AFX_MSG_MAP(CEx3_3View)
		// 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, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEx3_3View construction/destruction

CEx3_3View::CEx3_3View()
{
	// TODO: add construction code here

}

CEx3_3View::~CEx3_3View()
{
}

BOOL CEx3_3View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CScrollView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CEx3_3View drawing

void CEx3_3View::OnDraw(CDC* pDC)
{
	CEx3_3Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	pDC->Ellipse(0,0,200,100);
}

void CEx3_3View::OnInitialUpdate()
{
	CScrollView::OnInitialUpdate();

	CSize sizeTotal;
	// TODO: calculate the total size of this view
	sizeTotal.cx = sizeTotal.cy = 100;
	SetScrollSizes(MM_TEXT, sizeTotal);
}

/////////////////////////////////////////////////////////////////////////////
// CEx3_3View printing

BOOL CEx3_3View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CEx3_3View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CEx3_3View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CEx3_3View diagnostics

#ifdef _DEBUG
void CEx3_3View::AssertValid() const
{
	CScrollView::AssertValid();
}

void CEx3_3View::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}

CEx3_3Doc* CEx3_3View::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEx3_3Doc)));
	return (CEx3_3Doc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CEx3_3View message handlers

⌨️ 快捷键说明

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