Public Types | Public Member Functions | List of all members
BLayoutBuilder::Group< ParentBuilder > Class Template Reference

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

Inherits BLayoutBuilder::Base< ParentBuilder >.

Public Types

typedef Grid< ThisBuilderGridBuilder
 Shorthand for builders returned by this builder's AddGrid() methods. More...
 
typedef Group< ThisBuilderGroupBuilder
 Shorthand for builders returned by this builder's AddGroup() methods. More...
 
typedef Split< ThisBuilderSplitBuilder
 Shorthand for builders returned by this builder's AddSplit() methods. More...
 
typedef Group< ParentBuilder > ThisBuilder
 Shorthand representing the type of this. More...
 

Public Member Functions

ThisBuilderSetInsets (float left, float top, float right, float bottom)
 Call the BTwoDimensionalLayout::SetInsets() method on the BGroupLayout this builder represents. More...
 
Constructors
 Group (orientation orientation=B_HORIZONTAL, float spacing=B_USE_DEFAULT_SPACING)
 Creates a new BGroupView and targets it. More...
 
 Group (BWindow *window, orientation orientation=B_HORIZONTAL, float spacing=B_USE_DEFAULT_SPACING)
 Creates a new BGroupLayout, and attaches it to a BWindow. More...
 
 Group (BGroupLayout *layout)
 Creates a builder targeting a BGroupLayout. More...
 
 Group (BGroupView *view)
 Creates a builder targeting a BGroupView. More...
 
Accessors
BGroupLayoutLayout () const
 Get the BGroupLayout this builder represents. More...
 
BViewView () const
 Get the BView this builder's BGroupLayout is attached to. More...
 
ThisBuilderGetLayout (BGroupLayout **_layout)
 Get the BGroupLayout this builder represents. More...
 
ThisBuilderGetView (BView **_view)
 Get the BView this builder's BGroupLayout is attached to. More...
 
 operator BGroupLayout * ()
 Cast this builder into the BGroupLayout it represents. More...
 
Adding BViews and BLayoutItems
ThisBuilderAdd (BView *view)
 Add a BView to the BGroupLayout this builder represents. More...
 
ThisBuilderAdd (BView *view, float weight)
 Add BView to the BGroupLayout this builder represents. More...
 
ThisBuilderAdd (BLayoutItem *item)
 Add a BLayoutItem to the BGroupLayout this builder represents. More...
 
ThisBuilderAdd (BLayoutItem *item, float weight)
 Add a BLayoutItem the BGroupLayout this builder represents. More...
 
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 this builder again until you call End().

GroupBuilder AddGroup (orientation orientation, float spacing=B_USE_DEFAULT_SPACING, float weight=1.0f)
 Construct and add a viewless BGroupLayout, then return a GroupBuilder representing the newly added layout. More...
 
GroupBuilder AddGroup (BGroupView *groupView, float weight=1.0f)
 Add BGroupView and return a builder representing the newly added BGroupView. More...
 
GroupBuilder AddGroup (BGroupLayout *groupLayout, float weight=1.0f)
 Add a BGroupLayout and return a builder representing the newly added BGroupLayout. More...
 
GridBuilder AddGrid (float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING, float weight=1.0f)
 Create and add a viewless BGridLayout, then return a builder representing the newly created BGridLayout. More...
 
GridBuilder AddGrid (BGridLayout *gridLayout, float weight=1.0f)
 Add a BGridLayout, then return a builder the newly added BGridLayout. More...
 
GridBuilder AddGrid (BGridView *gridView, float weight=1.0f)
 Add a BGridView, then return a builder the newly added BGridView. More...
 
SplitBuilder AddSplit (orientation orientation, float spacing=B_USE_DEFAULT_SPACING, float weight=1.0f)
 Create and add a new BSplitView with a weight of weight, then return a SplitBuilder representing the new BSplitView. More...
 
SplitBuilder AddSplit (BSplitView *splitView, float weight=1.0f)
 Add a BSplitView to the BGroupLayout this builder represents and return a SplitBuilder representing the BSplitView. More...
 
