ex050201view.cpp

来自「深入浅出Visual C++入门进阶与应用实例 随书光盘 作者 何志丹」· C++ 代码 · 共 116 行

CPP
116
字号
// Ex050201View.cpp : implementation of the CEx050201View class
//

#include "stdafx.h"
#include "Ex050201.h"

#include "Ex050201Doc.h"
#include "Ex050201View.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEx050201View

IMPLEMENT_DYNCREATE(CEx050201View, CEditView)

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

/////////////////////////////////////////////////////////////////////////////
// CEx050201View construction/destruction

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

}

CEx050201View::~CEx050201View()
{
}

BOOL CEx050201View::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs
	BOOL bPreCreated = CEditView::PreCreateWindow(cs);
	cs.style &= ~(ES_AUTOHSCROLL|WS_HSCROLL);	// Enable word-wrapping

	return bPreCreated;
}

/////////////////////////////////////////////////////////////////////////////
// CEx050201View drawing

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

/////////////////////////////////////////////////////////////////////////////
// CEx050201View printing

BOOL CEx050201View::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default CEditView preparation
	return CEditView::OnPreparePrinting(pInfo);
}

void CEx050201View::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView begin printing.
	CEditView::OnBeginPrinting(pDC, pInfo);
}

void CEx050201View::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	// Default CEditView end printing
	CEditView::OnEndPrinting(pDC, pInfo);
}

/////////////////////////////////////////////////////////////////////////////
// CEx050201View diagnostics

#ifdef _DEBUG
void CEx050201View::AssertValid() const
{
	CEditView::AssertValid();
}

void CEx050201View::Dump(CDumpContext& dc) const
{
	CEditView::Dump(dc);
}

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

/////////////////////////////////////////////////////////////////////////////
// CEx050201View message handlers

void CEx050201View::OnTextNotFound(LPCTSTR lpszFind)
{
	CString strMess ;
	strMess.Format("查找字符串\"%s\"完毕",lpszFind);
	MessageBox(strMess);
}

⌨️ 快捷键说明

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