BLayoutBuilder::Base subclass for building BGridLayouts. More...
Inherits BLayoutBuilder::Base< ParentBuilder >.
Public Types | |
typedef Cards< ThisBuilder > | CardBuilder |
typedef Grid< ThisBuilder > | GridBuilder |
typedef Group< ThisBuilder > | GroupBuilder |
typedef Split< ThisBuilder > | SplitBuilder |
typedef Grid< ParentBuilder > | ThisBuilder |
Public Member Functions | |
Constructors | |
Grid (float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING) | |
Creates a new BGridView and targets it. | |
Grid (BWindow *window, float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING) | |
Creates a new BGridLayout, and attaches it to a BWindow. | |
Grid (BView *view, float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING) | |
Creates a builder targeting an existing view. | |
Grid (BGridLayout *layout) | |
Creates a builder targeting an existing BGridLayout. | |
Grid (BGridView *view) | |
Creates a builder targeting a BGridView. | |
Accessors | |
BGridLayout * | Layout () const |
BView * | View () const |
ThisBuilder & | GetLayout (BGridLayout **_layout) |
ThisBuilder & | GetView (BView **_view) |
operator BGridLayout * () | |
Cast this builder into the layout object it represents. | |
Adding BViews and BLayoutItems | |
ThisBuilder & | Add (BView *view, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
Add a BView to the BGridLayout this builder represents. | |
ThisBuilder & | Add (BLayoutItem *item, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
Add a BLayoutItem to the BGridLayout this builder represents. | |
ThisBuilder & | AddMenuField (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. | |
ThisBuilder & | AddTextControl (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. | |
Adding BLayouts and their BView Pairs | |
A set of methods that add a BLayout or BView subclass and return a BLayoutBuilder::Base subclass representing the newly added object. These methods push a new builder on top of the stack, you will not be using | |
GroupBuilder | AddGroup (orientation orientation, float spacing, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
GroupBuilder | AddGroup (BGroupView *groupView, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
GroupBuilder | AddGroup (BGroupLayout *groupLayout, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
GridBuilder | AddGrid (float horizontalSpacing, float verticalSpacing, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
GridBuilder | AddGrid (BGridLayout *gridLayout, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
GridBuilder | AddGrid (BGridView *gridView, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
SplitBuilder | AddSplit (orientation orientation, float spacing, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
SplitBuilder | AddSplit (BSplitView *splitView, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
CardBuilder | AddCards (int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
CardBuilder | AddCards (BCardLayout *cardLayout, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
CardBuilder | AddCards (BCardView *cardView, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
Adding BSpaceLayoutItems | |
A convenience method to add glue to a cell. | |
ThisBuilder & | AddGlue (int32 column, int32 row, int32 columnCount=1, int32 rowCount=1) |
BGridLayout Properties | |
These methods expose some settings of the underlying grid layout. | |
ThisBuilder & | SetHorizontalSpacing (float spacing) |
ThisBuilder & | SetVerticalSpacing (float spacing) |
ThisBuilder & | SetSpacing (float horizontal, float vertical) |
ThisBuilder & | SetColumnWeight (int32 column, float weight) |
ThisBuilder & | SetRowWeight (int32 row, float weight) |
Insets | |
ThisBuilder & | SetInsets (float left, float top, float right, float bottom) |
ThisBuilder & | SetInsets (float horizontal, float vertical) |
ThisBuilder & | SetInsets (float insets) |
Explicit Sizes and Alignment | |
ThisBuilder & | SetExplicitMinSize (BSize size) |
ThisBuilder & | SetExplicitMaxSize (BSize size) |
ThisBuilder & | SetExplicitPreferredSize (BSize size) |
ThisBuilder & | SetExplicitAlignment (BAlignment alignment) |
Public Member Functions inherited from BLayoutBuilder::Base< ParentBuilder > | |
ParentBuilder & | End () |
Returns this builder's parent. | |
void | SetParent (ParentBuilder *parent) |
Internal method for use by BLayoutBuilder::Base subclasses, this is essential to the builder stack semantics. | |
BLayoutBuilder::Base subclass for building BGridLayouts.
Each item is added to the grid layout at (column, row) and may span multiple columns and rows.
BLayoutBuilder::Grid< ParentBuilder >::CardBuilder |
Shorthand for builders returned by this builder's AddCards() methods.
BLayoutBuilder::Grid< ParentBuilder >::GridBuilder |
Shorthand for builders returned by this builder's AddGrid() methods.
BLayoutBuilder::Grid< ParentBuilder >::GroupBuilder |
Shorthand for builders returned by this builder's AddGroup() methods.
BLayoutBuilder::Grid< ParentBuilder >::SplitBuilder |
Shorthand for builders returned by this builder's AddSplit() methods.
BLayoutBuilder::Grid< ParentBuilder >::ThisBuilder |
Shorthand representing the type of this
.
|
inline |
Creates a new BGridView and targets it.
Methods called on this builder will be directed to the new BGridView's BGridLayout.
horizontal | The horizontal spacing for the new BGridLayout. |
vertical | The vertical spacing for the new BGridLayout. |
|
inline |
Creates a new BGridLayout, and attaches it to a BWindow.
B_PANEL_BACKGROUND_COLOR
. window | Thew BWindow* to attach the newly created BGroupLayout to. |
horizontal | The horizontal spacing for the new BGridLayout. |
vertical | The vertical spacing for the new BGridLayout. |
References BView::AdoptSystemColors(), BLayout::Owner(), and BWindow::SetLayout().
|
inline |
Creates a builder targeting an existing view.
view | The BView* to attach the newly created BGridLayout to. |
horizontal | The horizontal spacing for the new BGridLayout. |
vertical | The vertical spacing for the new BGroupLayout. |
References BView::AdoptSystemColors(), BView::HasDefaultColors(), and BView::SetLayout().
|
inline |
Creates a builder targeting an existing BGridLayout.
Methods called on this builder will be directed to layout.
layout | The BGridLayout to target with this builder. |
|
inline |
|
inline |
Add a BLayoutItem to the BGridLayout this builder represents.
item | The BLayoutItem to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span over. |
rowCount | The number of rows to span over. |
|
inline |
Add a BView to the BGridLayout this builder represents.
view | The BView to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span over. |
rowCount | The number of rows to span over. |
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddCards( BCardLayout* cardLayout, float weight)
cardLayout | The existing layout to add to the current grid layout. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the cardLayout over. |
rowCount | The number of rows to span the cardLayout over. |
References BLayoutBuilder::Base< ParentBuilder >::SetParent(), and BLayoutBuilder::Cards< ParentBuilder >::View().
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddCards( BCardView* cardView, float weight)
cardView | The existing BCardView to add to the current grid layout. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the cardView over. |
rowCount | The number of rows to span the cardView over. |
References BLayoutBuilder::Base< ParentBuilder >::SetParent(), and BLayoutBuilder::Cards< ParentBuilder >::View().
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddCards( float weight)
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the new layout over. |
rowCount | The number of rows to span the new layout over. |
References BLayoutBuilder::Base< ParentBuilder >::SetParent(), and BLayoutBuilder::Cards< ParentBuilder >::View().
|
inline |
Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateGlue() to the builder's layout.
column | The column number (zero-index) for the glue. |
row | The row number (zero-index) for the glue. |
columnCount | The number of columns to span the glue item over. |
rowCount | The number of rows to span the glue item over. |
References BSpaceLayoutItem::CreateGlue().
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddGrid( BGridLayout* gridLayout, float weight)
gridLayout | The BGridLayout to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the gridLayout over. |
rowCount | The number of rows to span the gridLayout over. |
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddGrid( BGridView* gridView, float weight)
gridView | The BGridView to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the gridView over. |
rowCount | The number of rows to span the gridView over. |
References BLayoutBuilder::Base< ParentBuilder >::SetParent(), and BLayoutBuilder::Grid< ParentBuilder >::View().
|
inline |
Shorthand for builders returned by this builder's AddGrid() methods.
horizontalSpacing | The horizontal spacing for the new BGridLayout. |
verticalSpacing | The vertical spacing for the new BGridLayout. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the new BGridLayout over. |
rowCount | The number of rows to span the new BGridLayout over. |
References BLayoutBuilder::Grid< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddGroup( BGroupLayout* groupLayout, float weight)
groupLayout | The BGroupLayout to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the groupLayout over. |
rowCount | The number of rows to span the groupLayout over. |
References BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddGroup(BGroupView* groupView, float weight)
groupView | The BGroupView to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the groupView over. |
rowCount | The number of rows to span the groupView over. |
References BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().
|
inline |
orientation | The orientation to use for the new BGroupLayout. |
spacing | The spacing to use for the new BGroupLayout. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the new BGroupLayout over. |
rowCount | The number of rows to span the new BGroupLayout over. |
References BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().
|
inline |
Add a BMenuField to the layout.
item | The BMenuField to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
labelAlignment | The alignment of the label to use. Choices include:
|
labelColumnCount | The number of columns the label will span over. |
fieldColumnCount | The number of columns the menu field will span over. |
rowCount | The 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.
References BMenuField::CreateLabelLayoutItem(), BMenuField::CreateMenuBarLayoutItem(), and BLayoutItem::SetExplicitAlignment().
|
inline |
BLayoutBuilder::Group<ParentBuilder>::AddSplit( BSplitView* splitView, float weight)
splitView | The BSplitView to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the splitView over. |
rowCount | The number of rows to span the splitView over. |
References BLayoutBuilder::Base< ParentBuilder >::SetParent(), and BLayoutBuilder::Split< ParentBuilder >::View().
|
inline |
orientation | The orientation of the new BSplitView. |
spacing | The spacing of the new BSplitView. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
columnCount | The number of columns to span the new BSplitView over. |
rowCount | The number of rows to span the new BSplitView over. |
References BLayoutBuilder::Base< ParentBuilder >::SetParent(), and BLayoutBuilder::Split< ParentBuilder >::View().
|
inline |
Add a BMenuField to the layout.
item | The BMenuField to be added. |
column | The column number (zero-index) to use. |
row | The row number (zero-index) to use. |
labelAlignment | The alignment of the label to use. Choices include:
|
labelColumnCount | The number of columns the label will span over. |
textColumnCount | The number of columns the text field will span over. |
rowCount | The 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.
References BTextControl::CreateLabelLayoutItem(), BTextControl::CreateTextViewLayoutItem(), and BLayoutItem::SetExplicitAlignment().
|
inline |
Get the layout this builder represents.
[out] | _layout | The layout this builder represents. |
|
inline |
|
inline |
Get a pointer to the layout this builder represents.
Referenced by BLayoutBuilder::Cards< ParentBuilder >::AddGrid(), BLayoutBuilder::Group< ParentBuilder >::AddGrid(), BLayoutBuilder::Split< ParentBuilder >::AddGrid(), and BLayoutBuilder::Grid< ParentBuilder >::AddGrid().
|
inline |
Cast this builder into the layout object it represents.
|
inline |
Set the weight for column to weight.
column | The column to set. |
weight | The weight to set. |
References BLayoutBuilder::Grid< ParentBuilder >::SetColumnWeight().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetColumnWeight().
|
inline |
Set the explicit alignment of the underlying layout.
References BLayoutBuilder::Grid< ParentBuilder >::SetExplicitAlignment().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetExplicitAlignment().
|
inline |
Set the explicit maximum size of the underlying layout.
References BLayoutBuilder::Grid< ParentBuilder >::SetExplicitMaxSize().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetExplicitMaxSize().
|
inline |
Set the explicit minimum size of the underlying layout.
References BLayoutBuilder::Grid< ParentBuilder >::SetExplicitMinSize().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetExplicitMinSize().
|
inline |
Set the explicit preferred size of the underlying layout.
References BLayoutBuilder::Grid< ParentBuilder >::SetExplicitPreferredSize().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetExplicitPreferredSize().
|
inline |
Set the spacing between columns for this layout.
spacing | The number of pixels of spacing to set. |
References BLayoutBuilder::Grid< ParentBuilder >::SetHorizontalSpacing().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetHorizontalSpacing().
|
inline |
Set the insets for this layout.
This is a convenience method to easily set similar insets.
horizontal | The insets to the left and right of the layout. |
vertical | The insets at the top and bottom of the layout. |
References BLayoutBuilder::Grid< ParentBuilder >::SetInsets().
|
inline |
Set the insets for this layout.
This is a convenience method that to easily set all the insets of the layout to the same value.
insets | The inset to be applied to left, top, right and bottom of this layout. |
References BLayoutBuilder::Grid< ParentBuilder >::SetInsets().
|
inline |
Set the insets for this layout.
Set the spacing around the edges of this layout. If you pass B_USE_DEFAULT_SPACING
for a certain parameter, that parameter will be replaced with the value returned by BControlLook::DefaultItemSpacing().
References BLayoutBuilder::Grid< ParentBuilder >::SetInsets().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetInsets().
|
inline |
Set the weight of row to weight.
row | The row number. |
weight | The weight to set. |
References BLayoutBuilder::Grid< ParentBuilder >::SetRowWeight().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetRowWeight().
|
inline |
Set the spacing between columns and rows for this layout.
horizontal | The number of horizontal pixels of spacing to set. |
vertical | The number of vertical pixels of spacing to set. |
References BLayoutBuilder::Grid< ParentBuilder >::SetSpacing().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetSpacing().
|
inline |
Set the spacing between rows for this layout.
spacing | The number of pixels of spacing to set. |
References BLayoutBuilder::Grid< ParentBuilder >::SetVerticalSpacing().
Referenced by BLayoutBuilder::Grid< ParentBuilder >::SetVerticalSpacing().
|
inline |
Get a pointer to the BView this builder's layout is attached to.
Referenced by BLayoutBuilder::Grid< ParentBuilder >::AddGrid().