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

📄 yuanview.cpp

📁 本压缩软件为《Visual C++6.0基础教程》(黑魔方系列)一书的源代码
💻 CPP
字号:
// YuanView.cpp : implementation of the CYuanView class
//

#include "stdafx.h"
#include "Yuan.h"

#include "YuanDoc.h"
#include "YuanView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CYuanView

IMPLEMENT_DYNCREATE(CYuanView, CView)

BEGIN_MESSAGE_MAP(CYuanView, CView)
	//{{AFX_MSG_MAP(CYuanView)
	ON_COMMAND(ID_ELL, OnEll)
	ON_COMMAND(ID_ROUND, OnRound)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CYuanView construction/destruction

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

}

CYuanView::~CYuanView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CYuanView drawing

void CYuanView::OnDraw(CDC* pDC)
{
	CYuanDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CYuanView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CYuanView diagnostics

#ifdef _DEBUG
void CYuanView::AssertValid() const
{
	CView::AssertValid();
}

void CYuanView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CYuanView message handlers

void CYuanView::OnEll() 
{
	// TODO: Add your command handler code here
	RedrawWindow();//自动重画窗口
	CClientDC dc(this);
	dc.Ellipse(120,100,280,210);
}

void CYuanView::OnRound() 
{
	// TODO: Add your command handler code here
	RedrawWindow();//自动重画窗口
	CClientDC dc(this);
	dc.Ellipse(100,100,280,280);	
}

⌨️ 快捷键说明

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