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

📄 buttonex.h

📁 无聊的时候编写的
💻 H
字号:
#pragma once

enum	BTN_EVENT
{
	EBTN_NORMAL,
	EBNT_MOUSEMOVE,
	EBNT_LBUTTONDOWN,
	EBNT_LBUTTONUP,
	EBTN_RBUTTONDOWN,
	EBTN_RBUTTONUP,
};
class CButtonEx
{
public:
	CButtonEx(void);
	~CButtonEx(void);

	void	Create(const TCHAR* pFile);
	template<class T>	void	SetEvent(BTN_EVENT index,T* pFunc)
	{
		FunHolder*	lpFunc	=	new FreeFunction<T>(pFunc);
		m_mpEvent[index]	=	lpFunc;
	}
	template<class T>	void	SetEvent(BTN_EVENT index,bool (T::*function)(const EventArgs&), T* obj)
	{
		FunHolder*	lpFunc	=	new ClassFunction<T>(function,obj);
		m_mpEvent[index]	=	lpFunc;
	}
	bool	MouseIn( POINT& pt);
	bool	OnLButtonDown(const EventArgs& arg);
	bool	OnMouseMove(const EventArgs& arg);
	bool	OnRButtonDown(const EventArgs& arg);
	bool	OnMouseLeave(const EventArgs& arg);
	void	Move(int x,int y);

	void	Draw(Graphics& grp);

	BTN_EVENT					m_state;
	RECT						m_rect;
	map<BTN_EVENT,FunHolder*>	m_mpEvent;
	Image*						m_pImage;
};

⌨️ 快捷键说明

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