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

📄 guititlebar.h

📁 HGE 2D游戏引擎制作的一个演示
💻 H
字号:
/**********************************************
窗口对象的标题栏类
**********************************************/
#pragma once
#include "GUI.h"
#include "GUIButton.h"


class GUITitleBar :
	public GUI
{
public:
	GUITitleBar(void);
	~GUITitleBar(void);
protected:
	bool				m_bWindowMax;

	bool				m_bShowMaxButton;
	bool				m_bShowMinButton;

	GUI*			m_pLeftRes;
	GUI*			m_pRightRes;
	GUI*			m_pCenterRes;

	GUIButton*			m_pMinButton;
	GUIButton*			m_pMaxButton;
	GUIButton*			m_pRestoreButton;
	GUIButton*			m_pCloseButton;

	float				m_fDistanceCol;							///按钮左右的间距
	float				m_fDistanceRow;							///按钮上下的间距

public:
	bool CreateGUITitleBar(const char* lpszLeftRes,				///标题栏左边绘制资源
		const char* lpszRightRes,								///标题栏右边绘制资源
		const char* lpszCenterRes,								///标题栏中间填充资源
		float w,												///标题栏宽
		float h,												///标题栏高
		GUI *pParent);
	void SetWindowMax(bool bMax);
	bool GetWindowMax();

	void ShowMaxButton(bool bShow);
	void ShowMinButton(bool bShow);

	bool IsMaxButton();
	bool IsMinButton();

	void SetDistance(float col,float row);

	virtual void Updata(float dt);									///更新(遍历子对象)
	virtual int OnMouseLButton(float x,float y,bool down);			///左键按下松开(在区域内)
	virtual int OnMouseLButtonDblclk(float x,float y);				///左键双击
	virtual void OnChildMessage(GUI* pChildGUI,UINT iMsg, WPARAM wParam, LPARAM lParam);

};

⌨️ 快捷键说明

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