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

📄 s8_5view.cpp

📁 四川大学教学的MFC的ppt 以及源代码
💻 CPP
字号:
// s8_5View.cpp : implementation of the CS8_5View class
//

#include "stdafx.h"
#include "s8_5.h"

#include "s8_5Doc.h"
#include "s8_5View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CS8_5View

IMPLEMENT_DYNCREATE(CS8_5View, CView)

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

/////////////////////////////////////////////////////////////////////////////
// CS8_5View construction/destruction

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

}

CS8_5View::~CS8_5View()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CS8_5View drawing

void CS8_5View::OnDraw(CDC* pDC)
{
	CS8_5Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	pDC->TextOut(0, 0, pDoc->m_strText);
}

/////////////////////////////////////////////////////////////////////////////
// CS8_5View printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CS8_5View diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CS8_5View message handlers

void CS8_5View::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	// TODO: Add your message handler code here and/or call default
	CS8_5Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	pDoc->m_strText += nChar;
	Invalidate();

	CView::OnChar(nChar, nRepCnt, nFlags);
}

⌨️ 快捷键说明

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