BLayoutItem: Add RemoveSelf() convenience method.
It works analoguous to BView::RemoveSelf(), i.e. it removes itself from the parent (layout in this case) and returns whether or not it had and was successfully removed from said parent.
This commit is contained in:
parent
19bb9ef937
commit
0cc8c71bba
@ -23,6 +23,7 @@ public:
|
|||||||
virtual ~BLayoutItem();
|
virtual ~BLayoutItem();
|
||||||
|
|
||||||
BLayout* Layout() const;
|
BLayout* Layout() const;
|
||||||
|
bool RemoveSelf();
|
||||||
|
|
||||||
virtual BSize MinSize() = 0;
|
virtual BSize MinSize() = 0;
|
||||||
virtual BSize MaxSize() = 0;
|
virtual BSize MaxSize() = 0;
|
||||||
|
@ -47,6 +47,13 @@ BLayoutItem::Layout() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
BLayoutItem::RemoveSelf()
|
||||||
|
{
|
||||||
|
return Layout() != NULL && Layout()->RemoveItem(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BLayoutItem::SetExplicitSize(BSize size)
|
BLayoutItem::SetExplicitSize(BSize size)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user