【VC开源代码栏目提醒】:网学会员VC开源代码为您提供ChgMseFgrView.cpp参考,解决您在ChgMseFgrView.cpp学习中工作中的难题,参考学习。
// ChgMseFgrView.cpp : implementation of the CChgMseFgrView class
//
#include "stdafx.h"
#include "ChgMseFgr.h"
#include "ChgMseFgrDoc.h"
#include "ChgMseFgrView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChgMseFgrView
IMPLEMENT_DYNCREATE(CChgMseFgrView, CView)
BEGIN_MESSAGE_MAP(CChgMseFgrView, CView)
//{{AFX_MSG_MAP(CChgMseFgrView)
ON_COMMAND(ID_ARROW, OnArrow)
ON_COMMAND(ID_CROSS, OnCross)
ON_WM_MOUSEMOVE()
ON_COMMAND(ID_UPARROW, OnUparrow)
ON_COMMAND(ID_WAIT, OnWait)
ON_COMMAND(ID_PEN, OnPen)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CChgMseFgrView construction/destruction
CChgMseFgrView::CChgMseFgrView()
{
// TODO: add construction code here
}
CChgMseFgrView::~CChgMseFgrView()
{
}
BOOL CChgMseFgrView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CChgMseFgrView drawing
void CChgMseFgrView::OnDraw(CDC* pDC)
{
CChgMseFgrDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CChgMseFgrView printing
BOOL CChgMseFgrView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CChgMseFgrView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CChgMseFgrView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CChgMseFgrView diagnostics
#ifdef _DEBUG
void CChgMseFgrView::AssertValid() const
{
CView::AssertValid();
}
void CChgMseFgrView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CChgMseFgrDoc* CChgMseFgrView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CChgMseFgrDoc)));
return (CChgMseFgrDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChgMseFgrView message handlers
void CChgMseFgrView::OnInitialUpdate()
{
CView::OnInitialUpdate();
GetClientRect(&rect);
// TODO: Add your specialized code here and/or call the base class
}
void CChgMseFgrView::OnArrow()
{
// TODO: Add your command handler code here
MouseFiger=0;
}
void CChgMseFgrView::OnCross()
{
// TODO: Add your command handler code here
MouseFiger=1;
}
void CChgMseFgrView::OnUparrow()
{
// TODO: Add your command handler code here
MouseFiger=2;
}
void CChgMseFgrView::OnWait()
{
// TODO: Add your command handler code here
MouseFiger=3;
}
void CChgMseFgrView::OnPen()
{
// TODO: Add your command handler code here
MouseFiger=4;
}
void CChgMseFgrView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(!rect.PtInRect(point))
{
if( GetCapture() != this )
return;
ReleaseCapture();
}
else
{
switch(MouseFiger)
{
case 0:
SetCursor(LoadCursor(NULL,IDC_ARROW));//显示普通箭头光标
break;
case 1:
SetCursor(LoadCursor(NULL,IDC_CROSS));//显示十字形光标
break;
case 2:
SetCursor(LoadCursor(NULL,IDC_UPARROW));//显示向上箭头光标
break;
case 3:
SetCursor(LoadCursor(NULL,IDC_WAIT));//显示向上箭头光标
break;
case 4:
SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));//使用自绘光标
}
SetCapture();
}
CView::OnMouseMove(nFlags, point);
}
上一篇:
ChgMseFgrDoc.cpp
下一篇:
西班牙语医院科室名称