Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
BLayout Class Referenceabstract

The BLayout class provides an interface, and some basic implementation to manage the positioning and sizing of BLayoutItem s. More...

Inherits BLayoutItem.

Inherited by BAbstractLayout.

Public Member Functions

 BLayout ()
 Default constructor.
 
 BLayout (BMessage *archive)
 Archive constructor.
 
virtual ~BLayout ()
 Destructor, deletes all BLayoutItem's that this layout manages, and detaches from this BLayout's owner view if there is one.
 
virtual status_t Perform (perform_code d, void *arg)
 Perform some action (Internal method defined for binary compatibility purposes).
 
BView Targeting and Attachment Information
BViewOwner () const
 Returns the Owner of this layout, i.e. the view this layout manages.
 
BViewTargetView () const
 Returns the target view of this layout.
 
virtual BViewView ()
 Returns the same BView* as BLayout::Owner(), this method is inherited from BLayoutItem.
 
Adding, Removing, Counting and Accessing Children
virtual BLayoutItemAddView (BView *child)
 Creates a BLayoutItem to represent a BView, and adds that item to this layout.
 
virtual BLayoutItemAddView (int32 index, BView *child)
 Creates a BLayoutItem to represent child, and adds that item at index to this layout. child is added to this BLayout's target view.
 
virtual bool AddItem (BLayoutItem *item)
 Adds a BLayoutItem to this layout, and adds the BView it represents to this BLayout's target view.
 
virtual bool AddItem (int32 index, BLayoutItem *item)
 Adds item to this layout, and adds the BView item represents to this BLayout's target view.
 
virtual bool RemoveView (BView *child)
 Removes and deletes all BLayoutItem representing a BView from this layout.
 
virtual bool RemoveItem (BLayoutItem *item)
 Removes a BLayoutItem from this layout, and also removes the view it represents from this BLayout's target view.
 
virtual BLayoutItemRemoveItem (int32 index)
 Remove the BLayoutItem at index.
 
BLayoutItemItemAt (int32 index) const
 Get the BLayoutItem at index. Returns NULL if index is out of bounds.
 
int32 CountItems () const
 Get the number of BLayoutItem s in this layout.
 
int32 IndexOfItem (const BLayoutItem *item) const
 Get the index of a BLayoutItem in this layout.
 
int32 IndexOfView (BView *child) const
 Get the index of child in this layout.
 
Methods Triggering or Related to Laying Out the BLayout
virtual void Relayout (bool immediate=false)
 Request this BLayout to reposition and resize its items as required.
 
void LayoutItems (bool force=false)
 If there is no layout currently ongoing, and force is false, creates a new BLayoutContext and calls the DoLayout() method of this BLayout and any BLayout's nested in this BLayout.
 
BLayoutContext * LayoutContext () const
 Returns the BLayoutContext this BLayout is currently operating in, or NULL.
 
- Public Member Functions inherited from BLayoutItem
 BLayoutItem (BMessage *from)
 Archive constructor.
 
virtual status_t Archive (BMessage *into, bool deep=true) const
 Archive the object into a BMessage.
 
BLayoutLayout () const
 Returns the BLayout this BLayoutItem resides in.
 
virtual status_t Perform (perform_code d, void *arg)
 Perform some action (Internal method defined for binary compatibility purposes).
 
bool RemoveSelf ()
 Remove this layout item from the BLayout it is a part of.
 
virtual BViewView ()
 Return the BView this item is representing, or NULL if it does not represent any view.
 
virtual BSize MinSize ()=0
 Returns the minimum desirable size for this item.
 
virtual BSize MaxSize ()=0
 Returns the maximum desirable size for this item.
 
virtual BSize PreferredSize ()=0
 Returns the preferred size for this item.
 
virtual BAlignment Alignment ()=0
 Returns the requested alignment for this item.
 
virtual bool HasHeightForWidth ()
 Returns whether or not this BLayoutItem's height constraints are dependent on its width.
 
