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

📄 layout.h

📁 这是一款2d游戏引擎
💻 H
字号:
/*  $Id: layout.h,v 1.6 2004/01/07 23:47:59 mbn Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
**
*/

//! clanGUI="Framework"
//! header=gui.h

#ifndef header_layout
#define header_layout

class CL_Component;
class CL_Layout_Generic;
class CL_Rect;

//: Layout types for CL_Layout.
//- !group=GUI/Framework!
//- !header=gui.h!
enum CL_LayoutType
{
	layout_vertical,
	layout_horizontal,
	layout_grid
};

//: Layout management class.
//- !group=GUI/Framework!
//- !header=gui.h!
class CL_Layout
{
//! Construction:
public:
	CL_Layout();

	CL_Layout(const CL_Layout &copy);

	CL_Layout(CL_LayoutType type);

	virtual ~CL_Layout();

//! Operations:
public:
	CL_Layout &operator =(const CL_Layout &copy);

	void set_grid_columns(int columns);

	void set_margin(int margin);

	void set_spacing(int spacing);

	void add_component(CL_Component *component);

	void add_component(int index, CL_Component *component);

	void add_component(int col, int row, CL_Component *component, int span=1);

	void add_layout(const CL_Layout &layout);

	void add_layout(int index, const CL_Layout &layout);

	void add_layout(int col, int row, const CL_Layout &layout, int span=1);

	void remove_component(CL_Component *component);

	void remove_layout(CL_Layout *layout);

	void set_position(const CL_Rect &pos);

//! Implementation:
private:
	CL_Layout_Generic *impl;
};

#endif

⌨️ 快捷键说明

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