Adding BSpaceLayoutItems

Some convenience methods for adding special BSpaceLayoutItems.

ThisBuilderAddGlue (float weight=1.0f)
 Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateGlue() to the BGroupLayout this builder represents. More...
 
ThisBuilderAddStrut (float size)
 Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateHorizontalStrut() or BSpaceLayoutItem::CreateVerticalStrut() to the BGroupLayout this builder represents. 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::Group< ParentBuilder >

BLayoutBuilder::Base subclass for building BGroupLayouts.

Since
Haiku R1

Member Typedef Documentation

◆ GridBuilder

template<typename ParentBuilder>
BLayoutBuilder::Group< ParentBuilder >::GridBuilder

Shorthand for builders returned by this builder's AddGrid() methods.

Since
Haiku R1

◆ GroupBuilder

template<typename ParentBuilder>
BLayoutBuilder::Group< ParentBuilder >::GroupBuilder

Shorthand for builders returned by this builder's AddGroup() methods.

Since
Haiku R1

◆ SplitBuilder

template<typename ParentBuilder>
BLayoutBuilder::Group< ParentBuilder >::SplitBuilder

Shorthand for builders returned by this builder's AddSplit() methods.

Since
Haiku R1

◆ ThisBuilder

template<typename ParentBuilder>
BLayoutBuilder::Group< ParentBuilder >::ThisBuilder

Shorthand representing the type of this.

Since
Haiku R1

Constructor & Destructor Documentation

◆ Group() [1/4]

template<typename ParentBuilder >
BLayoutBuilder::Group< ParentBuilder >::Group ( orientation  orientation = B_HORIZONTAL,
float  spacing = B_USE_DEFAULT_SPACING 
)
inline

Creates a new BGroupView and targets it.

Methods called on this builder will be directed to the new BGroupView's BGroupLayout.

Parameters
orientationThe orientation for the new BGroupView.
spacingThe spacing for the new BGroupView.
Since
Haiku R1

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

◆ Group() [2/4]

template<typename ParentBuilder >
BLayoutBuilder::Group< ParentBuilder >::Group ( BWindow window,
orientation  orientation = B_HORIZONTAL,
float  spacing = 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.
orientationThe orientation for the new BGroupLayout.
spacingThe spacing for the new BGroupLayout.
Since
Haiku R1

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

◆ Group() [3/4]

template<typename ParentBuilder >
BLayoutBuilder::Group< ParentBuilder >::Group ( BGroupLayout layout)
inline

Creates a builder targeting a BGroupLayout.

Methods called on this builder will be directed to layout.

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

◆ Group() [4/4]

template<typename ParentBuilder >
BLayoutBuilder::Group< ParentBuilder >::Group ( BGroupView *  view)
inline

Creates a builder targeting a BGroupView.

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

Parameters
viewThe BGroupView this builder will target.
Since
Haiku R1

Member Function Documentation

◆ Add() [1/4]

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BView view)
inline

Add a BView to the BGroupLayout this builder represents.

Parameters
viewThe BView to be added.
See also
BGroupLayout::AddView(BView*)
Since
Haiku R1

References BGroupLayout::AddView().

◆ Add() [2/4]

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BView view,
float  weight 
)
inline

Add BView to the BGroupLayout this builder represents.

Parameters
viewThe BView to be added.
weightThe weight to give view.
See also
BGroupLayout::AddView(BView* view, float weight)
Since
Haiku R1

References BGroupLayout::AddView().

◆ Add() [3/4]

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BLayoutItem item)
inline

Add a BLayoutItem to the BGroupLayout this builder represents.

Parameters
itemThe BLayoutItem to be added.
See also
BGroupLayout::AddItem(BLayoutItem*)
Since
Haiku R1

References BGroupLayout::AddItem().

◆ Add() [4/4]

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::Add ( BLayoutItem item,
float  weight 
)
inline

