// cursorView.cpp : implementation of the CCursorView class
//
#include "stdafx.h"
#include "cursor.h"
#include "cursorDoc.h"
#include "cursorView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCursorView
IMPLEMENT_DYNCREATE(CCursorView, CView)
BEGIN_MESSAGE_MAP(CCursorView, CView)
//{{AFX_MSG_MAP(CCursorView)
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCursorView construction/destruction
void CCursorView::LoadCursorID(UINT Cur)
{
CurName=Cur;
}
void CCursorView::CapPoint(CPoint MousePos)
{
CRect r;
GetClientRect(&r);
int Width,Hight;
Width=MousePos.x/(r.right/3);
Hight=MousePos.y/(r.bottom/3);
switch(Width)
{case 0:
switch(Hight)
{
case 0:LoadCursorID(IDC_CURSOR1);break;
case 1:LoadCursorID(IDC_CURSOR2);break;
case 2:LoadCursorID(IDC_CURSOR3);break;
}break;
case 1:
switch(Hight)
{
case 0:LoadCursorID(IDC_CURSOR4);break;
case 1:LoadCursorID(IDC_CURSOR5);break;
case 2:LoadCursorID(IDC_CURSOR6);break;
}break;
case 2:
switch(Hight)
{
case 0:LoadCursorID(IDC_CURSOR7);break;
case 1:LoadCursorID(IDC_CURSOR8);break;
case 2:LoadCursorID(IDC_CURSOR9);break;
}break;
}
CUR=AfxGetApp()->LoadCursor(CurName);
Invalidate();
}
CCursorView::CCursorView()
{
// TODO: add construction code here
}
CCursorView::~CCursorView()
{
}
BOOL CCursorView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CCursorView drawing
void CCursorView::OnDraw(CDC* pDC)
{
CCursorDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CCursorView diagnostics
#ifdef _DEBUG
void CCursorView::AssertValid() const
{
CView::AssertValid();
}
void CCursorView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CCursorDoc* CCursorView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCursorDoc)));
return (CCursorDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCursorView message handlers
void CCursorView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CView::OnMouseMove(nFlags, point);
}
æå·²ç»æç
§è¿ç§æ¹æ³è¯è¿äºï¼ä½è¿æ¯éçãé¾éæ¯è½¯ä»¶æé®é¢ï¼
请é®æè±æççVC6.0麽ï¼windows2007å
¼å®¹ç...
ææ¿ä¸å°½ï¼1009529193æ¬äººqq