xref: /haiku/docs/user/interface/GridLayout.dox (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1/*
2 * Copyright 2010 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Alex Wilson, yourpalal2@gmail.com
7 *
8 * Corresponds to:
9 *		headers/os/interface/GridLayout.h	rev 38207
10 *		src/kits/interface/GridLayout.cpp	rev 38207
11 */
12
13
14/*!
15	\file GridLayout.h
16	\ingroup interface
17	\ingroup layout
18	\ingroup libbe
19	\brief Provides the BGridLayout class.
20*/
21
22
23/*!
24	\class BGridLayout
25	\ingroup interface
26	\ingroup layout
27	\ingroup libbe
28	\brief The BGridLayout class a BLayout subclass that arranges the items it
29		holds in a grid.
30
31	Each item in a BGridLayout receives a rectangular area which can span more
32	than a single row or column. The indexing of columns and rows is zero based,
33	starting in the top-left.
34
35	\warning This class is not yet finalized, if you use it in your software
36	         assume that it will break some time in the future.
37
38	\since Haiku R1
39*/
40
41
42/*!
43	\fn BGridLayout::BGridLayout(float horizontal = 0.0f, float vertical = 0.0f)
44	\brief Create a BGridLayout with \a horizontal space between columns and
45	       \a vertical space between rows.
46
47	\since Haiku R1
48*/
49
50
51/*!
52	\fn BGridLayout::BGridLayout(BMessage* from)
53	\brief Archive constructor.
54
55	\param from The message to build the BGridLayout from.
56
57	\since Haiku R1
58*/
59
60
61/*!
62	\fn BGridLayout::~BGridLayout()
63	\brief Destructor method.
64
65	Standard Destructor.
66
67	\since Haiku R1
68*/
69
70
71/*!
72	\fn int32 BGridLayout::CountColumns() const
73	\brief Returns the number of active columns in this layout.
74
75	\returns The number of active columns in the layout.
76
77	\since Haiku R1
78*/
79
80
81/*!
82	\fn int32 BGridLayout::CountRows() const
83	\brief Returns the number of active rows in this layout.
84
85	\returns the number of active rows in the layout.
86
87	\since Haiku R1
88*/
89
90
91/*!
92	\fn float BGridLayout::HorizontalSpacing() const
93	\brief Returns the spacing between columns for this layout.
94
95	\returns The spacing between columns for the layout.
96
97	\since Haiku R1
98*/
99
100
101/*!
102	\fn float BGridLayout::VerticalSpacing() const
103	\brief Returns the spacing between rows for this layout.
104
105	\returns The spacing between rows for the layout.
106
107	\since Haiku R1
108*/
109
110
111/*!
112	\fn void BGridLayout::SetHorizontalSpacing(float spacing);
113	\brief Set the spacing between columns for this layout.
114
115	\param spacing The number of pixels of spacing to set.
116
117	\since Haiku R1
118*/
119
120
121/*!
122	\fn void BGridLayout::SetVerticalSpacing(float spacing)
123	\brief Set the spacing between rows for this layout.
124
125	\param spacing The number of pixels of spacing to set.
126
127	\since Haiku R1
128*/
129
130
131/*!
132	\fn	void BGridLayout::SetSpacing(float horizontal, float vertical)
133	\brief Set the spacing between columns and rows for this layout.
134
135	\param horizontal The number of \a horizontal pixels of spacing to set.
136	\param vertical The number of \a vertical pixels of spacing to set.
137
138	\since Haiku R1
139*/
140
141
142/*!
143	\fn float BGridLayout::ColumnWeight(int32 column) const
144	\brief Returns the weight for the specified \a column.
145
146	\returns The \a column weight as a float.
147
148	\since Haiku R1
149*/
150
151
152/*!
153	\fn void BGridLayout::SetColumnWeight(int32 column, float weight)
154	\brief Set the weight for \a column to \a weight.
155
156	\param column The column to set.
157	\param weight The weight to set.
158
159	\since Haiku R1
160*/
161
162
163/*!
164	\fn float BGridLayout::MinColumnWidth(int32 column) const
165	\brief Returns the minimum width for \a column.
166
167	\param column The column to get the minimum width of.
168
169	\returns The minimum width for \a column as a float.
170
171	\since Haiku R1
172*/
173
174
175/*!
176	\fn void BGridLayout::SetMinColumnWidth(int32 column, float width)
177	\brief Sets the minimum width for \a column to \a width.
178
179	\param column The \a column to set the minimum width of.
180	\param width The \a width to set.
181
182	\since Haiku R1
183*/
184
185
186/*!
187	\fn float BGridLayout::MaxColumnWidth(int32 column) const
188	\brief Returns the maximum width for \a column.
189
190	\param column The column to get the maximum width of.
191
192	\returns The maximum width for \a column as a float.
193
194	\since Haiku R1
195*/
196
197
198/*!
199	\fn void BGridLayout::SetMaxColumnWidth(int32 column, float width)
200	\brief Sets the maximum width for \a column to \a width.
201
202	\param column The column to set the maximum width of.
203	\param width The \a width to set.
204
205	\since Haiku R1
206*/
207
208
209/*!
210	\fn float BGridLayout::RowWeight(int32 row) const
211	\brief Returns the weight of the specified \a row.
212
213	\returns The weight of the \a row.
214
215	\since Haiku R1
216*/
217
218
219/*!
220	\fn void BGridLayout::SetRowWeight(int32 row, float weight)
221	\brief Set the weight of \a row to \a weight.
222
223	\param row The \a row number.
224	\param weight The \a weight to set.
225
226	\since Haiku R1
227*/
228
229
230/*!
231	\fn float BGridLayout::MinRowHeight(int row) const
232	\brief Returns the minimum height for \a row.
233
234	\since Haiku R1
235*/
236
237
238/*!
239	\fn void BGridLayout::SetMinRowHeight(int32 row, float height)
240	\brief Sets the minimum height for \a row to \a width.
241
242	\since Haiku R1
243*/
244
245
246/*!
247	\fn float BGridLayout::MaxRowHeight(int32 row) const
248	\brief Returns the maximum height for \a row.
249
250	\since Haiku R1
251*/
252
253
254/*!
255	\fn void BGridLayout::SetMaxRowHeight(int32 row, float height)
256	\brief Sets the maximum height for \a row to \a width.
257
258	\since Haiku R1
259*/
260
261
262/*!
263	\fn BLayoutItem* BGridLayout::AddView(BView* child)
264	\brief Adds \a child to this layout in the first empty cell available, or
265		in a new column in the first row if there are no emtpy cells.
266
267	\since Haiku R1
268*/
269
270
271/*!
272	\fn BLayoutItem* BGridLayout::AddView(int32 index, BView* child);
273	\brief BGridLayout::AddView(BView*)
274
275	\since Haiku R1
276*/
277
278
279/*!
280	\fn BLayoutItem* BGridLayout::AddView(BView* child, int32 column, int32 row,
281			int32 columnCount = 1, int32 rowCount = 1);
282	\brief Adds \a child to this layout at \a column and \a row. \a child may
283	       also occupy additional cells if \a columnCount or \a rowCount are
284	       greater than \c 1.
285
286	Fails and returns NULL if the requested area is occupied, or if internal
287	memory allocations fail.
288
289	\since Haiku R1
290*/
291
292
293/*!
294	\fn BLayoutItem* BGridLayout::AddItem(BLayoutItem* item)
295	\brief Adds \a item to this layout in the first empty cell available, or
296	       in a new column in the first row if there are no emtpy cells.
297
298	\since Haiku R1
299*/
300
301
302/*!
303	\fn BLayoutItem* BGridLayout::AddItem(int32 index, BLayoutItem* item);
304	\brief BGridLayout::AddItem(BLayoutItem*)
305*/
306
307
308/*!
309	\fn BLayoutItem* BGridLayout::AddItem(BLayoutItem* item, int32 column,
310		int32 row, int32 columnCount = 1, int32 rowCount = 1);
311	\brief Adds \a item to this layout at \a column and \a row. \a item may
312	       also occupy additional cells if \a columnCount or \a rowCount are
313	       greater than 1.
314
315	Fails and returns \c NULL if the requested area is occupied, or if internal
316	memory allocations fail.
317
318	\since Haiku R1
319*/
320