virtual void GetHeightForWidth (float width, float *min, float *max, float *preferred)
 Get this BLayoutItem's height constraints for a given width.
 
virtual void SetExplicitMinSize (BSize size)=0
 Set this item's explicit min size, to be used in MinSize().
 
virtual void SetExplicitMaxSize (BSize size)=0
 Set this item's explicit max size, to be used in MaxSize().
 
virtual void SetExplicitPreferredSize (BSize size)=0
 Set this item's explicit preferred size, to be used in PreferredSize().
 
void SetExplicitSize (BSize size)
 Set the explicity size to size.
 
virtual void SetExplicitAlignment (BAlignment alignment)=0
 Set this item's explicit alignment, to be used in Alignment().
 
virtual bool IsVisible ()=0
 Return the current local visibility of this item. If an item is not visible, it will not be given space by the BLayout it resides in.
 
virtual void SetVisible (bool visible)=0
 Set the local visibility of this item.
 
virtual BRect Frame ()=0
 Return the bounding frame of this item.
 
virtual void SetFrame (BRect frame)=0
 Set the bounding frame of this item.
 
void AlignInFrame (BRect frame)
 Position this BLayoutItem within frame, given the value returned by Alignment(), and the size constraints for this item.
 
void * LayoutData () const
 Retrieve arbitrary data attached to this BLayoutItem.
 
void SetLayoutData (void *data)
 Attach arbitrary data to this BLayoutItem.
 
- Public Member Functions inherited from BArchivable
 BArchivable ()
 Constructor. Does nothing.
 
 BArchivable (BMessage *from)
 Constructor. Does important behind-the-scenes work in the unarchiving process.
 
virtual ~BArchivable ()
 Destructor. Does nothing.
 
virtual status_t AllArchived (BMessage *archive) const
 Method relating to the use of BArchiver.
 
virtual status_t AllUnarchived (const BMessage *archive)
 Method relating to the use of BUnarchiver.
 
virtual status_t Archive (BMessage *into, bool deep=true) const
 Archive the object into a BMessage.
 
virtual status_t Perform (perform_code d, void *arg)
 Perform some action (Internal method defined for binary compatibility purposes).
 

Protected Member Functions

virtual status_t AllArchived (BMessage *archive) const
 Method relating to the use of BArchiver.
 
Hook Methods
virtual bool ItemAdded (BLayoutItem *item, int32 atIndex)
 Hook method called when item is added to this layout.
 
virtual void ItemRemoved (BLayoutItem *item, int32 fromIndex)
 Hook method called when item is removed from this layout.
 
virtual void LayoutInvalidated (bool children)
 
virtual void DoLayout ()=0
 Implemented by derived classes to position and resize the items in this layout.
 
virtual void OwnerChanged (BView *was)
 Hook method called when this layout is attached to a BView.
 
virtual void AttachedToLayout ()
 Hook method inherited from BLayoutItem, classes derived from BLayout must include the BLayout version of this method in their implementation.
 
virtual void DetachedFromLayout (BLayout *layout)
 Hook method inherited from BLayoutItem, classes derived from BLayout must include the BLayout version of this method in their implementation.
 
virtual void AncestorVisibilityChanged (bool shown)
 Hook method inherited from BLayoutItem, classes derived from BLayout must include the BLayout version of this method in their implementation.
 
virtual status_t AllArchived (BMessage *into) const
 Method relating to the use of BArchiver.
 
virtual status_t AllUnarchived (const BMessage *from)
 Method relating to the use of BUnarchiver.
 
Hook methods

Subclass Helpers

These methods are meant to ease the development of BLayout subclasses.

bool AncestorsVisible () const
 Get the visibility of the ancestors of this layout.
 
BRect LayoutArea ()
 Returns the on-screen area this layout has received to lay out its items in.
 
