xref: /haiku/docs/user/interface/LayoutBuilder.Group.dox (revision 89d652d5e0defd9d095c778709cef82f5f10c357)
1/*!
2	\class BLayoutBuilder::Group<>
3	\ingroup interface
4	\ingroup layout
5	\brief BLayoutBuilder::Base subclass for building BGroupLayouts.
6*/
7
8
9/*!
10	\typedef BLayoutBuilder::Group<ParentBuilder>::GroupBuilder
11	\brief Shorthand for builders returned by this builder's AddGroup() methods.
12*/
13
14
15/*!
16	\typedef BLayoutBuilder::Group<ParentBuilder>::GridBuilder
17	\brief Shorthand for builders returned by this builder's AddGrid() methods.
18*/
19
20
21/*!
22	\typedef BLayoutBuilder::Group<ParentBuilder>::SplitBuilder
23	\brief Shorthand for builders returned by this builder's AddSplit() methods.
24*/
25
26
27/*!
28	\typedef BLayoutBuilder::Group<ParentBuilder>::ThisBuilder
29	\brief Shorthand representing the type of \c this.
30*/
31
32
33/*!
34	\name Constructors
35
36	@{
37*/
38
39
40/*!
41	\fn BLayoutBuilder::Group<ParentBuilder>::Group(BWindow* window,
42		enum orientation, float spacing)
43	\brief Creates a new BGroupLayout, and attaches it to a BWindow.
44
45	\note The top BView* in \a window has its ViewColor set to
46		B_PANEL_BACKGROUND_COLOR.
47	\param window Thew BWindow* to attach the newly created BGroupLayout to.
48	\param orientation The orientation for the new BGroupLayout.
49	\param spacing The spacing for the new BGroupLayout.
50*/
51
52
53/*!
54	\fn BLayoutBuilder::Group<ParentBuilder>::Group(BGroupLayout* layout)
55	\brief Creates a builder targeting a BGroupLayout.
56
57	Methods called on this builder will be directed to \a layout.
58	\param layout The BGroupLayout to target with this builder.
59*/
60
61
62/*!
63	\fn BLayoutBuilder::Group<ParentBuilder>::Group(BGroupView* view)
64	\brief Creates a builder targeting a BGroupView.
65
66	Methods called on this builder will be directed to
67	\c view->GroupLayout().
68
69	\param view The BGroupView this builder will target.
70*/
71
72
73/*!
74	\fn template <ParentBuilder> BLayoutBuilder::Group<ParentBuilder>::Group(
75		enum orientation, float spacing)
76	\brief Creates a new BGroupView and targets it.
77
78	Methods called on this builder will be directed to the new BGroupView's
79	BGroupLayout.
80
81	\param orientation The orientation for the new BGroupView.
82	\param spacing The spacing for the new BGroupView.
83*/
84
85
86//@}
87
88
89/*!
90	\name Adding BViews and BLayoutItems
91
92	@{
93*/
94
95/*!
96	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::Add(BView* view)
97	\brief Add a BView to the BGroupLayout this builder represents.
98
99	\param view The BView to be added.
100	\see BGroupLayout::AddView(BView*)
101*/
102
103
104/*!
105	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::Add(BView* view,
106		float weight)
107	\brief Add BView to the BGroupLayout this builder represents.
108
109	\param view The BView to be added.
110	\param weight The weight to give \a view.
111	\see BGroupLayout::AddView(BView* view, float weight)
112*/
113
114
115/*!
116	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::Add(
117		BLayoutItem* item)
118	\brief Add a BLayoutItem to the BGroupLayout this builder represents.
119
120	\param item The BLayoutItem to be added.
121	\see BGroupLayout::AddItem(BLayoutItem*)
122*/
123
124
125/*!
126	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::Add(BLayoutItem*
127		item, float weight)
128	\brief Add a BLayoutItem the BGroupLayout this builder represents.
129
130	\param item The BLayoutItem to be added.
131	\param weight The weight to give \a item.
132	\see BGroupLayout::AddItem(BLayoutItem* item, float weight)
133*/
134
135
136//@}
137
138
139/*!
140	\name Adding BLayouts and their BView pairs
141	\brief A set of methods that add a BLayout or BView subclass and return a
142	BLayoutBuilder::Base subclass representing the newly added object. These
143	methods push a new builder on top of the stack, you will not be using
144	\c this builder again until you call End().
145
146	@{
147*/
148
149
150/*!
151	\fn GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup(
152		enum orientation, float spacing, float weight)
153	\brief Construct and add a viewless BGroupLayout, then return a GroupBuilder
154		representing the newly added layout.
155
156	\param orientation The orientation to use for the new BGroupLayout.
157	\param spacing The spacing to use for the new BGroupLayout.
158	\param weight The weight for the new BGroupLayout in the BGroupLayout this
159		builder represents.
160	\returns A GroupBuilder representing the newly created BGroupLayout.
161*/
162
163
164/*!
165	\fn GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup(BGroupView*
166		groupView, float weight)
167	\brief Add BGroupView and return a builder representing the newly added
168		BGroupView.
169
170	\param groupView The BGroupView to be added.
171	\param weight The weight for \a groupView in the BGroupLayout this builder
172		represents.
173	\returns A GroupBuilder representing \a groupView.
174*/
175
176
177/*!
178	\fn GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup(
179		BGroupLayout* groupLayout, float weight)
180	\brief Add a BGroupLayout and return a builder representing
181		the newly added BGroupLayout.
182
183	\param groupLayout The BGroupLayout to be added.
184	\param weight The weight for \a groupLayout in the BGroupLayout this builder
185		represents.
186	\returns A GroupBuilder representing \a groupLayout.
187*/
188
189
190/*!
191	\fn GridBuilder	BLayoutBuilder::Group<ParentBuilder>::AddGrid(
192		float horizontalSpacing = 0.0f, float verticalSpacing = 0.0f,
193		float weight = 1.0f)
194	\brief Create and add a viewless BGridLayout, then return a builder
195		representing the newly created BGridLayout.
196
197	\param horizontalSpacing The horizontal spacing for the new BGridLayout.
198	\param verticalSpacing The vertical spacing for the new BGridLayout.
199	\param weight The weight for the new BGroupLayout in the BGroupLayout this
200		builder represents.
201	\returns A GridBuilder representing the newly created BGridLayout.
202*/
203
204
205/*!
206	\fn GridBuilder BLayoutBuilder::Group<ParentBuilder>::AddGrid(
207		BGridLayout* gridLayout, float weight = 1.0f)
208	\brief Add a BGridLayout, then return a builder the newly added
209		BGridLayout.
210
211	\param gridLayout The BGridLayout to be added and used to construct the
212		returned GridBuilder.
213	\param weight The weight for \a groupLayout in the BGroupLayout this builder
214		represents.
215	\returns a GridBuilder representing \a gridLayout.
216*/
217
218
219/*!
220	\fn GridBuilder	BLayoutBuilder::Group<ParentBuilder>::AddGrid(
221		BGridView* gridView, float weight = 1.0f)
222	\brief Add a BGridView, then return a builder the newly added
223		BGridView.
224
225	\param gridView The BGridView to be added and used to construct the
226		returned GridBuilder.
227	\param weight The weight for \a groupLayout in the BGroupLayout this builder
228		represents.
229
230	\returns a GridBuilder representing \a gridView.
231*/
232
233
234/*!
235	\fn SplitBuilder BLayoutBuilder::Group<ParentBuilder>::AddSplit(
236		enum orientation, float spacing, float weight)
237
238	\brief Create and add a new BSplitView with a weight of \c weight, then
239		return a SplitBuilder representing the new BSplitView.
240
241	\param orientation The orientation of the new BSplitView.
242	\param spacing The spacing of the new BSplitView.
243	\param weight The weight, in this BGroupLayout for the new BSplitView.
244
245	\returns a SplitBuilder representing the new BSplitView.
246*/
247
248
249/*!
250	\fn SplitBuilder BLayoutBuilder::Group<ParentBuilder>::AddSplit(
251		BSplitView* splitView, float weight = 1.0f)
252	\brief Add a BSplitView to the BGroupLayout this builder represents and
253		return a SplitBuilder representing the BSplitView.
254
255	\param splitView The BSplitView to be added.
256	\param weight The weight of the BSplitView in the BGroupLayout this builder
257		represents.
258*/
259
260
261//@}
262
263
264/*!
265	\name Adding BSpaceLayoutItems
266	Some convenience methods for adding special BSpaceLayoutItems.
267
268	@{
269*/
270
271
272/*!
273	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::AddGlue(
274		float weight = 1.0f)
275	\brief Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateGlue()
276		to the BGroupLayout this builder represents.
277
278	\param weight The weight of the BSpaceLayoutItem in the BGroupLayout this
279		builder represents
280*/
281
282
283/*!
284	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::AddStrut(float size)
285	\brief Add a BSpaceLayoutItem created by
286		BSpaceLayoutItem::CreateHorizontalStrut() or
287		BSpaceLayoutItem::CreateVerticalStrut()	to the BGroupLayout this builder
288		 represents.
289
290	\param size The width or height of the strut to be created (depending on
291		the orientation of the BGroupLayout this builder represents).
292*/
293
294
295//!@}
296
297
298/*!
299	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::SetInsets(float left,
300		 float top, float right, float bottom)
301	\brief Call the BTwoDimensionalLayout::SetInsets() method on the
302		BGroupLayout this builder represents.
303*/
304
305
306/*!
307	\name Accessors
308
309	@{
310*/
311
312
313/*!
314	\fn BGroupLayout* BLayoutBuilder::Group<ParentBuilder>::Layout() const
315	\brief Get the BGroupLayout this builder represents.
316*/
317
318
319/*!
320	\fn	BView* BLayoutBuilder::Group<ParentBuilder>::View() const
321	\brief Get the BView this builder's BGroupLayout is attached to.
322*/
323
324
325/*!
326	\fn ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::GetLayout(
327		BGroupLayout** _layout)
328	\brief Get the BGroupLayout this builder represents.
329	\param[out] _layout The BGroupLayout this builder represents.
330*/
331
332
333/*!
334	\fn	ThisBuilder& BLayoutBuilder::Group<ParentBuilder>::GetView(
335	BView** _view)
336	\brief Get the BView this builder's BGroupLayout is attached to.
337	\param[out] _view The BView this builder's BGroupLayout is attached to.
338*/
339
340
341/*!
342	\fn BLayoutBuilder::Group<ParentBuilder>::operator BGroupLayout*()
343	\brief Cast this builder into the BGroupLayout it represents.
344*/
345
346//!@}
347