【VC开源代码栏目提醒】:网学会员为需要VC开源代码的朋友们搜集整理了ControlMouseView.cpp相关资料,希望对各位网友有所帮助!
// ControlMouseView.cpp : CControlMouseView 类的实现
//
#include "stdafx.h"
#include "ControlMouse.h"
#include "ControlMouseDoc.h"
#include "ControlMouseView.h"
#include ".\controlmouseview.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CControlMouseView
IMPLEMENT_DYNCREATE(CControlMouseView, CView)
BEGIN_MESSAGE_MAP(CControlMouseView, CView)
// 标准打印命令
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
ON_WM_MOUSEMOVE()
END_MESSAGE_MAP()
// CControlMouseView 构造/析构
CControlMouseView::CControlMouseView()
{
// TODO: 在此处添加构造代码
}
CControlMouseView::~CControlMouseView()
{
}
BOOL CControlMouseView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: 在此处通过修改 CREATESTRUCT cs 来修改窗口类或
// 样式
return CView::PreCreateWindow(cs);
}
// CControlMouseView 绘制
void CControlMouseView::OnDraw(CDC* /*pDC*/)
{
CControlMouseDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 在此处为本机数据添加绘制代码
}
// CControlMouseView 打印
BOOL CControlMouseView::OnPreparePrinting(CPrintInfo* pInfo)
{
// 默认准备
return DoPreparePrinting(pInfo);
}
void CControlMouseView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印前添加额外的初始化
}
void CControlMouseView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印后添加清除过程
}
// CControlMouseView 诊断
#ifdef _DEBUG
void CControlMouseView::AssertValid() const
{
CView::AssertValid();
}
void CControlMouseView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CControlMouseDoc* CControlMouseView::GetDocument() const // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CControlMouseDoc)));
return (CControlMouseDoc*)m_pDocument;
}
#endif //_DEBUG
// CControlMouseView 消息处理程序
void CControlMouseView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZEALL));//装载鼠标标准指针IDC_SIZEALL
CRect WinRect;
GetClientRect(&WinRect);//得到程序运行的客户区区域WinRect
ClientToScreen(&WinRect);
ClipCursor(&WinRect);//控制鼠标的范围在WinRect中
//以上为自己添写的代码
CView::OnMouseMove(nFlags, point);
}
上一篇:
cust.prg
下一篇:
高职院理实一体信息技术论文