Add a BLayoutItem the BGroupLayout this builder represents.

Parameters
itemThe BLayoutItem to be added.
weightThe weight to give item.
See also
BGroupLayout::AddItem(BLayoutItem* item, float weight)
Since
Haiku R1

References BGroupLayout::AddItem().

◆ AddGlue()

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::AddGlue ( float  weight = 1.0f)
inline

Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateGlue() to the BGroupLayout this builder represents.

Parameters
weightThe weight of the BSpaceLayoutItem in the BGroupLayout this builder represents
Since
Haiku R1

References BGroupLayout::AddItem().

◆ AddGrid() [1/3]

template<typename ParentBuilder >
Group< ParentBuilder >::GridBuilder BLayoutBuilder::Group< ParentBuilder >::AddGrid ( float  horizontalSpacing = B_USE_DEFAULT_SPACING,
float  verticalSpacing = B_USE_DEFAULT_SPACING,
float  weight = 1.0f 
)
inline

Create and add a viewless BGridLayout, then return a builder representing the newly created BGridLayout.

Parameters
horizontalSpacingThe horizontal spacing for the new BGridLayout.
verticalSpacingThe vertical spacing for the new BGridLayout.
weightThe weight for the new BGroupLayout in the BGroupLayout this builder represents.
Returns
A GridBuilder representing the newly created BGridLayout.
Since
Haiku R1

