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

📄 waitcurview.cpp

📁 这个是我们学校用的VC++教案
💻 CPP
字号:
// WaitCurView.cpp : implementation of the CWaitCurView class
//

#include "stdafx.h"
#include "WaitCur.h"

#include "WaitCurDoc.h"
#include "WaitCurView.h"

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


/////////////////////////////////////////////////////////////////////////////
// CWaitCurView

IMPLEMENT_DYNCREATE(CWaitCurView, CView)

BEGIN_MESSAGE_MAP(CWaitCurView, CView)
	//{{AFX_MSG_MAP(CWaitCurView)
	ON_WM_LBUTTONDOWN()
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWaitCurView construction/destruction

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

}

CWaitCurView::~CWaitCurView()
{
}

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

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CWaitCurView drawing

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

/////////////////////////////////////////////////////////////////////////////
// CWaitCurView diagnostics

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

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

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

/////////////////////////////////////////////////////////////////////////////
// CWaitCurView message handlers


void CWaitCurView::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	SetCapture();
	BeginWaitCursor();			// 显示沙漏状光标
	SetTimer(1,2000,NULL);		// 启动一个2秒的计时器
	CView::OnLButtonDown(nFlags, point);
}

void CWaitCurView::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	ReleaseCapture();
	EndWaitCursor();			// 2秒后恢复光标原来的形状
	KillTimer(1);				// 删除计时器
	CView::OnTimer(nIDEvent);
}

⌨️ 快捷键说明

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