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

📄 cursor.cpp

📁 hl2 source code. Do not use it illegal.
💻 CPP
字号:
/*----------------------------------------------------------------------
Copyright (c) 1998 Gipsysoft. All Rights Reserved.
Please see the file "licence.txt" for licencing details.

File:	cursor.cpp
Owner:	russf@gipsysoft.com
Purpose:	Cursor abstraction.
----------------------------------------------------------------------*/
#include "stdafx.h"
#include "Cursor.h"
#include "QHTM_Includes.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCursor::CCursor()
	: m_cursor( knArrow )
{

}

CCursor::~CCursor()
{

}


void CCursor::Load( CursorShape c )
{
	m_cursor = c;
}


void CCursor::Set()
{
	//	REVIEW - russf - OS specific code
	HCURSOR cur = NULL;
	switch( m_cursor )
	{
	case knArrow:
		cur = ::LoadCursor( NULL, IDC_ARROW );
		break;

	case knHand:
		cur = ::LoadCursor( NULL, MAKEINTRESOURCE(/*IDC_HAND*/32649) );
		if (!cur)
		{
			cur = ::LoadCursor( g_hResourceInstance, MAKEINTRESOURCE( g_uHandCursorID ) );
		}
		break;

	default:
		TRACE(_T("Invalid cursor shape used\n"));
		ASSERT( FALSE );
		break;
	}

	//	If this fires then you have not yet added the resources from QHTM (cursor, bitmap)		
	ASSERT( cur );
	SetCursor( cur );
}

⌨️ 快捷键说明

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