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