button.h

来自「3D游戏展示程序」· C头文件 代码 · 共 64 行

H
64
字号
//--------------------------------------------------
//  Desc: BUTTON
//  Date: 2006.11.16 /update
//  Author: artsylee
//
//  Copyright (C) 2006 artsylee
//
//--------------------------------------------------

#ifndef _BUTTON_
#define _BUTTON_

#include "Window.h"
#include "../Core/Font.h"

//--------------------------------------------------
// 三态或四态按钮,默认为四态
//--------------------------------------------------
enum BTN_STATE
{
	BTN_NORMAL,
	BTN_OVER,
	BTN_DOWN,
	BTN_DISABLE,

	BTN_STATENUM,
};

class ASE_DLL Button : public CWindow
{
public:
	Button(CWindow* pParent = NULL);
	virtual ~Button();

	virtual void	Render();
	virtual DWORD	ProcessEvent();
	virtual bool	LoadFromIni(char* pfilename, char* pIndex);
	virtual void	Enable();
	virtual void	Disable();
	virtual void	Show(bool c = true);

protected:
	BTN_STATE		m_State;
	GRect			m_DstRect[BTN_STATENUM];
	bool			m_bMouseOn;
	int				m_StateNum;
};

class ASE_DLL CoolButton : public Button
{
public:
	CoolButton(CWindow* pParent = NULL);
	virtual ~CoolButton();

	virtual bool	LoadFromIni(char* pfilename, char* pIndex);
	virtual void	Render();

private:
	CSimFont	m_Font;
	POINT		m_Center;
};

#endif // _BUTTON_

⌨️ 快捷键说明

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