void VisibilityChanged (bool show)
 Method to be called by derived classes in their SetVisible() implementation. Calls AncestorVisibilityChanged() on the items in this BLayout.
 

Invalidation and State Mutators and Accessors

virtual void InvalidateLayout (bool children=false)
 Invalidate this layout and any cached data this layout has relating to positioning and sizing of its items.
 
void RequireLayout ()
 Flag this layout as stale, i.e. any cached data may still be valid, but the items need to be repositioned or resized.
 
bool IsValid ()
 Returns whether this layout has been invalidated (via BLayout::InvalidateLayout()) and has not yet been validated (by doing a layout, or by its ResetLayoutInvalidation() method.
 
void EnableLayoutInvalidation ()
 Re-enable layout invalidation after a call to DisableLayoutInvalidation().
 
void DisableLayoutInvalidation ()
 Disable layout invalidation notifications, i.e. calls to this object's InvalidateLayout() method.
 
void ResetLayoutInvalidation ()
 Reset layout invalidation, causing InvalidateLayout calls to proceed again. This method should be called once any cached data has been validated, or updated to valid values.
 

Archiving

These methods relate to the archiving or unarchiving of this object and the BLayoutItem's it contains

Since
Haiku R1
virtual status_t Archive (BMessage *into, bool deep=true) const
 Archives this layout into archive. If deep is true, also archives the items in this layout, calling ItemArchived() for each one.
 
virtual status_t AllUnarchived (const BMessage *from)
 Unarchives the BLayoutItem's for this layout, calling ItemUnarchived() for each one.
 
virtual status_t ItemArchived (BMessage *into, BLayoutItem *item, int32 index) const
 Hook for derived classes to add data specific to item to the into BMessage. item resides at index.
 
virtual status_t ItemUnarchived (const BMessage *from, BLayoutItem *item, int32 index)
 Hook for derived classes to retrieve data specific to item from the from BMessage. item resides at index.
 

Additional Inherited Members

- Static Public Member Functions inherited from BArchivable
static BArchivableInstantiate (BMessage *archive)
 Static member to restore objects from messages.
 

Detailed Description

The BLayout class provides an interface, and some basic implementation to manage the positioning and sizing of BLayoutItem s.

BLayouts can be attached to a BView, managing the BLayoutItem's and BView's that reside in that view, or can be nested within another BLayout as a BLayoutItem.

Before adding a BLayoutItem to a BLayout, that layout must have a target view. When a BLayout is attached directly to a BView via BView::SetLayout() then that BView becomes the target of the layout. When a BLayout is nested in another BLayout (via BLayout::AddItem()) the nested BLayout inherits the target of the layout its nested in, if it does not have a target already. You can retrieve the target view for a layout with the TargetView() method. When adding a BLayoutItem to a BLayout, the item's view (as returned by BLayoutItem::View()) is added to the BLayout's target view.

BView* topView = new BGroupView();
BLayout* topLayout = topView->GetLayout();
BLayout* nestedLayout = new BGroupLayout(B_HORIZONTAL);
topLayout->AddItem(nestedLayout);
BLayout* veryNestedLayout = new BGroupLayout(B_VERTICAL);
nestedLayout->AddItem(veryNestedLayout);
@ B_VERTICAL
Definition: InterfaceDefs.h:189
@ B_HORIZONTAL
Definition: InterfaceDefs.h:188
The BGroupLayout class is a simple BLayout subclass that arranges the items it holds within a vertica...
Definition: GroupLayout.h:10
Container view for a collection of views organized in a horizontal or vertical row.
Definition: GroupView.h:13
The BLayout class provides an interface, and some basic implementation to manage the positioning and ...
Definition: Layout.h:21
virtual bool AddItem(BLayoutItem *item)
Adds a BLayoutItem to this layout, and adds the BView it represents to this BLayout's target view.
View base class.
Definition: View.h:151
BLayout * GetLayout() const
Get the layout of the view.

After executing this code, veryNestedLayout, nestedLayout, and topLayout all have the same target view: topView.

Continuing with the same objects...

BLayout* nestedLayoutWithView = (new BGroupView())->GetLayout();
topLayout->AddItem(nestedLayoutWithView);

nestedLayoutWithView does have a target view of topView. This is because nestedLayoutWithView is attached directly to a BView.

Warning
This class is not yet finalized, if you use it in your software assume that it will break some time in the future.
Since
Haiku R1

Constructor & Destructor Documentation

◆ BLayout() [1/2]

BLayout::BLayout ( )

Default constructor.

After this constructor has finished, this BLayout holds no BLayoutItem's and does not have a target BView.

Warning
Because a new BLayout does not have a target BView, calls to the AddItem() and AddView() methods will fail.
Since
Haiku R1

◆ BLayout() [2/2]

BLayout::BLayout ( BMessage archive)

Archive constructor.

Parameters
archiveThe archive message.
Since
Haiku R1

◆ ~BLayout()

BLayout::~BLayout ( )
virtual

Destructor, deletes all BLayoutItem's that this layout manages, and detaches from this BLayout's owner view if there is one.

Destructor method.

Each BLayoutItem's BView (as returned by BLayoutItem::View()) is also removed from their parent.

Note
Because nested BLayout's are treated as BLayoutItem's, any layouts nested in this BLayout will be deleted.
Since
Haiku R1

Standard Destructor.

Since
Haiku R1

Member Function Documentation

◆ AddItem() [1/2]

bool BLayout::AddItem ( BLayoutItem item)
virtual

Adds a BLayoutItem to this layout, and adds the BView it represents to this BLayout's target view.

Parameters
itemThe BLayoutItem to be added.
Returns
true if the item was added, false otherwise.
Since
Haiku R1

Reimplemented in BGridLayout, and BGroupLayout.

◆ AddItem() [2/2]

bool BLayout::AddItem ( int32  index,
BLayoutItem item 
)
virtual

Adds item to this layout, and adds the BView item represents to this BLayout's target view.

Parameters
itemThe BLayoutItem to be added.
indexThe index at which to add item.

If index is out of bounds, item will be added at the end. If index is somewhere between the first and last indices, then items from index to the end will be shuffled over by one.

Returns
true if the item was added, false otherwise.
Since
Haiku R1

Reimplemented in BGridLayout, and BGroupLayout.

◆ AddView() [1/2]

BLayoutItem * BLayout::AddView ( BView child)
virtual

Creates a BLayoutItem to represent a BView, and adds that item to this layout.

child is added to this BLayout's target view.

Returns
The BLayoutItem created to represent child, or NULL if there was an error.
Parameters
childThe BView to be added to this BLayout.
Since
Haiku R1

Reimplemented in BGridLayout, and BGroupLayout.

◆ AddView() [2/2]

BLayoutItem * BLayout::AddView ( int32  index,
BView child 
)
virtual

Creates a BLayoutItem to represent child, and adds that item at index to this layout. child is added to this BLayout's target view.

Since
Haiku R1

Reimplemented in BGridLayout, and BGroupLayout.

◆ AllArchived()

virtual status_t BLayout::AllArchived ( BMessage into) const
protectedvirtual

Method relating to the use of BArchiver.

This hook function is called once the first BArchiver that was created in an archiving session is either destroyed, or has its Finish() method called. Implementations of this method can be used, in conjunction with BArchiver::IsArchived(), to reference objects in your archive that you do not own, depending on whether or not those objects were archived by their owners. Implementations of this method should call the implementation of their parent class, the same as for the Archive() method.

Warning
To guarantee that your AllArchived() method will be called during archival, you must create a BArchiver object in your Archive() implementation.
You should archive any objects you own in your Archive() method implementation, and NOT your AllArchived() method.
See also
BArchiver BArchiver::Finish()
Since
Haiku R1

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, BGroupLayout, and BTwoDimensionalLayout.

◆ AllUnarchived()

status_t BLayout::AllUnarchived ( const BMessage from)
protectedvirtual

Unarchives the BLayoutItem's for this layout, calling ItemUnarchived() for each one.

Since
Haiku R1

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, BGroupLayout, and BTwoDimensionalLayout.

◆ AncestorsVisible()

bool BLayout::AncestorsVisible ( ) const

Get the visibility of the ancestors of this layout.

If a BLayout is connected to a BView, this will always return true. If a BLayout is nested in another layout (it was passed to AddItem()), then this will reflect the visibility of this BLayout's parent layout. If any layout is hidden (by BLayout::SetVisible()) between this layout and its target BView's layout, then this method will return false.

Since
Haiku R1

◆ AncestorVisibilityChanged()

void BLayout::AncestorVisibilityChanged ( bool  shown)
protectedvirtual

Hook method inherited from BLayoutItem, classes derived from BLayout must include the BLayout version of this method in their implementation.

Since
Haiku R1

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout.

◆ Archive()

status_t BLayout::Archive ( BMessage archive,
bool  deep = true 
) const
virtual

Archives this layout into archive. If deep is true, also archives the items in this layout, calling ItemArchived() for each one.

Since
Haiku R1

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, BGroupLayout, and BTwoDimensionalLayout.

◆ AttachedToLayout()

void BLayout::AttachedToLayout ( )
protectedvirtual

Hook method inherited from BLayoutItem, classes derived from BLayout must include the BLayout version of this method in their implementation.

Since
Haiku R1

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout.

◆ CountItems()

int32 BLayout::CountItems ( ) const

Get the number of BLayoutItem s in this layout.

Since
Haiku R1

◆ DetachedFromLayout()

void BLayout::DetachedFromLayout ( BLayout layout)
protectedvirtual

Hook method inherited from BLayoutItem, classes derived from BLayout must include the BLayout version of this method in their implementation.

Parameters
layoutThe BLayout that this BLayout was detached from.
Since
Haiku R1

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout.

◆ DisableLayoutInvalidation()

void BLayout::DisableLayoutInvalidation ( )

Disable layout invalidation notifications, i.e. calls to this object's InvalidateLayout() method.

Since
Haiku R1

◆ DoLayout()

void BLayout::DoLayout ( )
protectedpure virtual

Implemented by derived classes to position and resize the items in this layout.

Since
Haiku R1

Implemented in BCardLayout, and BTwoDimensionalLayout.

◆ EnableLayoutInvalidation()

void BLayout::EnableLayoutInvalidation ( )

Re-enable layout invalidation after a call to DisableLayoutInvalidation().

Since
Haiku R1

◆ IndexOfItem()

int32 BLayout::IndexOfItem ( const BLayoutItem item) const

Get the index of a BLayoutItem in this layout.

Parameters
itemThe BLayoutItem whose index you want.
Return values
-1item was not found in this BLayout.
Since
Haiku R1

◆ IndexOfView()

int32 BLayout::IndexOfView ( BView child) const

Get the index of child in this layout.

Note
This finds the index of views added through BLayout::AddView(), not the index of an item which represents child that was added through BLayout::AddItem().
Since
Haiku R1

◆ InvalidateLayout()

void BLayout::InvalidateLayout ( bool  children = false)
virtual

Invalidate this layout and any cached data this layout has relating to positioning and sizing of its items.

Invalidating a BLayout also invalidates the view it is connected to (if there is one) and the BLayout this layout (or this BLayout's view) resides in.

Although this method is virtual, you should not override it, override the BLayout::LayoutInvalidated() hook instead.

This method should be called whenever the layout becomes invalid. This might happen if the size constraints of an item in this layout change, this layout is given more or less space than it previously had, or an object in this layout has had its InvalidateLayout() method called.

See also
BView::InvalidateLayout(), BLayoutItem::InvalidateLayout(), BLayout::LayoutInvalidated()
Since
Haiku R1

Reimplemented from BLayoutItem.

◆ IsValid()

bool BLayout::IsValid ( )

Returns whether this layout has been invalidated (via BLayout::InvalidateLayout()) and has not yet been validated (by doing a layout, or by its ResetLayoutInvalidation() method.

Since
Haiku R1

◆ ItemAdded()

bool BLayout::ItemAdded ( BLayoutItem item,
int32  atIndex 
)
protectedvirtual

Hook method called when item is added to this layout.

Parameters
itemThe BLayoutItem that is being added.
atIndexThe index of the BLayoutItem.
Returns
true on succcess, false if item will not be added.
Note
This is a good time to allocate data for a BLayoutItem and attach it to item via BLayoutItem::SetLayoutData().
Since
Haiku R1

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, and BGroupLayout.

◆ ItemArchived()

status_t BLayout::ItemArchived ( BMessage into,
BLayoutItem item,
int32  index 
) const
protectedvirtual

Hook for derived classes to add data specific to item to the into BMessage. item resides at index.

Note
The same archive is passed to BLayout::ItemArchived() for all items, so any data added for each item will be stored in an array.
Since
Haiku R1

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, BGroupLayout, and BTwoDimensionalLayout.

◆ ItemAt()

BLayoutItem * BLayout::ItemAt ( int32  index) const

Get the BLayoutItem at index. Returns NULL if index is out of bounds.

Since
Haiku R1

◆ ItemRemoved()

void BLayout::ItemRemoved ( BLayoutItem item,
int32  fromIndex 
)
protectedvirtual

Hook method called when item is removed from this layout.

Parameters
itemThe BLayoutItem being removed.
fromIndexThe index where item used to reside.

When this hook is called, item is not yet completely removed. It can no longer be accessed with LayoutItemAt(), nor does it contribute to the value of CountItems(), but the item has not yet had its ItemDetached() hook called.

Note
This is a good time to delete the data you've attached to item via BLayoutItem::SetLayoutData().
Since
Haiku R1

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, and BGroupLayout.

◆ ItemUnarchived()

status_t BLayout::ItemUnarchived ( const BMessage from,
BLayoutItem item,
int32  index 
)
protectedvirtual

Hook for derived classes to retrieve data specific to item from the from BMessage. item resides at index.

Note
The same archive is passed to BLayout::ItemArchived() for all items, so any data added for each item will be stored in an array. You should pass index to the BMessage methods you will be using in this method.
Since
Haiku R1

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, BGroupLayout, and BTwoDimensionalLayout.

◆ LayoutArea()

BRect BLayout::LayoutArea ( )

Returns the on-screen area this layout has received to lay out its items in.

The return value is in the coordinate space of this BLayout's target view. If this BLayout is attached directly to a BView, then LayoutArea().LeftTop() == B_ORIGIN .

Since
Haiku R1

◆ LayoutContext()

BLayoutContext * BLayout::LayoutContext ( ) const

Returns the BLayoutContext this BLayout is currently operating in, or NULL.

Since
Haiku R1

◆ LayoutInvalidated()

void BLayout::LayoutInvalidated ( bool  children)
protectedvirtual

Hook method called when this layout becomes invalid. This is a good place to clear any caches your object might hold.

Parameters
childrenWhether or not child layouts have also been invalidated.
Since
Haiku R1

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout, BCardLayout, and BTwoDimensionalLayout.

◆ LayoutItems()

void BLayout::LayoutItems ( bool  force = false)

If there is no layout currently ongoing, and force is false, creates a new BLayoutContext and calls the DoLayout() method of this BLayout and any BLayout's nested in this BLayout.

This method also guarantees that the owner view of this layout (as returned by BLayout::Owner()) performs a layout as well (if it is suitable to do so).

Parameters
forceForce the LayoutItems.
Since
Haiku R1

◆ Owner()

BView * BLayout::Owner ( ) const

Returns the Owner of this layout, i.e. the view this layout manages.

Since
Haiku R1

Referenced by BLayoutBuilder::Cards< ParentBuilder >::Cards(), BLayoutBuilder::Grid< ParentBuilder >::Grid(), and BLayoutBuilder::Group< ParentBuilder >::Group().

◆ OwnerChanged()

void BLayout::OwnerChanged ( BView was)
protectedvirtual

Hook method called when this layout is attached to a BView.

Parameters
wasThe previous owner of this BLayout, for new BLayout s, this will be NULL.
Since
Haiku R1

Reimplemented in BAbstractLayout.

◆ Perform()

virtual status_t BLayout::Perform ( perform_code  d,
void *  arg 
)
virtual

Perform some action (Internal method defined for binary compatibility purposes).

Reimplemented from BLayoutItem.

Reimplemented in BAbstractLayout, BCardLayout, BGridLayout, BGroupLayout, and BTwoDimensionalLayout.

◆ Relayout()

void BLayout::Relayout ( bool  immediate = false)
virtual

Request this BLayout to reposition and resize its items as required.

If immediate is false, and there is already a request to have the window this layout resides in re-laid-out, then the layout will happen at that time. If immediate is true, and there is no such pending request, nor is this BLayout's parent layout in the process of laying out its items, then this BLayout will now layout its items.

Parameters
immediateWhether or not to Relayout immediately or wait for pending requests first.
Since
Haiku R1

Reimplemented from BLayoutItem.

◆ RemoveItem() [1/2]

bool BLayout::RemoveItem ( BLayoutItem item)
virtual

Removes a BLayoutItem from this layout, and also removes the view it represents from this BLayout's target view.

Parameters
itemThe BLayoutItem to be removed
Warning
item is not deleted, you must delete it manually, or add it to another BLayout.
item->View(), even when it is removed from the target view, is not deleted. If you want it deleted, you must delete it yourself!
Returns
true if the item was removed, false otherwise.
Since
Haiku R1

◆ RemoveItem() [2/2]

BLayoutItem * BLayout::RemoveItem ( int32  index)
virtual

Remove the BLayoutItem at index.

See also
RemoveItem(BLayoutItem*)
Returns
The BLayoutItem that was removed.
Since
Haiku R1

◆ RemoveView()

bool BLayout::RemoveView ( BView child)
virtual

Removes and deletes all BLayoutItem representing a BView from this layout.

Parameters
childThe BView to be removed.
Returns
true if the item was removed, false otherwise.
Since
Haiku R1

◆ RequireLayout()

void BLayout::RequireLayout ( )

Flag this layout as stale, i.e. any cached data may still be valid, but the items need to be repositioned or resized.

Since
Haiku R1

◆ ResetLayoutInvalidation()

void BLayout::ResetLayoutInvalidation ( )
protected

Reset layout invalidation, causing InvalidateLayout calls to proceed again. This method should be called once any cached data has been validated, or updated to valid values.

Since
Haiku R1

◆ TargetView()

BView * BLayout::TargetView ( ) const

Returns the target view of this layout.

The target view of a layout becomes the parent of any BView's in this layout, as well as the BView's returned by BLayoutItem::View() for each BLayoutItem in this layout.

Since
Haiku R1

◆ View()

BView * BLayout::View ( )
virtual

Returns the same BView* as BLayout::Owner(), this method is inherited from BLayoutItem.

Since
Haiku R1

Reimplemented from BLayoutItem.

◆ VisibilityChanged()

void BLayout::VisibilityChanged ( bool  show)
protected

Method to be called by derived classes in their SetVisible() implementation. Calls AncestorVisibilityChanged() on the items in this BLayout.

Parameters
showtrue to show, false to hide.
Since
Haiku R1