ex120800eview.cpp

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

CPP
111 行
字号
// Ex120800eView.cpp : implementation of the CEx120800eView class
//

#include "stdafx.h"
#include "Ex120800e.h"

#include "Ex120800eDoc.h"
#include "Ex120800eView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CEx120800eView

IMPLEMENT_DYNCREATE(CEx120800eView, CView)

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

/////////////////////////////////////////////////////////////////////////////
// CEx120800eView construction/destruction

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

}

CEx120800eView::~CEx120800eView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CEx120800eView drawing

void CEx120800eView::OnDraw(CDC* pDC)
{
	CString strOut = "www.vcshare.net欢迎你!" ;
	//显示不下的部分被略去
	pDC->DrawText (strOut, CRect (10, 10, 80, 30), DT_LEFT ); 
	//显示不下的部分被省略号代替
	pDC->DrawText (strOut, CRect (10, 30, 80, 50), DT_LEFT | DT_END_ELLIPSIS ); 

	//路径过长,显示省略号
	strOut = "G:\\VCBook\\Ex120800e" ;
	pDC->DrawText (strOut, CRect (10, 50, 80, 70), DT_LEFT | DT_PATH_ELLIPSIS ); 
}

/////////////////////////////////////////////////////////////////////////////
// CEx120800eView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CEx120800eView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CEx120800eView message handlers

⌨️ 快捷键说明

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