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

📄 button_boring.h

📁 这是一款2d游戏引擎
💻 H
字号:
/*  $Id: button_boring.h,v 1.7 2004/01/03 23:03:22 sphair Exp $
	
	ClanGUI, copyrights by various people. Have a look in the CREDITS file.
	
	This sourcecode is distributed using the Library GNU Public Licence,
	version 2 or (at your option) any later version. Please read LICENSE
	for details.
*/

//! clanGUI="Style: Boring"
//! header=guistyleboring.h

#ifndef header_button_boring
#define header_button_boring

#if _MSC_VER > 1000
#pragma once
#endif

#include "../GUI/button.h"
#include "../GUI/component_style.h"

class CL_Font;
class CL_Surface;
class CL_StyleManager_Boring;

//: Button default style.
//- !group=GUI/Style: Boring!
//- !header=guistyleboring.h!
//- <p>Script attributes:</p>
//- <ul>
//- <li>font: The font used to draw the label. [String]</li>
//- <li>font_disabled: The font used to draw the label in disabled mode. [String]</li>
//- </ul>
//- <p>Note that it inherits the attributes of CL_Button and CL_Component as well.</p>
class CL_Button_Boring : public CL_ComponentStyle
{
//! Construction:
public:
	//: Constructor
	CL_Button_Boring(
		CL_Button *button,
		CL_StyleManager_Boring *style);

	//: Destructor
	virtual ~CL_Button_Boring();

//! Operations:
public:
	//: Sets the font used to draw the label.
	//- <p>If 'delete_font' is true, the font will be deleted when the component is deleted.</p>
	void set_font(CL_Font *font, bool delete_font = false);

	//: Sets the font used to draw the label in disabled mode.
	//- <p>If 'delete_font' is true, the font will be deleted when the component is deleted.</p>
	void set_font_disabled(CL_Font *font, bool delete_font = false);
	
//! Implementation:
private:
	void on_set_options(const CL_DomElement &options);
	CL_Slot slot_set_options;

	void on_paint();
	CL_Slot slot_paint;

	void on_get_preferred_size(CL_Size &size);
	CL_Slot slot_get_preferred_size;

	void on_pressed();
	CL_Slot slot_pressed;

	void on_released();
	CL_Slot slot_released;

	CL_Button *button;
	
	CL_StyleManager_Boring *style;
	CL_ResourceManager *resources;

	CL_Font *font;
	CL_Font *font_disabled;

	bool delete_font;
	bool delete_font_disabled;
	
	bool down;
};

#endif

⌨️ 快捷键说明

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