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 39 40/*! 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. 44*/ 45 46 47/*! 48 \fn BGridLayout::BGridLayout(BMessage* from) 49 \brief Archive constructor. 50 51 \param from The message to build the BGridLayout from. 52*/ 53 54 55/*! 56 \fn BGridLayout::~BGridLayout() 57 \brief Destructor method. 58 59 Standard Destructor. 60*/ 61 62 63/*! 64 \fn int32 BGridLayout::CountColumns() const 65 \brief Returns the number of active columns in this layout. 66 67 \returns The number of active columns in the layout. 68*/ 69 70 71/*! 72 \fn int32 BGridLayout::CountRows() const 73 \brief Returns the number of active rows in this layout. 74 75 \returns the number of active rows in the layout. 76*/ 77 78 79/*! 80 \fn float BGridLayout::HorizontalSpacing() const 81 \brief Returns the spacing between columns for this layout. 82 83 \returns The spacing between columns for the layout. 84*/ 85 86 87/*! 88 \fn float BGridLayout::VerticalSpacing() const 89 \brief Returns the spacing between rows for this layout. 90 91 \returns The spacing between rows for the layout. 92*/ 93 94 95/*! 96 \fn void BGridLayout::SetHorizontalSpacing(float spacing); 97 \brief Set the spacing between columns for this layout. 98 99 \param spacing The number of pixels of spacing to set. 100*/ 101 102 103/*! 104 \fn void BGridLayout::SetVerticalSpacing(float spacing) 105 \brief Set the spacing between rows for this layout. 106 107 \param spacing The number of pixels of spacing to set. 108*/ 109 110 111/*! 112 \fn void BGridLayout::SetSpacing(float horizontal, float vertical) 113 \brief Set the spacing between columns and rows for this layout. 114 115 \param horizontal The number of \a horizontal pixels of spacing to set. 116 \param vertical The number of \a vertical pixels of spacing to set. 117*/ 118 119 120/*! 121 \fn float BGridLayout::ColumnWeight(int32 column) const 122 \brief Returns the weight for the specified \a column. 123 124 \returns The \a column weight as a float. 125*/ 126 127 128/*! 129 \fn void BGridLayout::SetColumnWeight(int32 column, float weight) 130 \brief Set the weight for \a column to \a weight. 131 132 \param column The column to set. 133 \param weight The weight to set. 134*/ 135 136 137/*! 138 \fn float BGridLayout::MinColumnWidth(int32 column) const 139 \brief Returns the minimum width for \a column. 140 141 \param column The column to get the minimum width of. 142 143 \returns The minimum width for \a column as a float. 144*/ 145 146 147/*! 148 \fn void BGridLayout::SetMinColumnWidth(int32 column, float width) 149 \brief Sets the minimum width for \a column to \a width. 150 151 \param column The \a column to set the minimum width of. 152 \param width The \a width to set. 153*/ 154 155 156/*! 157 \fn float BGridLayout::MaxColumnWidth(int32 column) const 158 \brief Returns the maximum width for \a column. 159 160 \param column The column to get the maximum width of. 161 162 \returns The maximum width for \a column as a float. 163*/ 164 165 166/*! 167 \fn void BGridLayout::SetMaxColumnWidth(int32 column, float width) 168 \brief Sets the maximum width for \a column to \a width. 169 170 \param column The column to set the maximum width of. 171 \param width The \a width to set. 172*/ 173 174 175/*! 176 \fn float BGridLayout::RowWeight(int32 row) const 177 \brief Returns the weight of the specified \a row. 178 179 \returns The weight of the \a row. 180*/ 181 182 183/*! 184 \fn void BGridLayout::SetRowWeight(int32 row, float weight) 185 \brief Set the weight for \a row to \a weight. 186 187 \param row The \a row number. 188 \param weight The \a 189*/ 190 191 192/*! 193 \fn float BGridLayout::MinRowHeight(int row) const 194 \brief Returns the minimum height for \a row. 195*/ 196 197 198/*! 199 \fn void BGridLayout::SetMinRowHeight(int32 row, float height) 200 \brief Sets the minimum height for \a row to \a width. 201*/ 202 203 204/*! 205 \fn float BGridLayout::MaxRowHeight(int32 row) const 206 \brief Returns the maximum height for \a row. 207*/ 208 209 210/*! 211 \fn void BGridLayout::SetMaxRowHeight(int32 row, float height) 212 \brief Sets the maximum height for \a row to \a width. 213*/ 214 215 216/*! 217 \fn BLayoutItem* BGridLayout::AddView(BView* child) 218 \brief Adds \a child to this layout in the first empty cell available, or 219 in a new column in the first row if there are no emtpy cells. 220*/ 221 222 223/*! 224 \fn BLayoutItem* BGridLayout::AddView(int32 index, BView* child); 225 \brief BGridLayout::AddView(BView*) 226*/ 227 228 229/*! 230 \fn BLayoutItem* BGridLayout::AddView(BView* child, int32 column, int32 row, 231 int32 columnCount = 1, int32 rowCount = 1); 232 \brief Adds \a child to this layout at \a column and \a row. \a child may 233 also occupy additional cells if \a columnCount or \a rowCount are 234 greater than \c 1. 235 236 Fails and returns NULL if the requested area is occupied, or if internal 237 memory allocations fail. 238*/ 239 240 241/*! 242 \fn BLayoutItem* BGridLayout::AddItem(BLayoutItem* item) 243 \brief Adds \a item to this layout in the first empty cell available, or 244 in a new column in the first row if there are no emtpy cells. 245*/ 246 247 248/*! 249 \fn BLayoutItem* BGridLayout::AddItem(int32 index, BLayoutItem* item); 250 \brief BGridLayout::AddItem(BLayoutItem*) 251*/ 252 253 254/*! 255 \fn BLayoutItem* BGridLayout::AddItem(BLayoutItem* item, int32 column, 256 int32 row, int32 columnCount = 1, int32 rowCount = 1); 257 \brief Adds \a item to this layout at \a column and \a row. \a item may 258 also occupy additional cells if \a columnCount or \a rowCount are 259 greater than 1. 260 261 Fails and returns \c NULL if the requested area is occupied, or if internal 262 memory allocations fail. 263*/ 264