outputview.cpp

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

CPP
77
字号
// OutPutView.cpp : implementation file
//

#include "stdafx.h"
#include "Ex010205.h"
#include "OutPutView.h"
#include "Ex010205Doc.h"

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

/////////////////////////////////////////////////////////////////////////////
// COutPutView

IMPLEMENT_DYNCREATE(COutPutView, CScrollView)

COutPutView::COutPutView()
{
}

COutPutView::~COutPutView()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// COutPutView drawing

void COutPutView::OnInitialUpdate()
{
	CScrollView::OnInitialUpdate();

	CSize sizeTotal;
	// TODO: calculate the total size of this view
	sizeTotal.cx = sizeTotal.cy = 100;
	SetScrollSizes(MM_TEXT, sizeTotal);
}

void COutPutView::OnDraw(CDC* pDC)
{
	CEx010205Doc* pDoc = (CEx010205Doc*) GetDocument();
	
	if(pDoc->i_CurStu.m_iScore < 60 )
		pDC->SetTextColor(RGB(255,0,0));
	
	CString str ;
	str.Format("学号 = %d 成绩 = %d ",pDoc->i_CurStu.m_iStuNo,pDoc->i_CurStu.m_iScore);
	pDC->TextOut(0,100,str);
}

/////////////////////////////////////////////////////////////////////////////
// COutPutView diagnostics

#ifdef _DEBUG
void COutPutView::AssertValid() const
{
	CScrollView::AssertValid();
}

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

/////////////////////////////////////////////////////////////////////////////
// COutPutView message handlers

⌨️ 快捷键说明

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