11a726098SIngo Weinhold/*
21bfa46f2SAxel Dörfler * Copyright 2009-2015, Haiku, Inc. All rights reserved.
31a726098SIngo Weinhold * Distributed under the terms of the MIT License.
41a726098SIngo Weinhold */
51a726098SIngo Weinhold#ifndef	_LAYOUT_BUILDER_H
61a726098SIngo Weinhold#define	_LAYOUT_BUILDER_H
71a726098SIngo Weinhold
8617ebd88SAxel Dörfler
96bb10e96SIngo Weinhold#include <new>
106bb10e96SIngo Weinhold
1152c07497SMarkus Himmel#include <CardLayout.h>
1252c07497SMarkus Himmel#include <CardView.h>
131a726098SIngo Weinhold#include <GridLayout.h>
141a726098SIngo Weinhold#include <GridView.h>
151a726098SIngo Weinhold#include <GroupLayout.h>
161a726098SIngo Weinhold#include <GroupView.h>
176bb10e96SIngo Weinhold#include <Menu.h>
18617ebd88SAxel Dörfler#include <MenuField.h>
196bb10e96SIngo Weinhold#include <MenuItem.h>
201a726098SIngo Weinhold#include <SpaceLayoutItem.h>
211a726098SIngo Weinhold#include <SplitView.h>
22617ebd88SAxel Dörfler#include <TextControl.h>
232a3974d3SIngo Weinhold#include <Window.h>
241a726098SIngo Weinhold
251a726098SIngo Weinhold
261a726098SIngo Weinholdnamespace BLayoutBuilder {
271a726098SIngo Weinhold
281a726098SIngo Weinholdtemplate<typename ParentBuilder> class Base;
291a726098SIngo Weinholdtemplate<typename ParentBuilder = void*> class Group;
301a726098SIngo Weinholdtemplate<typename ParentBuilder = void*> class Grid;
311a726098SIngo Weinholdtemplate<typename ParentBuilder = void*> class Split;
3252c07497SMarkus Himmeltemplate<typename ParentBuilder = void*> class Cards;
336bb10e96SIngo Weinholdtemplate<typename ParentBuilder = void*> class Menu;
346bb10e96SIngo Weinholdtemplate<typename ParentBuilder = void*> class MenuItem;
351a726098SIngo Weinhold
361a726098SIngo Weinhold
371a726098SIngo Weinholdtemplate<typename ParentBuilder>
381a726098SIngo Weinholdclass Base {
391a726098SIngo Weinholdprotected:
401a726098SIngo Weinhold	inline						Base();
411a726098SIngo Weinhold
421a726098SIngo Weinholdpublic:
431a726098SIngo Weinhold	inline	void				SetParent(ParentBuilder* parent);
44d61def1dSJonas Sundström		// conceptually private
451a726098SIngo Weinhold	inline	ParentBuilder&		End();
461a726098SIngo Weinhold
471a726098SIngo Weinholdprotected:
481a726098SIngo Weinhold			ParentBuilder*		fParent;
491a726098SIngo Weinhold};
501a726098SIngo Weinhold
511a726098SIngo Weinhold
521a726098SIngo Weinholdtemplate<typename ParentBuilder>
531a726098SIngo Weinholdclass Group : public Base<ParentBuilder> {
541a726098SIngo Weinholdpublic:
551a726098SIngo Weinhold	typedef Group<ParentBuilder>	ThisBuilder;
561a726098SIngo Weinhold	typedef Group<ThisBuilder>		GroupBuilder;
571a726098SIngo Weinhold	typedef Grid<ThisBuilder>		GridBuilder;
581a726098SIngo Weinhold	typedef Split<ThisBuilder>		SplitBuilder;
5952c07497SMarkus Himmel	typedef Cards<ThisBuilder>		CardBuilder;
601a726098SIngo Weinhold
611a726098SIngo Weinholdpublic:
62e724b26fSJohn Scipione	inline						Group(orientation orientation = B_HORIZONTAL,
6382ab3167SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING);
642a3974d3SIngo Weinhold	inline						Group(BWindow* window,
65e724b26fSJohn Scipione									orientation orientation = B_HORIZONTAL,
6682ab3167SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING);
678ef19442SAlex Wilson	inline						Group(BView* view,
68e724b26fSJohn Scipione									orientation orientation = B_HORIZONTAL,
698ef19442SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING);
701a726098SIngo Weinhold	inline						Group(BGroupLayout* layout);
711a726098SIngo Weinhold	inline						Group(BGroupView* view);
721a726098SIngo Weinhold
731a726098SIngo Weinhold	inline	BGroupLayout*		Layout() const;
741a726098SIngo Weinhold	inline	BView*				View() const;
751a726098SIngo Weinhold	inline	ThisBuilder&		GetLayout(BGroupLayout** _layout);
761a726098SIngo Weinhold	inline	ThisBuilder&		GetView(BView** _view);
771a726098SIngo Weinhold
781a726098SIngo Weinhold	inline	ThisBuilder&		Add(BView* view);
791a726098SIngo Weinhold	inline	ThisBuilder&		Add(BView* view, float weight);
801a726098SIngo Weinhold	inline	ThisBuilder&		Add(BLayoutItem* item);
811a726098SIngo Weinhold	inline	ThisBuilder&		Add(BLayoutItem* item, float weight);
821a726098SIngo Weinhold
83e724b26fSJohn Scipione	inline	GroupBuilder		AddGroup(orientation orientation,
8482ab3167SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING,
8582ab3167SAlex Wilson									float weight = 1.0f);
861d6c7b6cSAlex Wilson	inline	GroupBuilder		AddGroup(BGroupView* groupView,
871d6c7b6cSAlex Wilson									float weight = 1.0f);
881d6c7b6cSAlex Wilson	inline	GroupBuilder		AddGroup(BGroupLayout* groupLayout,
891d6c7b6cSAlex Wilson									float weight = 1.0f);
901d6c7b6cSAlex Wilson
9182ab3167SAlex Wilson	inline	GridBuilder			AddGrid(float horizontal
9282ab3167SAlex Wilson										= B_USE_DEFAULT_SPACING,
9382ab3167SAlex Wilson									float vertical = B_USE_DEFAULT_SPACING,
941a726098SIngo Weinhold									float weight = 1.0f);
951d6c7b6cSAlex Wilson	inline	GridBuilder			AddGrid(BGridLayout* gridLayout,
961d6c7b6cSAlex Wilson									float weight = 1.0f);
971d6c7b6cSAlex Wilson	inline	GridBuilder			AddGrid(BGridView* gridView,
981d6c7b6cSAlex Wilson									float weight = 1.0f);
991d6c7b6cSAlex Wilson
100e724b26fSJohn Scipione	inline	SplitBuilder		AddSplit(orientation orientation,
10182ab3167SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING,
10282ab3167SAlex Wilson									float weight = 1.0f);
1031d6c7b6cSAlex Wilson	inline	SplitBuilder		AddSplit(BSplitView* splitView,
1041d6c7b6cSAlex Wilson									float weight = 1.0f);
1051a726098SIngo Weinhold
10652c07497SMarkus Himmel	inline	CardBuilder			AddCards(float weight = 1.0f);
10752c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardLayout* cardLayout,
10852c07497SMarkus Himmel									float weight = 1.0f);
10952c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardView* cardView,
11052c07497SMarkus Himmel									float weight = 1.0f);
11152c07497SMarkus Himmel
1121a726098SIngo Weinhold	inline	ThisBuilder&		AddGlue(float weight = 1.0f);
1131a726098SIngo Weinhold	inline	ThisBuilder&		AddStrut(float size);
1141a726098SIngo Weinhold
1151a726098SIngo Weinhold	inline	ThisBuilder&		SetInsets(float left, float top, float right,
1161a726098SIngo Weinhold									float bottom);
117813147dfSAlex Wilson	inline	ThisBuilder&		SetInsets(float horizontal, float vertical);
118813147dfSAlex Wilson	inline	ThisBuilder&		SetInsets(float insets);
1191a726098SIngo Weinhold
1202267b7e7SAxel Dörfler	inline	ThisBuilder&		SetExplicitMinSize(BSize size);
1212267b7e7SAxel Dörfler	inline	ThisBuilder&		SetExplicitMaxSize(BSize size);
1222267b7e7SAxel Dörfler	inline	ThisBuilder&		SetExplicitPreferredSize(BSize size);
12317ad59afSAxel Dörfler	inline	ThisBuilder&		SetExplicitAlignment(BAlignment alignment);
1242267b7e7SAxel Dörfler
1251a726098SIngo Weinhold	inline						operator BGroupLayout*();
1261a726098SIngo Weinhold
1271a726098SIngo Weinholdprivate:
1281a726098SIngo Weinhold			BGroupLayout*		fLayout;
1291a726098SIngo Weinhold};
1301a726098SIngo Weinhold
1311a726098SIngo Weinhold
1321a726098SIngo Weinholdtemplate<typename ParentBuilder>
1331a726098SIngo Weinholdclass Grid : public Base<ParentBuilder> {
1341a726098SIngo Weinholdpublic:
1351a726098SIngo Weinhold	typedef Grid<ParentBuilder>		ThisBuilder;
1361a726098SIngo Weinhold	typedef Group<ThisBuilder>		GroupBuilder;
1371a726098SIngo Weinhold	typedef Grid<ThisBuilder>		GridBuilder;
1381a726098SIngo Weinhold	typedef Split<ThisBuilder>		SplitBuilder;
13952c07497SMarkus Himmel	typedef Cards<ThisBuilder>		CardBuilder;
1401a726098SIngo Weinhold
1411a726098SIngo Weinholdpublic:
14282ab3167SAlex Wilson	inline						Grid(float horizontal
14382ab3167SAlex Wilson										= B_USE_DEFAULT_SPACING,
14482ab3167SAlex Wilson									float vertical = B_USE_DEFAULT_SPACING);
1452a3974d3SIngo Weinhold	inline						Grid(BWindow* window,
14682ab3167SAlex Wilson									float horizontal = B_USE_DEFAULT_SPACING,
14782ab3167SAlex Wilson									float vertical = B_USE_DEFAULT_SPACING);
1488ef19442SAlex Wilson	inline						Grid(BView* view,
1498ef19442SAlex Wilson									float horizontal = B_USE_DEFAULT_SPACING,
1508ef19442SAlex Wilson									float vertical = B_USE_DEFAULT_SPACING);
1511a726098SIngo Weinhold	inline						Grid(BGridLayout* layout);
1521a726098SIngo Weinhold	inline						Grid(BGridView* view);
1531a726098SIngo Weinhold
1541a726098SIngo Weinhold	inline	BGridLayout*		Layout() const;
1551a726098SIngo Weinhold	inline	BView*				View() const;
1561a726098SIngo Weinhold	inline	ThisBuilder&		GetLayout(BGridLayout** _layout);
1571a726098SIngo Weinhold	inline	ThisBuilder&		GetView(BView** _view);
1581a726098SIngo Weinhold
1591a726098SIngo Weinhold	inline	ThisBuilder&		Add(BView* view, int32 column, int32 row,
1601a726098SIngo Weinhold									int32 columnCount = 1, int32 rowCount = 1);
1611a726098SIngo Weinhold	inline	ThisBuilder&		Add(BLayoutItem* item, int32 column, int32 row,
1621a726098SIngo Weinhold									int32 columnCount = 1, int32 rowCount = 1);
163617ebd88SAxel Dörfler	inline	ThisBuilder&		AddMenuField(BMenuField* menuField,
164617ebd88SAxel Dörfler									int32 column, int32 row,
165617ebd88SAxel Dörfler									alignment labelAlignment
166617ebd88SAxel Dörfler										= B_ALIGN_HORIZONTAL_UNSET,
167e4acf496SIngo Weinhold									int32 labelColumnCount = 1,
168e4acf496SIngo Weinhold									int32 fieldColumnCount = 1,
169e4acf496SIngo Weinhold									int32 rowCount = 1);
170617ebd88SAxel Dörfler	inline	ThisBuilder&		AddTextControl(BTextControl* textControl,
171617ebd88SAxel Dörfler									int32 column, int32 row,
172617ebd88SAxel Dörfler									alignment labelAlignment
173617ebd88SAxel Dörfler										= B_ALIGN_HORIZONTAL_UNSET,
174e4acf496SIngo Weinhold									int32 labelColumnCount = 1,
175e4acf496SIngo Weinhold									int32 textColumnCount = 1,
176e4acf496SIngo Weinhold									int32 rowCount = 1);
1771a726098SIngo Weinhold
178e724b26fSJohn Scipione	inline	GroupBuilder		AddGroup(orientation orientation,
1791a726098SIngo Weinhold									float spacing, int32 column, int32 row,
1801a726098SIngo Weinhold									int32 columnCount = 1, int32 rowCount = 1);
1811d6c7b6cSAlex Wilson	inline	GroupBuilder		AddGroup(BGroupView* groupView,	int32 column,
1821d6c7b6cSAlex Wilson									int32 row, int32 columnCount = 1,
1831d6c7b6cSAlex Wilson									int32 rowCount = 1);
184e4acf496SIngo Weinhold	inline	GroupBuilder		AddGroup(BGroupLayout* groupLayout,
1851d6c7b6cSAlex Wilson									int32 column, int32 row,
1861d6c7b6cSAlex Wilson									int32 columnCount = 1, int32 rowCount = 1);
1871d6c7b6cSAlex Wilson
1881a726098SIngo Weinhold	inline	GridBuilder			AddGrid(float horizontalSpacing,
1891a726098SIngo Weinhold									float verticalSpacing, int32 column,
1901a726098SIngo Weinhold									int32 row, int32 columnCount = 1,
1911a726098SIngo Weinhold									int32 rowCount = 1);
1921d6c7b6cSAlex Wilson	inline	GridBuilder			AddGrid(BGridLayout* gridLayout,
1931d6c7b6cSAlex Wilson									int32 column, int32 row,
1941d6c7b6cSAlex Wilson									int32 columnCount = 1, int32 rowCount = 1);
1951d6c7b6cSAlex Wilson	inline	GridBuilder			AddGrid(BGridView* gridView,
1961d6c7b6cSAlex Wilson									int32 column, int32 row,
1971d6c7b6cSAlex Wilson									int32 columnCount = 1, int32 rowCount = 1);
1981d6c7b6cSAlex Wilson
199e724b26fSJohn Scipione	inline	SplitBuilder		AddSplit(orientation orientation,
2001a726098SIngo Weinhold									float spacing, int32 column, int32 row,
2011a726098SIngo Weinhold									int32 columnCount = 1, int32 rowCount = 1);
2021d6c7b6cSAlex Wilson	inline	SplitBuilder		AddSplit(BSplitView* splitView, int32 column,
2031d6c7b6cSAlex Wilson									int32 row, int32 columnCount = 1,
2041d6c7b6cSAlex Wilson									int32 rowCount = 1);
2051a726098SIngo Weinhold
20652c07497SMarkus Himmel	inline	CardBuilder			AddCards(int32 column, int32 row,
20752c07497SMarkus Himmel									int32 columnCount = 1, int32 rowCount = 1);
20852c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardLayout* cardLayout, int32 column,
20952c07497SMarkus Himmel									int32 row, int32 columnCount = 1,
21052c07497SMarkus Himmel									int32 rowCount = 1);
21152c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardView* cardView, int32 column,
21252c07497SMarkus Himmel									int32 row, int32 columnCount = 1,
21352c07497SMarkus Himmel									int32 rowCount = 1);
21452c07497SMarkus Himmel
2152267b7e7SAxel Dörfler	inline	ThisBuilder&		AddGlue(int32 column, int32 row,
2162267b7e7SAxel Dörfler									int32 columnCount = 1, int32 rowCount = 1);
2172267b7e7SAxel Dörfler
2181bfa46f2SAxel Dörfler	inline	ThisBuilder&		SetHorizontalSpacing(float spacing);
2191bfa46f2SAxel Dörfler	inline	ThisBuilder&		SetVerticalSpacing(float spacing);
2201bfa46f2SAxel Dörfler	inline	ThisBuilder&		SetSpacing(float horizontal, float vertical);
2211bfa46f2SAxel Dörfler
2221a726098SIngo Weinhold	inline	ThisBuilder&		SetColumnWeight(int32 column, float weight);
2231a726098SIngo Weinhold	inline	ThisBuilder&		SetRowWeight(int32 row, float weight);
2241a726098SIngo Weinhold
2251a726098SIngo Weinhold	inline	ThisBuilder&		SetInsets(float left, float top, float right,
2261a726098SIngo Weinhold									float bottom);
227813147dfSAlex Wilson	inline	ThisBuilder&		SetInsets(float horizontal, float vertical);
228813147dfSAlex Wilson	inline	ThisBuilder&		SetInsets(float insets);
2291a726098SIngo Weinhold
2302267b7e7SAxel Dörfler	inline	ThisBuilder&		SetExplicitMinSize(BSize size);
2312267b7e7SAxel Dörfler	inline	ThisBuilder&		SetExplicitMaxSize(BSize size);
2322267b7e7SAxel Dörfler	inline	ThisBuilder&		SetExplicitPreferredSize(BSize size);
23317ad59afSAxel Dörfler	inline	ThisBuilder&		SetExplicitAlignment(BAlignment alignment);
2342267b7e7SAxel Dörfler
2351a726098SIngo Weinhold	inline						operator BGridLayout*();
2361a726098SIngo Weinhold
2371a726098SIngo Weinholdprivate:
2381a726098SIngo Weinhold			BGridLayout*		fLayout;
2391a726098SIngo Weinhold};
2401a726098SIngo Weinhold
2411a726098SIngo Weinhold
2421a726098SIngo Weinholdtemplate<typename ParentBuilder>
2431a726098SIngo Weinholdclass Split : public Base<ParentBuilder> {
2441a726098SIngo Weinholdpublic:
2451a726098SIngo Weinhold	typedef Split<ParentBuilder>	ThisBuilder;
2461a726098SIngo Weinhold	typedef Group<ThisBuilder>		GroupBuilder;
2471a726098SIngo Weinhold	typedef Grid<ThisBuilder>		GridBuilder;
2481a726098SIngo Weinhold	typedef Split<ThisBuilder>		SplitBuilder;
24952c07497SMarkus Himmel	typedef Cards<ThisBuilder>		CardBuilder;
2501a726098SIngo Weinhold
2511a726098SIngo Weinholdpublic:
252e724b26fSJohn Scipione	inline						Split(orientation orientation = B_HORIZONTAL,
25382ab3167SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING);
2541a726098SIngo Weinhold	inline						Split(BSplitView* view);
2551a726098SIngo Weinhold
2561a726098SIngo Weinhold	inline	BSplitView*			View() const;
2571d6c7b6cSAlex Wilson	inline	ThisBuilder&		GetView(BView** _view);
2581d6c7b6cSAlex Wilson	inline	ThisBuilder&		GetSplitView(BSplitView** _view);
2591a726098SIngo Weinhold
2601a726098SIngo Weinhold	inline	ThisBuilder&		Add(BView* view);
2611a726098SIngo Weinhold	inline	ThisBuilder&		Add(BView* view, float weight);
2621a726098SIngo Weinhold	inline	ThisBuilder&		Add(BLayoutItem* item);
2631a726098SIngo Weinhold	inline	ThisBuilder&		Add(BLayoutItem* item, float weight);
2641a726098SIngo Weinhold
265e724b26fSJohn Scipione	inline	GroupBuilder		AddGroup(orientation orientation,
26682ab3167SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING,
26782ab3167SAlex Wilson									float weight = 1.0f);
2681d6c7b6cSAlex Wilson	inline	GroupBuilder		AddGroup(BGroupView* groupView,
2691d6c7b6cSAlex Wilson									float weight = 1.0f);
2701d6c7b6cSAlex Wilson	inline	GroupBuilder		AddGroup(BGroupLayout* groupLayout,
2711d6c7b6cSAlex Wilson									float weight = 1.0f);
2721d6c7b6cSAlex Wilson
27382ab3167SAlex Wilson	inline	GridBuilder			AddGrid(float horizontal
27482ab3167SAlex Wilson											= B_USE_DEFAULT_SPACING,
27582ab3167SAlex Wilson									float vertical = B_USE_DEFAULT_SPACING,
2761a726098SIngo Weinhold									float weight = 1.0f);
2771d6c7b6cSAlex Wilson	inline	GridBuilder			AddGrid(BGridView* gridView,
2781d6c7b6cSAlex Wilson									float weight = 1.0f);
2791d6c7b6cSAlex Wilson	inline	GridBuilder			AddGrid(BGridLayout* gridLayout,
2801d6c7b6cSAlex Wilson									float weight = 1.0f);
2811d6c7b6cSAlex Wilson
282e724b26fSJohn Scipione	inline	SplitBuilder		AddSplit(orientation orientation,
28382ab3167SAlex Wilson									float spacing = B_USE_DEFAULT_SPACING,
28482ab3167SAlex Wilson									float weight = 1.0f);
2851d6c7b6cSAlex Wilson	inline	SplitBuilder		AddSplit(BSplitView* splitView,
2861d6c7b6cSAlex Wilson									float weight = 1.0f);
2871a726098SIngo Weinhold
28852c07497SMarkus Himmel	inline	CardBuilder			AddCards(float weight = 1.0f);
28952c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardLayout* cardLayout,
29052c07497SMarkus Himmel									float weight = 1.0f);
29152c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardView* cardView,
29252c07497SMarkus Himmel									float weight = 1.0f);
29352c07497SMarkus Himmel
2941a726098SIngo Weinhold	inline	ThisBuilder&		SetCollapsible(bool collapsible);
2951a726098SIngo Weinhold	inline	ThisBuilder&		SetCollapsible(int32 index, bool collapsible);
2961a726098SIngo Weinhold	inline	ThisBuilder&		SetCollapsible(int32 first, int32 last,
2971a726098SIngo Weinhold									bool collapsible);
2981a726098SIngo Weinhold
2994aeb7a3cSStephan Aßmus	inline	ThisBuilder&		SetInsets(float left, float top, float right,
3004aeb7a3cSStephan Aßmus									float bottom);
301813147dfSAlex Wilson	inline	ThisBuilder&		SetInsets(float horizontal, float vertical);
302813147dfSAlex Wilson	inline	ThisBuilder&		SetInsets(float insets);
3034aeb7a3cSStephan Aßmus
3041a726098SIngo Weinhold	inline						operator BSplitView*();
3051a726098SIngo Weinhold
3061a726098SIngo Weinholdprivate:
3071a726098SIngo Weinhold			BSplitView*			fView;
3081a726098SIngo Weinhold};
3091a726098SIngo Weinhold
31052c07497SMarkus Himmeltemplate<typename ParentBuilder>
31152c07497SMarkus Himmelclass Cards : public Base<ParentBuilder> {
31252c07497SMarkus Himmelpublic:
31352c07497SMarkus Himmel	typedef Cards<ParentBuilder>	ThisBuilder;
31452c07497SMarkus Himmel	typedef Group<ThisBuilder>		GroupBuilder;
31552c07497SMarkus Himmel	typedef Grid<ThisBuilder>		GridBuilder;
31652c07497SMarkus Himmel	typedef Split<ThisBuilder>		SplitBuilder;
31752c07497SMarkus Himmel	typedef Cards<ThisBuilder>		CardBuilder;
31852c07497SMarkus Himmel
31952c07497SMarkus Himmelpublic:
32052c07497SMarkus Himmel	inline						Cards();
32152c07497SMarkus Himmel	inline						Cards(BWindow* window);
32252c07497SMarkus Himmel	inline						Cards(BView* view);
32352c07497SMarkus Himmel	inline						Cards(BCardLayout* layout);
32452c07497SMarkus Himmel	inline						Cards(BCardView* view);
32552c07497SMarkus Himmel
32652c07497SMarkus Himmel	inline	BCardLayout*		Layout() const;
32752c07497SMarkus Himmel	inline	BView*				View() const;
32852c07497SMarkus Himmel	inline	ThisBuilder&		GetLayout(BCardLayout** _layout);
32952c07497SMarkus Himmel	inline	ThisBuilder&		GetView(BView** _view);
33052c07497SMarkus Himmel
33152c07497SMarkus Himmel	inline	ThisBuilder&		Add(BView* view);
33252c07497SMarkus Himmel	inline	ThisBuilder&		Add(BLayoutItem* item);
33352c07497SMarkus Himmel
33452c07497SMarkus Himmel	inline	GroupBuilder		AddGroup(orientation orientation,
33552c07497SMarkus Himmel									float spacing = B_USE_DEFAULT_SPACING);
33652c07497SMarkus Himmel	inline	GroupBuilder		AddGroup(BGroupView* groupView);
33752c07497SMarkus Himmel	inline	GroupBuilder		AddGroup(BGroupLayout* groupLayout);
33852c07497SMarkus Himmel
33952c07497SMarkus Himmel	inline	GridBuilder			AddGrid(float horizontal
34052c07497SMarkus Himmel										= B_USE_DEFAULT_SPACING,
34152c07497SMarkus Himmel									float vertical = B_USE_DEFAULT_SPACING);
34252c07497SMarkus Himmel	inline	GridBuilder			AddGrid(BGridLayout* gridLayout);
34352c07497SMarkus Himmel	inline	GridBuilder			AddGrid(BGridView* gridView);
34452c07497SMarkus Himmel
34552c07497SMarkus Himmel	inline	SplitBuilder		AddSplit(orientation orientation,
34652c07497SMarkus Himmel									float spacing = B_USE_DEFAULT_SPACING);
34752c07497SMarkus Himmel	inline	SplitBuilder		AddSplit(BSplitView* splitView);
34852c07497SMarkus Himmel
34952c07497SMarkus Himmel	inline	CardBuilder			AddCards();
35052c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardLayout* cardLayout);
35152c07497SMarkus Himmel	inline	CardBuilder			AddCards(BCardView* cardView);
35252c07497SMarkus Himmel
35352c07497SMarkus Himmel	inline	ThisBuilder&		SetExplicitMinSize(BSize size);
35452c07497SMarkus Himmel	inline	ThisBuilder&		SetExplicitMaxSize(BSize size);
35552c07497SMarkus Himmel	inline	ThisBuilder&		SetExplicitPreferredSize(BSize size);
35652c07497SMarkus Himmel	inline	ThisBuilder&		SetExplicitAlignment(BAlignment alignment);
35752c07497SMarkus Himmel
35852c07497SMarkus Himmel	inline	ThisBuilder&		SetVisibleItem(int32 index);
35952c07497SMarkus Himmel
36052c07497SMarkus Himmel	inline						operator BCardLayout*();
36152c07497SMarkus Himmel
36252c07497SMarkus Himmelprivate:
36352c07497SMarkus Himmel			BCardLayout*		fLayout;
36452c07497SMarkus Himmel};
36552c07497SMarkus Himmel
3661a726098SIngo Weinhold
3676bb10e96SIngo Weinholdtemplate<typename ParentBuilder>
3686bb10e96SIngo Weinholdclass Menu : public Base<ParentBuilder> {
3696bb10e96SIngo Weinholdpublic:
3706bb10e96SIngo Weinhold	typedef Menu<ParentBuilder>		ThisBuilder;
3716bb10e96SIngo Weinhold	typedef MenuItem<ParentBuilder>	ItemBuilder;
3726bb10e96SIngo Weinhold	typedef Menu<ThisBuilder>		MenuBuilder;
3736bb10e96SIngo Weinhold
3746bb10e96SIngo Weinholdpublic:
3756bb10e96SIngo Weinhold	inline						Menu(BMenu* menu);
3766bb10e96SIngo Weinhold
3776bb10e96SIngo Weinhold	inline	ThisBuilder&		GetMenu(BMenu*& _menu);
3786bb10e96SIngo Weinhold
3796bb10e96SIngo Weinhold	inline	ItemBuilder			AddItem(BMenuItem* item);
3806bb10e96SIngo Weinhold	inline	ItemBuilder			AddItem(BMenu* menu);
3816bb10e96SIngo Weinhold	inline	ItemBuilder			AddItem(const char* label, BMessage* message,
3826bb10e96SIngo Weinhold									char shortcut = 0, uint32 modifiers = 0);
3836bb10e96SIngo Weinhold	inline	ItemBuilder			AddItem(const char* label, uint32 messageWhat,
3846bb10e96SIngo Weinhold									char shortcut = 0, uint32 modifiers = 0);
3856bb10e96SIngo Weinhold
3866bb10e96SIngo Weinhold	inline	MenuBuilder			AddMenu(BMenu* menu);
3876bb10e96SIngo Weinhold	inline	MenuBuilder			AddMenu(const char* title,
3886bb10e96SIngo Weinhold									menu_layout layout = B_ITEMS_IN_COLUMN);
3896bb10e96SIngo Weinhold
3906bb10e96SIngo Weinhold	inline	ThisBuilder&		AddSeparator();
3916bb10e96SIngo Weinhold
3926bb10e96SIngo Weinholdprivate:
3936bb10e96SIngo Weinhold			BMenu*				fMenu;
3946bb10e96SIngo Weinhold};
3956bb10e96SIngo Weinhold
3966bb10e96SIngo Weinhold
3976bb10e96SIngo Weinholdtemplate<typename ParentBuilder>
3986bb10e96SIngo Weinholdclass MenuItem : public Menu<ParentBuilder> {
3996bb10e96SIngo Weinholdpublic:
4006bb10e96SIngo Weinhold	typedef MenuItem<ParentBuilder>	ThisBuilder;
4016bb10e96SIngo Weinhold
4026bb10e96SIngo Weinholdpublic:
4036bb10e96SIngo Weinhold	inline						MenuItem(ParentBuilder* parentBuilder,
4046bb10e96SIngo Weinhold									BMenu* menu, BMenuItem* item);
4056bb10e96SIngo Weinhold
4066bb10e96SIngo Weinhold	inline	ThisBuilder&		GetItem(BMenuItem*& _item);
4076bb10e96SIngo Weinhold
4086bb10e96SIngo Weinhold	inline	ThisBuilder&		SetEnabled(bool enabled);
4096bb10e96SIngo Weinhold
4106bb10e96SIngo Weinholdprivate:
4116bb10e96SIngo Weinhold			BMenuItem*			fMenuItem;
4126bb10e96SIngo Weinhold};
4136bb10e96SIngo Weinhold
4146bb10e96SIngo Weinhold
4151a726098SIngo Weinhold// #pragma mark - Base
4161a726098SIngo Weinhold
4171a726098SIngo Weinhold
4181a726098SIngo Weinholdtemplate<typename ParentBuilder>
4191a726098SIngo WeinholdBase<ParentBuilder>::Base()
4201a726098SIngo Weinhold	:
4211a726098SIngo Weinhold	fParent(NULL)
4221a726098SIngo Weinhold{
4231a726098SIngo Weinhold}
4241a726098SIngo Weinhold
4251a726098SIngo Weinhold
4261a726098SIngo Weinholdtemplate<typename ParentBuilder>
4271a726098SIngo Weinholdvoid
4281a726098SIngo WeinholdBase<ParentBuilder>::SetParent(ParentBuilder* parent)
4291a726098SIngo Weinhold{
4301a726098SIngo Weinhold	fParent = parent;
4311a726098SIngo Weinhold}
4321a726098SIngo Weinhold
4331a726098SIngo Weinhold
4341a726098SIngo Weinholdtemplate<typename ParentBuilder>
4351a726098SIngo WeinholdParentBuilder&
4361a726098SIngo WeinholdBase<ParentBuilder>::End()
4371a726098SIngo Weinhold{
4381a726098SIngo Weinhold	return *fParent;
4391a726098SIngo Weinhold}
4401a726098SIngo Weinhold
4411a726098SIngo Weinhold
4421a726098SIngo Weinhold// #pragma mark - Group
4431a726098SIngo Weinhold
4441a726098SIngo Weinhold
4451a726098SIngo Weinholdtemplate<typename ParentBuilder>
446e724b26fSJohn ScipioneGroup<ParentBuilder>::Group(orientation orientation, float spacing)
4471a726098SIngo Weinhold	:
4481a726098SIngo Weinhold	fLayout((new BGroupView(orientation, spacing))->GroupLayout())
4491a726098SIngo Weinhold{
4501a726098SIngo Weinhold}
4511a726098SIngo Weinhold
4521a726098SIngo Weinhold
4532a3974d3SIngo Weinholdtemplate<typename ParentBuilder>
454e724b26fSJohn ScipioneGroup<ParentBuilder>::Group(BWindow* window, orientation orientation,
455e724b26fSJohn Scipione		float spacing)
4562a3974d3SIngo Weinhold	:
457a77ec88aSAxel Dörfler	fLayout(new BGroupLayout(orientation, spacing))
4582a3974d3SIngo Weinhold{
4592a3974d3SIngo Weinhold	window->SetLayout(fLayout);
4607f9368caSlooncraz	fLayout->Owner()->AdoptSystemColors();
4617628cd87SAxel Dörfler}
4627628cd87SAxel Dörfler
4637628cd87SAxel Dörfler
4648ef19442SAlex Wilsontemplate<typename ParentBuilder>
465e724b26fSJohn ScipioneGroup<ParentBuilder>::Group(BView* view, orientation orientation,
466e724b26fSJohn Scipione		float spacing)
4678ef19442SAlex Wilson	:
4688ef19442SAlex Wilson	fLayout(new BGroupLayout(orientation, spacing))
4698ef19442SAlex Wilson{
4707f9368caSlooncraz
4717f9368caSlooncraz	if (view->HasDefaultColors())
4727f9368caSlooncraz		view->AdoptSystemColors();
4737f9368caSlooncraz
4748ef19442SAlex Wilson	view->SetLayout(fLayout);
4758ef19442SAlex Wilson}
4768ef19442SAlex Wilson
4778ef19442SAlex Wilson
4781a726098SIngo Weinholdtemplate<typename ParentBuilder>
4791a726098SIngo WeinholdGroup<ParentBuilder>::Group(BGroupLayout* layout)
4801a726098SIngo Weinhold	:
4811a726098SIngo Weinhold	fLayout(layout)
4821a726098SIngo Weinhold{
4831a726098SIngo Weinhold}
4841a726098SIngo Weinhold
4851a726098SIngo Weinhold
4861a726098SIngo Weinholdtemplate<typename ParentBuilder>
4871a726098SIngo WeinholdGroup<ParentBuilder>::Group(BGroupView* view)
4881a726098SIngo Weinhold	:
4891a726098SIngo Weinhold	fLayout(view->GroupLayout())
4901a726098SIngo Weinhold{
4911a726098SIngo Weinhold}
4921a726098SIngo Weinhold
4931a726098SIngo Weinhold
4941a726098SIngo Weinholdtemplate<typename ParentBuilder>
4951a726098SIngo WeinholdBGroupLayout*
4961a726098SIngo WeinholdGroup<ParentBuilder>::Layout() const
4971a726098SIngo Weinhold{
4981a726098SIngo Weinhold	return fLayout;
4991a726098SIngo Weinhold}
5001a726098SIngo Weinhold
5011a726098SIngo Weinhold
5021a726098SIngo Weinholdtemplate<typename ParentBuilder>
5031a726098SIngo WeinholdBView*
5041a726098SIngo WeinholdGroup<ParentBuilder>::View() const
5051a726098SIngo Weinhold{
5061d6c7b6cSAlex Wilson	return fLayout->Owner();
5071a726098SIngo Weinhold}
5081a726098SIngo Weinhold
5091a726098SIngo Weinhold
5101a726098SIngo Weinholdtemplate<typename ParentBuilder>
5111a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
5121a726098SIngo WeinholdGroup<ParentBuilder>::GetLayout(BGroupLayout** _layout)
5131a726098SIngo Weinhold{
5141a726098SIngo Weinhold	*_layout = fLayout;
5151a726098SIngo Weinhold	return *this;
5161a726098SIngo Weinhold}
5171a726098SIngo Weinhold
5181a726098SIngo Weinhold
5191a726098SIngo Weinholdtemplate<typename ParentBuilder>
5201a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
5211a726098SIngo WeinholdGroup<ParentBuilder>::GetView(BView** _view)
5221a726098SIngo Weinhold{
5231d6c7b6cSAlex Wilson	*_view = fLayout->Owner();
5241a726098SIngo Weinhold	return *this;
5251a726098SIngo Weinhold}
5261a726098SIngo Weinhold
5271a726098SIngo Weinhold
5281a726098SIngo Weinholdtemplate<typename ParentBuilder>
5291a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
5301a726098SIngo WeinholdGroup<ParentBuilder>::Add(BView* view)
5311a726098SIngo Weinhold{
5321a726098SIngo Weinhold	fLayout->AddView(view);
5331a726098SIngo Weinhold	return *this;
5341a726098SIngo Weinhold}
5351a726098SIngo Weinhold
5361a726098SIngo Weinhold
5371a726098SIngo Weinholdtemplate<typename ParentBuilder>
5381a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
5391a726098SIngo WeinholdGroup<ParentBuilder>::Add(BView* view, float weight)
5401a726098SIngo Weinhold{
5411a726098SIngo Weinhold	fLayout->AddView(view, weight);
5421a726098SIngo Weinhold	return *this;
5431a726098SIngo Weinhold}
5441a726098SIngo Weinhold
5451a726098SIngo Weinhold
5461a726098SIngo Weinholdtemplate<typename ParentBuilder>
5471a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
5481a726098SIngo WeinholdGroup<ParentBuilder>::Add(BLayoutItem* item)
5491a726098SIngo Weinhold{
5501a726098SIngo Weinhold	fLayout->AddItem(item);
5511a726098SIngo Weinhold	return *this;
5521a726098SIngo Weinhold}
5531a726098SIngo Weinhold
5541a726098SIngo Weinhold
5551a726098SIngo Weinholdtemplate<typename ParentBuilder>
5561a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
5571a726098SIngo WeinholdGroup<ParentBuilder>::Add(BLayoutItem* item, float weight)
5581a726098SIngo Weinhold{
5591a726098SIngo Weinhold	fLayout->AddItem(item, weight);
5601a726098SIngo Weinhold	return *this;
5611a726098SIngo Weinhold}
5621a726098SIngo Weinhold
5631a726098SIngo Weinhold
5641a726098SIngo Weinholdtemplate<typename ParentBuilder>
5651a726098SIngo Weinholdtypename Group<ParentBuilder>::GroupBuilder
566e724b26fSJohn ScipioneGroup<ParentBuilder>::AddGroup(orientation orientation, float spacing,
567e724b26fSJohn Scipione		float weight)
5681a726098SIngo Weinhold{
5691d6c7b6cSAlex Wilson	GroupBuilder builder(new BGroupLayout(orientation, spacing));
5701a726098SIngo Weinhold	builder.SetParent(this);
5711d6c7b6cSAlex Wilson	fLayout->AddItem(builder.Layout(), weight);
5721d6c7b6cSAlex Wilson	return builder;
5731d6c7b6cSAlex Wilson}
5741d6c7b6cSAlex Wilson
5751d6c7b6cSAlex Wilson
5761d6c7b6cSAlex Wilsontemplate<typename ParentBuilder>
5771d6c7b6cSAlex Wilsontypename Group<ParentBuilder>::GroupBuilder
5781d6c7b6cSAlex WilsonGroup<ParentBuilder>::AddGroup(BGroupView* groupView, float weight)
5791d6c7b6cSAlex Wilson{
5801d6c7b6cSAlex Wilson	GroupBuilder builder(groupView);
5811d6c7b6cSAlex Wilson	builder.SetParent(this);
5821d6c7b6cSAlex Wilson	fLayout->AddItem(builder.Layout(), weight);
5831d6c7b6cSAlex Wilson	return builder;
5841d6c7b6cSAlex Wilson}
5851d6c7b6cSAlex Wilson
5861d6c7b6cSAlex Wilson
5871d6c7b6cSAlex Wilsontemplate<typename ParentBuilder>
5881d6c7b6cSAlex Wilsontypename Group<ParentBuilder>::GroupBuilder
5891d6c7b6cSAlex WilsonGroup<ParentBuilder>::AddGroup(BGroupLayout* groupLayout, float weight)
5901d6c7b6cSAlex Wilson{
5911d6c7b6cSAlex Wilson	GroupBuilder builder(groupLayout);
5921d6c7b6cSAlex Wilson	builder.SetParent(this);
5931d6c7b6cSAlex Wilson	fLayout->AddItem(builder.Layout(), weight);
5941a726098SIngo Weinhold	return builder;
5951a726098SIngo Weinhold}
5961a726098SIngo Weinhold
5971a726098SIngo Weinhold
5981a726098SIngo Weinholdtemplate<typename ParentBuilder>
5991a726098SIngo Weinholdtypename Group<ParentBuilder>::GridBuilder
6001d6c7b6cSAlex WilsonGroup<ParentBuilder>::AddGrid(float horizontalSpacing,
6011d6c7b6cSAlex Wilson	float verticalSpacing, float weight)
6021a726098SIngo Weinhold{
6031d6c7b6cSAlex Wilson	GridBuilder builder(new BGridLayout(horizontalSpacing, verticalSpacing));
6041a726098SIngo Weinhold	builder.SetParent(this);
6051d6c7b6cSAlex Wilson	fLayout->AddItem(builder.Layout(), weight);
6061d6c7b6cSAlex Wilson	return builder;
6071d6c7b6cSAlex Wilson}
6081d6c7b6cSAlex Wilson
6091d6c7b6cSAlex Wilson
6101d6c7b6cSAlex Wilsontemplate<typename ParentBuilder>
6111d6c7b6cSAlex Wilsontypename Group<ParentBuilder>::GridBuilder
6121d6c7b6cSAlex WilsonGroup<ParentBuilder>::AddGrid(BGridLayout* gridLayout, float weight)
6131d6c7b6cSAlex Wilson{
6141d6c7b6cSAlex Wilson	GridBuilder builder(gridLayout);
6151d6c7b6cSAlex Wilson	builder.SetParent(this);
6161d6c7b6cSAlex Wilson	fLayout->AddItem(builder.Layout(), weight);
6171d6c7b6cSAlex Wilson	return builder;
6181d6c7b6cSAlex Wilson}
6191d6c7b6cSAlex Wilson
6201d6c7b6cSAlex Wilson
6211d6c7b6cSAlex Wilsontemplate<typename ParentBuilder>
6221d6c7b6cSAlex Wilsontypename Group<ParentBuilder>::GridBuilder
6231d6c7b6cSAlex WilsonGroup<ParentBuilder>::AddGrid(BGridView* gridView, float weight)
6241d6c7b6cSAlex Wilson{
6251d6c7b6cSAlex Wilson	GridBuilder builder(gridView);
6261d6c7b6cSAlex Wilson	builder.SetParent(this);
6271d6c7b6cSAlex Wilson	fLayout->AddItem(builder.Layout(), weight);
6281a726098SIngo Weinhold	return builder;
6291a726098SIngo Weinhold}
6301a726098SIngo Weinhold
6311a726098SIngo Weinhold
6321a726098SIngo Weinholdtemplate<typename ParentBuilder>
6331a726098SIngo Weinholdtypename Group<ParentBuilder>::SplitBuilder
634e724b26fSJohn ScipioneGroup<ParentBuilder>::AddSplit(orientation orientation, float spacing,
635e724b26fSJohn Scipione		float weight)
6361a726098SIngo Weinhold{
6371a726098SIngo Weinhold	SplitBuilder builder(orientation, spacing);
6381a726098SIngo Weinhold	builder.SetParent(this);
6391a726098SIngo Weinhold	fLayout->AddView(builder.View(), weight);
6401a726098SIngo Weinhold	return builder;
6411a726098SIngo Weinhold}
6421a726098SIngo Weinhold
6431a726098SIngo Weinhold
6441d6c7b6cSAlex Wilsontemplate<typename ParentBuilder>
6451d6c7b6cSAlex Wilsontypename Group<ParentBuilder>::SplitBuilder
6461d6c7b6cSAlex WilsonGroup<ParentBuilder>::AddSplit(BSplitView* splitView, float weight)
6471d6c7b6cSAlex Wilson{
6481d6c7b6cSAlex Wilson	SplitBuilder builder(splitView);
6491d6c7b6cSAlex Wilson	builder.SetParent(this);
6501d6c7b6cSAlex Wilson	fLayout->AddView(builder.View(), weight);
6511d6c7b6cSAlex Wilson	return builder;
6521d6c7b6cSAlex Wilson}
6531d6c7b6cSAlex Wilson
6541d6c7b6cSAlex Wilson
65552c07497SMarkus Himmeltemplate<typename ParentBuilder>
65652c07497SMarkus Himmeltypename Group<ParentBuilder>::CardBuilder
65752c07497SMarkus HimmelGroup<ParentBuilder>::AddCards(float weight)
65852c07497SMarkus Himmel{
65952c07497SMarkus Himmel	CardBuilder builder;
66052c07497SMarkus Himmel	builder.SetParent(this);
66152c07497SMarkus Himmel	fLayout->AddView(builder.View(), weight);
66252c07497SMarkus Himmel	return builder;
66352c07497SMarkus Himmel}
66452c07497SMarkus Himmel
66552c07497SMarkus Himmel
66652c07497SMarkus Himmeltemplate<typename ParentBuilder>
66752c07497SMarkus Himmeltypename Group<ParentBuilder>::CardBuilder
66852c07497SMarkus HimmelGroup<ParentBuilder>::AddCards(BCardLayout* cardLayout, float weight)
66952c07497SMarkus Himmel{
67052c07497SMarkus Himmel	CardBuilder builder(cardLayout);
67152c07497SMarkus Himmel	builder.SetParent(this);
67252c07497SMarkus Himmel	fLayout->AddView(builder.View(), weight);
67352c07497SMarkus Himmel	return builder;
67452c07497SMarkus Himmel}
67552c07497SMarkus Himmel
67652c07497SMarkus Himmel
67752c07497SMarkus Himmeltemplate<typename ParentBuilder>
67852c07497SMarkus Himmeltypename Group<ParentBuilder>::CardBuilder
67952c07497SMarkus HimmelGroup<ParentBuilder>::AddCards(BCardView* cardView, float weight)
68052c07497SMarkus Himmel{
68152c07497SMarkus Himmel	CardBuilder builder(cardView);
68252c07497SMarkus Himmel	builder.SetParent(this);
68352c07497SMarkus Himmel	fLayout->AddView(builder.View(), weight);
68452c07497SMarkus Himmel	return builder;
68552c07497SMarkus Himmel}
68652c07497SMarkus Himmel
68752c07497SMarkus Himmel
6881a726098SIngo Weinholdtemplate<typename ParentBuilder>
6891a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
6901a726098SIngo WeinholdGroup<ParentBuilder>::AddGlue(float weight)
6911a726098SIngo Weinhold{
6921a726098SIngo Weinhold	fLayout->AddItem(BSpaceLayoutItem::CreateGlue(), weight);
6931a726098SIngo Weinhold	return *this;
6941a726098SIngo Weinhold}
6951a726098SIngo Weinhold
6961a726098SIngo Weinhold
6971a726098SIngo Weinholdtemplate<typename ParentBuilder>
6981a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
6991a726098SIngo WeinholdGroup<ParentBuilder>::AddStrut(float size)
7001a726098SIngo Weinhold{
7011a726098SIngo Weinhold	if (fLayout->Orientation() == B_HORIZONTAL)
7021a726098SIngo Weinhold		fLayout->AddItem(BSpaceLayoutItem::CreateHorizontalStrut(size));
7031a726098SIngo Weinhold	else
7041a726098SIngo Weinhold		fLayout->AddItem(BSpaceLayoutItem::CreateVerticalStrut(size));
7051a726098SIngo Weinhold
7061a726098SIngo Weinhold	return *this;
7071a726098SIngo Weinhold}
7081a726098SIngo Weinhold
7091a726098SIngo Weinhold
7101a726098SIngo Weinholdtemplate<typename ParentBuilder>
7111a726098SIngo Weinholdtypename Group<ParentBuilder>::ThisBuilder&
7121a726098SIngo WeinholdGroup<ParentBuilder>::SetInsets(float left, float top, float right,
7131a726098SIngo Weinhold	float bottom)
7141a726098SIngo Weinhold{
7151a726098SIngo Weinhold	fLayout->SetInsets(left, top, right, bottom);
7161a726098SIngo Weinhold	return *this;
7171a726098SIngo Weinhold}
7181a726098SIngo Weinhold
7191a726098SIngo Weinhold
720813147dfSAlex Wilsontemplate<typename ParentBuilder>
721813147dfSAlex Wilsontypename Group<ParentBuilder>::ThisBuilder&
722813147dfSAlex WilsonGroup<ParentBuilder>::SetInsets(float horizontal, float vertical)
723813147dfSAlex Wilson{
724813147dfSAlex Wilson	fLayout->SetInsets(horizontal, vertical);
725813147df