List of all members
BLayoutBuilder::Grid< ParentBuilder > Class Template Reference

BLayoutBuilder::Base subclass for building BGridLayouts. More...

Inherits BLayoutBuilder::Base< ParentBuilder >.

Public Member Functions

Constructors
 Grid (float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING)
 Creates a new BGridView and targets it. More...
 
 Grid (BWindow *window, float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING)
 Creates a new BGroupLayout, and attaches it to a BWindow. More...
 
 Grid (BGridLayout *layout)
 Creates a builder targeting an existing BGridLayout. More...
 
 Grid (BGridView *view)
 Creates a builder targeting a BGridView. More...
 
Adding BViews and BLayoutItems
ThisBuilderAdd (BView *view, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1)
 Add a BView to the BGridLayout this builder represents. More...
 
ThisBuilderAdd (BLayoutItem *item, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1)
 Add a BLayoutItem to the BGridLayout this builder represents. More...
 
ThisBuilderAddMenuField (BMenuField *menuField, int32 column, int32 row, alignment labelAlignment=B_ALIGN_HORIZONTAL_UNSET, int32 labelColumnCount=1, int32 fieldColumnCount=1, int32 rowCount=1)
 Add a BMenuField to the layout. More...
 
ThisBuilderAddTextControl (BTextControl *textControl, int32 column, int32 row, alignment labelAlignment=B_ALIGN_HORIZONTAL_UNSET, int32 labelColumnCount=1, int32 textColumnCount=1, int32 rowCount=1)
 Add a BMenuField to the layout. More...
 
- Public Member Functions inherited from BLayoutBuilder::Base< ParentBuilder >
ParentBuilder & End ()
 Returns this builder's parent. More...
 
void SetParent (ParentBuilder *parent)
 Internal method for use by BLayoutBuilder::Base subclasses, this is essential to the builder stack semantics. More...
 

Detailed Description

template<typename ParentBuilder>
class BLayoutBuilder::Grid< ParentBuilder >

BLayoutBuilder::Base subclass for building BGridLayouts.

Since
Haiku R1

Each item is added to the grid layout at (column, row) and may span multiple columns and rows.

Constructor & Destructor Documentation

◆ Grid() [1/4]

template<typename ParentBuilder >
BLayoutBuilder::Grid< ParentBuilder >::Grid ( float  horizontal = B_USE_DEFAULT_SPACING,
float  vertical = B_USE_DEFAULT_SPACING 
)
inline

Creates a new BGridView and targets it.

Methods called on this builder will be directed to the new BGridView's BGridLayout.

Parameters
horizontalThe horizontal spacing for the new BGridLayout.
verticalThe vertical spacing for the new BGridLayout.
Since
Haiku R1

Referenced by BLayoutBuilder::Grid< ParentBuilder >::Grid().

◆ Grid() [2/4]

template<typename ParentBuilder >
BLayoutBuilder::Grid< ParentBuilder >::Grid ( BWindow window,
float  horizontal = B_USE_DEFAULT_SPACING,
float  vertical = B_USE_DEFAULT_SPACING 
)
inline

Creates a new BGroupLayout, and attaches it to a BWindow.

Note
The top BView* in window has its ViewColor set to B_PANEL_BACKGROUND_COLOR.
Parameters
windowThew BWindow* to attach the newly created BGroupLayout to.
horizontalThe horizontal spacing for the new BGridLayout.
verticalThe vertical spacing for the new BGridLayout.
Since
Haiku R1

References BView::AdoptSystemColors(), BLayoutBuilder::Grid< ParentBuilder >::Grid(), BView::HasDefaultColors(), BLayout::Owner(), BWindow::SetLayout(), and BView::SetLayout().

◆ Grid() [3/4]

template<typename ParentBuilder >
BLayoutBuilder::Grid< ParentBuilder >::Grid ( BGridLayout layout)
inline

Creates a builder targeting an existing BGridLayout.

Methods called on this builder will be directed to layout.

Parameters
layoutThe BGridLayout to target with this builder.
Since
Haiku R1

◆ Grid() [4/4]

template<typename ParentBuilder >
BLayoutBuilder::Grid< ParentBuilder >::Grid ( BGridView *  view)
inline

Creates a builder targeting a BGridView.

Methods called on this builder will be directed to view->GridLayout().

