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

📄 textview.cpp

📁 mfc例题与练习第二版 例题与练习第二版
💻 CPP
字号:
// TextView.cpp : implementation file
//

#include "stdafx.h"
#include "Exp33_1.h"
#include "exp33_1Doc.h"
#include "element.h"

#include "TextView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTextView

IMPLEMENT_DYNCREATE(CTextView, CView)

CTextView::CTextView()
{
}

CTextView::~CTextView()
{
}


BEGIN_MESSAGE_MAP(CTextView, CView)
	//{{AFX_MSG_MAP(CTextView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTextView drawing

void CTextView::OnDraw(CDC* pDC)
{
	CExp33_1Doc* pDoc = (CExp33_1Doc*)GetDocument();
	// TODO: add draw code here
	POSITION pos;
	TEXTMETRIC tm;
	pDC->GetTextMetrics(&tm);
	int cy,y = 0;
	cy = tm.tmHeight;
	CElement *elem;
	pos = pDoc->m_elemList.GetHeadPosition();
	while(pos!=NULL){  //画出链表中所有图形
			elem = (CElement*)pDoc->m_elemList.GetAt(pos);
			elem->Show(pDC,y);
			pDoc->m_elemList.GetNext(pos);
			y += cy;
	}
}

/////////////////////////////////////////////////////////////////////////////
// CTextView diagnostics

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

void CTextView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CTextView message handlers

void CTextView::OnInitialUpdate() 
{
	CView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	
}

⌨️ 快捷键说明

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