1/* 2 * Copyright 2017 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Adrien Destugues, pulkomandy@pulkomandy.tk 7 * 8 * Corresponds to: 9 * headers/os/interface/LayoutBuilder.h rev 51359 10 * src/kits/interface/LayoutBuilder.cpp rev 51359 11 */ 12 13/*! 14 \class BLayoutBuilder::Grid<> 15 \ingroup layout 16 \ingroup libbe 17 \brief BLayoutBuilder::Base subclass for building BGridLayouts. 18 19 \since Haiku R1 20 21 Each item is added to the grid layout at (column, row) and may span multiple 22 columns and rows. 23*/ 24 25/*! 26 \name Constructors 27*/ 28 29 30//! @{ 31 32 33/*! 34 \fn BLayoutBuilder::Grid<ParentBuilder>::Grid(BWindow *window, 35 float horizontal, float vertical) 36 \brief Creates a new BGroupLayout, and attaches it to a BWindow. 37 38 \note The top BView* in \a window has its ViewColor set to 39 \c B_PANEL_BACKGROUND_COLOR. 40 \param window Thew BWindow* to attach the newly created BGroupLayout to. 41 \param horizontal The horizontal spacing for the new BGridLayout. 42 \param vertical The vertical spacing for the new BGridLayout. 43 44 \since Haiku R1 45*/ 46 47 48/*! 49 \fn BLayoutBuilder::Grid<ParentBuilder>::Grid(BGridLayout* layout) 50 \brief Creates a builder targeting an existing BGridLayout. 51 52 Methods called on this builder will be directed to \a layout. 53 54 \param layout The BGridLayout to target with this builder. 55 56 \since Haiku R1 57*/ 58 59 60/*! 61 \fn BLayoutBuilder::Grid<ParentBuilder>::Grid(BGridView* view) 62 \brief Creates a builder targeting a BGridView. 63 64 Methods called on this builder will be directed to 65 \c view->GridLayout(). 66 67 \param view The BGridView this builder will target. 68 69 \since Haiku R1 70*/ 71 72 73/*! 74 \fn BLayoutBuilder::Grid<ParentBuilder>::Grid( 75 float horizontal, float vertical) 76 \brief Creates a new BGridView and targets it. 77 78 Methods called on this builder will be directed to the new BGridView's 79 BGridLayout. 80 81 \param horizontal The horizontal spacing for the new BGridLayout. 82 \param vertical The vertical spacing for the new BGridLayout. 83 84 \since Haiku R1 85*/ 86//! @} 87 88 89/*! 90 \name Adding BViews and BLayoutItems 91*/ 92 93 94//! @{ 95 96 97/*! 98 \fn ThisBuilder& BLayoutBuilder::Grid<ParentBuilder>::Add(BView* view, 99 int32 column, int32 row, int32 columnCount, int32 rowCount) 100 \brief Add a BView to the BGridLayout this builder represents. 101 102 \param view The BView to be added. 103 \see BGridLayout::AddView(BView*) 104 105 \since Haiku R1 106*/ 107 108 109/*! 110 \fn ThisBuilder& BLayoutBuilder::Grid<ParentBuilder>::Add( 111 BLayoutItem* item, int32 column, int32 row, 112 int32 columnCount, int32 rowCount) 113 \brief Add a BLayoutItem to the BGridLayout this builder represents. 114 115 \param item The BLayoutItem to be added. 116 117 \see BGridLayout::AddItem(BLayoutItem*) 118 119 \since Haiku R1 120*/ 121 122 123/*! 124 \fn ThisBuilder& BLayoutBuilder::Grid<ParentBuilder>::AddMenuField( 125 BMenuField* item, int32 column, int32 row, alignment labelAlignment, 126 int32 labelColumnCount, int32 fieldColumnCount, int32 rowCount) 127 \brief Add a BMenuField to the layout 128 129 \param item The BMenuField to be added. 130 131 A BMenuField is composed of a label and a menu. This method allows to 132 lay the sub-components in separate grid cells, allowing easy alignment 133 of the menu with other items in the layout. 134 135 \since Haiku R1 136*/ 137 138 139/*! 140 \fn ThisBuilder& BLayoutBuilder::Grid<ParentBuilder>::AddTextControl( 141 BTextControl* item, int32 column, int32 row, alignment labelAlignment, 142 int32 labelColumnCount, int32 textColumnCount, int32 rowCount) 143 \brief Add a BMenuField to the layout 144 145 \param item The BMenuField to be added. 146 147 A BTextControl is composed of a label and a text area. This method allows to 148 lay the sub-components in separate grid cells, allowing easy alignment 149 of the text area with other items in the layout. 150 151 \since Haiku R1 152*/ 153 154 155//! @} 156