Parameters
viewThe BGridView this builder will target.
Since
Haiku R1

References BLayout::Owner().

Member Function Documentation

◆ Add() [1/2]

template<typename ParentBuilder >
Grid< ParentBuilder >::ThisBuilder & BLayoutBuilder::Grid< ParentBuilder >::Add ( BView view,
int32  column,
int32  row,
int32  columnCount = 1,
int32  rowCount = 1 
)
inline

Add a BView to the BGridLayout this builder represents.

Parameters
viewThe BView to be added.
columnThe column number (zero-index) to use.
rowThe row number (zero-index) to use.
columnCountThe number of columns to span over.
rowCountThe number of rows to span over.
See also
BGridLayout::AddView(BView*)
Since
Haiku R1

References BGridLayout::AddView().

◆ Add() [2/2]

template<typename ParentBuilder >
Grid< ParentBuilder >::ThisBuilder & BLayoutBuilder::Grid< ParentBuilder >::Add ( BLayoutItem item,
int32  column,
int32  row,
int32  columnCount = 1,
int32  rowCount = 1 
)
inline

Add a BLayoutItem to the BGridLayout this builder represents.

Parameters
itemThe BLayoutItem to be added.
columnThe column number (zero-index) to use.
rowThe row number (zero-index) to use.
columnCountThe number of columns to span over.
rowCountThe number of rows to span over.
See also
BGridLayout::AddItem(BLayoutItem*)
Since
Haiku R1

References BGridLayout::AddItem().

◆ AddMenuField()

template<typename ParentBuilder >
Grid< ParentBuilder >::ThisBuilder & BLayoutBuilder::Grid< ParentBuilder >::AddMenuField ( BMenuField item,
int32  column,
int32  row,
alignment  labelAlignment = B_ALIGN_HORIZONTAL_UNSET,
int32  labelColumnCount = 1,
int32  fieldColumnCount = 1,
int32  rowCount = 1 
)
inline

Add a BMenuField to the layout.

Parameters
itemThe BMenuField to be added.
columnThe column number (zero-index) to use.
rowThe row number (zero-index) to use.
labelAlignmentThe alignment of the label to use. Choices include:
  • B_ALIGN_LEFT
  • B_ALIGN_RIGHT
  • B_ALIGN_CENTER
  • B_ALIGN_HORIZONTAL_CENTER
  • B_ALIGN_HORIZONTAL_UNSET
  • B_ALIGN_USE_FULL_WIDTH
labelColumnCountThe number of columns the label will span over.
fieldColumnCountThe number of columns the menu field will span over.
rowCountThe number of rows to span over.

A BMenuField is composed of a label and a menu. This method allows to lay the sub-components in separate grid cells, allowing easy alignment of the menu with other items in the layout.

Since
Haiku R1

References BMenuField::CreateLabelLayoutItem(), and BLayoutItem::SetExplicitAlignment().

◆ AddTextControl()

template<typename ParentBuilder >
Grid< ParentBuilder >::ThisBuilder & BLayoutBuilder::Grid< ParentBuilder >::AddTextControl ( BTextControl item,
int32  column,
int32  row,
alignment  labelAlignment = B_ALIGN_HORIZONTAL_UNSET,
int32  labelColumnCount = 1,
int32  textColumnCount = 1,
int32  rowCount = 1 
)
inline

Add a BMenuField to the layout.

Parameters
itemThe BMenuField to be added.
columnThe column number (zero-index) to use.
rowThe row number (zero-index) to use.
labelAlignmentThe alignment of the label to use. Choices include:
  • B_ALIGN_LEFT
  • B_ALIGN_RIGHT
  • B_ALIGN_CENTER
  • B_ALIGN_HORIZONTAL_CENTER
  • B_ALIGN_HORIZONTAL_UNSET
  • B_ALIGN_USE_FULL_WIDTH
labelColumnCountThe number of columns the label will span over.
textColumnCountThe number of columns the text field will span over.
rowCountThe number of rows to span over.

A BTextControl is composed of a label and a text area. This method allows to lay the sub-components in separate grid cells, allowing easy alignment of the text area with other items in the layout.

Since
Haiku R1

References BTextControl::CreateLabelLayoutItem(), and BLayoutItem::SetExplicitAlignment().