References BGroupLayout::AddItem(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

◆ AddGrid() [2/3]

template<typename ParentBuilder >
Group< ParentBuilder >::GridBuilder BLayoutBuilder::Group< ParentBuilder >::AddGrid ( BGridLayout gridLayout,
float  weight = 1.0f 
)
inline

Add a BGridLayout, then return a builder the newly added BGridLayout.

Parameters
gridLayoutThe BGridLayout to be added and used to construct the returned GridBuilder.
weightThe weight for groupLayout in the BGroupLayout this builder represents.
Returns
a GridBuilder representing gridLayout.
Since
Haiku R1

References BGroupLayout::AddItem(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

◆ AddGrid() [3/3]

template<typename ParentBuilder >
Group< ParentBuilder >::GridBuilder BLayoutBuilder::Group< ParentBuilder >::AddGrid ( BGridView *  gridView,
float  weight = 1.0f 
)
inline

Add a BGridView, then return a builder the newly added BGridView.

Parameters
gridViewThe BGridView to be added and used to construct the returned GridBuilder.
weightThe weight for groupLayout in the BGroupLayout this builder represents.
Returns
a GridBuilder representing gridView.
Since
Haiku R1

References BGroupLayout::AddItem(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

◆ AddGroup() [1/3]

template<typename ParentBuilder >
Group< ParentBuilder >::GroupBuilder BLayoutBuilder::Group< ParentBuilder >::AddGroup ( orientation  orientation,
float  spacing = B_USE_DEFAULT_SPACING,
float  weight = 1.0f 
)
inline

Construct and add a viewless BGroupLayout, then return a GroupBuilder representing the newly added layout.

Parameters
orientationThe orientation to use for the new BGroupLayout.
spacingThe spacing to use for the new BGroupLayout.
weightThe weight for the new BGroupLayout in the BGroupLayout this builder represents.
Returns
A GroupBuilder representing the newly created BGroupLayout.
Since
Haiku R1

References BGroupLayout::AddItem(), BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

◆ AddGroup() [2/3]

template<typename ParentBuilder >
Group< ParentBuilder >::GroupBuilder BLayoutBuilder::Group< ParentBuilder >::AddGroup ( BGroupView *  groupView,
float  weight = 1.0f 
)
inline

Add BGroupView and return a builder representing the newly added BGroupView.

Parameters
groupViewThe BGroupView to be added.
weightThe weight for groupView in the BGroupLayout this builder represents.
Returns
A GroupBuilder representing groupView.
Since
Haiku R1

References BGroupLayout::AddItem(), BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

◆ AddGroup() [3/3]

template<typename ParentBuilder >
Group< ParentBuilder >::GroupBuilder BLayoutBuilder::Group< ParentBuilder >::AddGroup ( BGroupLayout groupLayout,
float  weight = 1.0f 
)
inline

Add a BGroupLayout and return a builder representing the newly added BGroupLayout.

Parameters
groupLayoutThe BGroupLayout to be added.
weightThe weight for groupLayout in the BGroupLayout this builder represents.
Returns
A GroupBuilder representing groupLayout.
Since
Haiku R1

References BGroupLayout::AddItem(), BLayoutBuilder::Group< ParentBuilder >::Layout(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

◆ AddSplit() [1/2]

template<typename ParentBuilder >
Group< ParentBuilder >::SplitBuilder BLayoutBuilder::Group< ParentBuilder >::AddSplit ( orientation  orientation,
float  spacing = B_USE_DEFAULT_SPACING,
float  weight = 1.0f 
)
inline

Create and add a new BSplitView with a weight of weight, then return a SplitBuilder representing the new BSplitView.

Parameters
orientationThe orientation of the new BSplitView.
spacingThe spacing of the new BSplitView.
weightThe weight, in this BGroupLayout for the new BSplitView.
Returns
a SplitBuilder representing the new BSplitView.
Since
Haiku R1

References BGroupLayout::AddView().

◆ AddSplit() [2/2]

template<typename ParentBuilder >
Group< ParentBuilder >::SplitBuilder BLayoutBuilder::Group< ParentBuilder >::AddSplit ( BSplitView *  splitView,
float  weight = 1.0f 
)
inline

Add a BSplitView to the BGroupLayout this builder represents and return a SplitBuilder representing the BSplitView.

Parameters
splitViewThe BSplitView to be added.
weightThe weight of the BSplitView in the BGroupLayout this builder represents.
Since
Haiku R1

References BGroupLayout::AddView(), and BLayoutBuilder::Base< ParentBuilder >::SetParent().

◆ AddStrut()

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::AddStrut ( float  size)
inline

Add a BSpaceLayoutItem created by BSpaceLayoutItem::CreateHorizontalStrut() or BSpaceLayoutItem::CreateVerticalStrut() to the BGroupLayout this builder represents.

Parameters
sizeThe width or height of the strut to be created (depending on the orientation of the BGroupLayout this builder represents).
Since
Haiku R1

References BGroupLayout::AddItem(), B_HORIZONTAL, and BGroupLayout::Orientation().

◆ GetLayout()

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::GetLayout ( BGroupLayout **  _layout)
inline

Get the BGroupLayout this builder represents.

Parameters
[out]_layoutThe BGroupLayout this builder represents.
Since
Haiku R1

◆ GetView()

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::GetView ( BView **  _view)
inline

Get the BView this builder's BGroupLayout is attached to.

Parameters
[out]_viewThe BView this builder's BGroupLayout is attached to.
Since
Haiku R1

References BLayout::Owner().

◆ Layout()

template<typename ParentBuilder >
BGroupLayout * BLayoutBuilder::Group< ParentBuilder >::Layout ( ) const
inline

Get the BGroupLayout this builder represents.

Since
Haiku R1

Referenced by BLayoutBuilder::Group< ParentBuilder >::AddGroup().

◆ operator BGroupLayout *()

template<typename ParentBuilder >
BLayoutBuilder::Group< ParentBuilder >::operator BGroupLayout * ( )
inline

Cast this builder into the BGroupLayout it represents.

Since
Haiku R1

◆ SetInsets()

template<typename ParentBuilder >
Group< ParentBuilder >::ThisBuilder & BLayoutBuilder::Group< ParentBuilder >::SetInsets ( float  left,
float  top,
float  right,
float  bottom 
)
inline

◆ View()

template<typename ParentBuilder >
BView * BLayoutBuilder::Group< ParentBuilder >::View ( ) const
inline

Get the BView this builder's BGroupLayout is attached to.

Since
Haiku R1

References BLayout::Owner().