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

📄 ch5demo1view.cpp

📁 零基础学Visual.C....教案PPT.随书光盘-452M.zip
💻 CPP
字号:
// Ch5Demo1View.cpp : implementation of the CCh5Demo1View class
//

#include "stdafx.h"
#include "Ch5Demo1.h"

#include "Ch5Demo1Doc.h"
#include "Ch5Demo1View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCh5Demo1View

IMPLEMENT_DYNCREATE(CCh5Demo1View, CView)

BEGIN_MESSAGE_MAP(CCh5Demo1View, CView)
	//{{AFX_MSG_MAP(CCh5Demo1View)
	ON_WM_KEYDOWN()
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CCh5Demo1View construction/destruction

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

}

CCh5Demo1View::~CCh5Demo1View()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CCh5Demo1View drawing

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

/////////////////////////////////////////////////////////////////////////////
// CCh5Demo1View printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CCh5Demo1View diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CCh5Demo1View message handlers

void CCh5Demo1View::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	// TODO: Add your message handler code here and/or call default
	AfxMessageBox("用户按下了键!");
	
	CView::OnKeyDown(nChar, nRepCnt, nFlags);
}

⌨️ 快捷键说明

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