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

📄 mousehandlerview.cpp

📁 Visual+C+++6[1].0实用教程代码 Visual+C+++6[1].0实用教程代码
💻 CPP
字号:
// MouseHandlerView.cpp : implementation of the CMouseHandlerView class
//

#include "stdafx.h"
#include "MouseHandler.h"

#include "MouseHandlerDoc.h"
#include "MouseHandlerView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMouseHandlerView

IMPLEMENT_DYNCREATE(CMouseHandlerView, CView)

BEGIN_MESSAGE_MAP(CMouseHandlerView, CView)
	//{{AFX_MSG_MAP(CMouseHandlerView)
	ON_WM_MOUSEMOVE()
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CMouseHandlerView construction/destruction

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

}

CMouseHandlerView::~CMouseHandlerView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CMouseHandlerView drawing

void CMouseHandlerView::OnDraw(CDC* pDC)
{
	CMouseHandlerDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CMouseHandlerView printing

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CMouseHandlerView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CMouseHandlerView message handlers

void CMouseHandlerView::OnMouseMove(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
CClientDC ClientDC( this );
CString strInfo;
strInfo.Format("X:%d Y:%d",point.x, point.y );
ClientDC.TextOut(10,10, strInfo, strInfo.GetLength() );

}

⌨️ 快捷键说明

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