📄 change~1.cpp
字号:
// ChangeCursorView.cpp : implementation of the CChangeCursorView class
//
#include "stdafx.h"
#include "ChangeCursor.h"
#include "ChangeCursorDoc.h"
#include "ChangeCursorView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChangeCursorView
IMPLEMENT_DYNCREATE(CChangeCursorView, CView)
BEGIN_MESSAGE_MAP(CChangeCursorView, CView)
//{{AFX_MSG_MAP(CChangeCursorView)
ON_WM_SETCURSOR()
ON_WM_LBUTTONDOWN()
ON_COMMAND(IDR_VIEW_CURSOR, OnViewCursor)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CChangeCursorView construction/destruction
CChangeCursorView::CChangeCursorView()
{
m_bDrawMode=false;
// TODO: add construction code here
}
CChangeCursorView::~CChangeCursorView()
{
}
BOOL CChangeCursorView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.lpszClass=AfxRegisterWndClass(
CS_DBLCLKS,
AfxGetApp()->LoadStandardCursor(IDC_CROSS),
(HBRUSH)(COLOR_WINDOW+1),
AfxGetApp()->LoadIcon(IDR_MAINFRAME));
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CChangeCursorView drawing
void CChangeCursorView::OnDraw(CDC* pDC)
{
CChangeCursorDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CChangeCursorView printing
BOOL CChangeCursorView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CChangeCursorView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CChangeCursorView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CChangeCursorView diagnostics
#ifdef _DEBUG
void CChangeCursorView::AssertValid() const
{
CView::AssertValid();
}
void CChangeCursorView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CChangeCursorDoc* CChangeCursorView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CChangeCursorDoc)));
return (CChangeCursorDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChangeCursorView message handlers
BOOL CChangeCursorView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if(m_bDrawMode)
{
::SetCursor(AfxGetApp()->LoadCursor(IDC_DRAW_CURSOR));
return TRUE;
}
return CView::OnSetCursor(pWnd, nHitTest, message);
}
void CChangeCursorView::OnLButtonDown(UINT nFlags, CPoint point)
{
::SetCursor(AfxGetApp()->LoadCursor(IDC_DRAW_CURSOR1));
CView::OnLButtonDown(nFlags, point);
}
void CChangeCursorView::OnViewCursor()
{
m_bDrawMode=true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -