2 * Copyright 2010 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Alex Wilson, yourpalal2@gmail.com
9 * headers/os/interface/GridLayout.h rev 38207
10 * src/kits/interface/GridLayout.cpp rev 38207
18 \brief Provides the BGridLayout class.
26 \brief The BGridLayout class a BLayout subclass that arranges the items it
29 Each item in a BGridLayout receives a rectangular area which can span more
30 than a single row or column. The indexing of columns and rows is zero based,
31 starting in the top-left.
33 \warning This class is not yet finalized, if you use it in your software
34 assume that it will break some time in the future.
41 \fn BGridLayout::BGridLayout(float horizontal = 0.0f, float vertical = 0.0f)
42 \brief Create a BGridLayout with \a horizontal space between columns and
43 \a vertical space between rows.
50 \fn BGridLayout::BGridLayout(BMessage* from)
51 \brief Archive constructor.
53 \param from The message to build the BGridLayout from.
60 \fn BGridLayout::~BGridLayout()
61 \brief Destructor method.
70 \fn int32 BGridLayout::CountColumns() const
71 \brief Returns the number of active columns in this layout.
73 \returns The number of active columns in the layout.
80 \fn int32 BGridLayout::CountRows() const
81 \brief Returns the number of active rows in this layout.
83 \returns the number of active rows in the layout.
90 \fn float BGridLayout::HorizontalSpacing() const
91 \brief Returns the spacing between columns for this layout.
93 \returns The spacing between columns for the layout.
100 \fn float BGridLayout::VerticalSpacing() const
101 \brief Returns the spacing between rows for this layout.
103 \returns The spacing between rows for the layout.
110 \fn void BGridLayout::SetHorizontalSpacing(float spacing);
111 \brief Set the spacing between columns for this layout.
113 \param spacing The number of pixels of spacing to set.
120 \fn void BGridLayout::SetVerticalSpacing(float spacing)
121 \brief Set the spacing between rows for this layout.
123 \param spacing The number of pixels of spacing to set.
130 \fn void BGridLayout::SetSpacing(float horizontal, float vertical)
131 \brief Set the spacing between columns and rows for this layout.
133 \param horizontal The number of \a horizontal pixels of spacing to set.
134 \param vertical The number of \a vertical pixels of spacing to set.
141 \fn float BGridLayout::ColumnWeight(int32 column) const
142 \brief Returns the weight for the specified \a column.
144 \returns The \a column weight as a float.
151 \fn void BGridLayout::SetColumnWeight(int32 column, float weight)
152 \brief Set the weight for \a column to \a weight.
154 \param column The column to set.
155 \param weight The weight to set.
162 \fn float BGridLayout::MinColumnWidth(int32 column) const
163 \brief Returns the minimum width for \a column.
165 \param column The column to get the minimum width of.
167 \returns The minimum width for \a column as a float.
174 \fn void BGridLayout::SetMinColumnWidth(int32 column, float width)
175 \brief Sets the minimum width for \a column to \a width.
177 \param column The \a column to set the minimum width of.
178 \param width The \a width to set.
185 \fn float BGridLayout::MaxColumnWidth(int32 column) const
186 \brief Returns the maximum width for \a column.
188 \param column The column to get the maximum width of.
190 \returns The maximum width for \a column as a float.
197 \fn void BGridLayout::SetMaxColumnWidth(int32 column, float width)
198 \brief Sets the maximum width for \a column to \a width.
200 \param column The column to set the maximum width of.
201 \param width The \a width to set.
208 \fn float BGridLayout::RowWeight(int32 row) const
209 \brief Returns the weight of the specified \a row.
211 \returns The weight of the \a row.
218 \fn void BGridLayout::SetRowWeight(int32 row, float weight)
219 \brief Set the weight of \a row to \a weight.
221 \param row The \a row number.
222 \param weight The \a weight to set.
229 \fn float BGridLayout::MinRowHeight(int row) const
230 \brief Returns the minimum height for \a row.
237 \fn void BGridLayout::SetMinRowHeight(int32 row, float height)
238 \brief Sets the minimum height for \a row to \a width.
245 \fn float BGridLayout::MaxRowHeight(int32 row) const
246 \brief Returns the maximum height for \a row.
253 \fn void BGridLayout::SetMaxRowHeight(int32 row, float height)
254 \brief Sets the maximum height for \a row to \a width.
261 \fn BLayoutItem* BGridLayout::AddView(BView* child)
262 \brief Adds \a child to this layout in the first empty cell available, or
263 in a new column in the first row if there are no emtpy cells.
270 \fn BLayoutItem* BGridLayout::AddView(int32 index, BView* child);
271 \brief BGridLayout::AddView(BView*)
278 \fn BLayoutItem* BGridLayout::AddView(BView* child, int32 column, int32 row,
279 int32 columnCount = 1, int32 rowCount = 1);
280 \brief Adds \a child to this layout at \a column and \a row. \a child may
281 also occupy additional cells if \a columnCount or \a rowCount are
284 Fails and returns NULL if the requested area is occupied, or if internal
285 memory allocations fail.
292 \fn BLayoutItem* BGridLayout::AddItem(BLayoutItem* item)
293 \brief Adds \a item to this layout in the first empty cell available, or
294 in a new column in the first row if there are no emtpy cells.
301 \fn BLayoutItem* BGridLayout::AddItem(int32 index, BLayoutItem* item);
302 \brief BGridLayout::AddItem(BLayoutItem*)
307 \fn BLayoutItem* BGridLayout::AddItem(BLayoutItem* item, int32 column,
308 int32 row, int32 columnCount = 1, int32 rowCount = 1);
309 \brief Adds \a item to this layout at \a column and \a row. \a item may
310 also occupy additional cells if \a columnCount or \a rowCount are
313 Fails and returns \c NULL if the requested area is occupied, or if internal
314 memory allocations fail.