sercomnewview2.cpp

来自「自己做的一个串口通信的程序」· C++ 代码 · 共 79 行

CPP
79
字号
// SerComNewView2.cpp : implementation file
//

#include "stdafx.h"
#include "SerComNew.h"
#include "SerComNewView2.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSerComNewView2

IMPLEMENT_DYNCREATE(CSerComNewView2, CScrollView)

CSerComNewView2::CSerComNewView2()
{
}

CSerComNewView2::~CSerComNewView2()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CSerComNewView2 drawing

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

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

void CSerComNewView2::OnDraw(CDC* pDC)
{
	CSerComNewDoc* pDoc = (CSerComNewDoc*)GetDocument();
	// TODO: add draw code here
	TEXTMETRIC tm;
	GetTextMetrics(pDC->m_hDC,&tm);
	long x,y;
	x=0;
	for(int i=0;i<pDoc->m_strArray.GetSize();i++)
	{
		y=i*tm.tmHeight;
		pDC->TextOut(x,y,pDoc->m_strArray.GetAt(i));
	}
}

/////////////////////////////////////////////////////////////////////////////
// CSerComNewView2 diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CSerComNewView2 message handlers

⌨️ 快捷键说明

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