anotherview.cpp

来自「开发环境为EVC」· C++ 代码 · 共 69 行

CPP
69
字号
// AnotherView.cpp : implementation file
//

#include "stdafx.h"
#include "TestDoc.h"
#include "AnotherView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAnotherView

IMPLEMENT_DYNCREATE(CAnotherView, CView)

CAnotherView::CAnotherView()
{
}

CAnotherView::~CAnotherView()
{
}


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

/////////////////////////////////////////////////////////////////////////////
// CAnotherView drawing

void CAnotherView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
	if(!m_strContent.IsEmpty())
		pDC->ExtTextOut(m_ptContent.x, m_ptContent.y, ETO_OPAQUE, NULL, m_strContent, m_strContent.GetLength(), NULL);
}

/////////////////////////////////////////////////////////////////////////////
// CAnotherView diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CAnotherView message handlers
void CAnotherView::OnMouseMove(UINT nFlags, CPoint lParam)
{
	m_ptContent = lParam;
	m_strContent = "Hello world!";
	Invalidate();
}

⌨️ 快捷键说明

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