History log of /haiku/src/kits/interface/LayoutItem.cpp
Revision Date Author Comments
# e837ee8b 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BView: Fix destruction order of layout items.

Because of the virtual hooks a BLayout must never be destroyed while it
still has layout items. If these items are only removed from the layout
in its destructor, the subclass version of hooks like ItemRemoved() are
not called anymore. This lead to leaks because many BLayout subclasses
use the ItemRemoved() hook to clean up associated data (as is suggested
explicitly in the BLayout documentation).

In the same line of thought, a BLayoutItem must never be deleted when it
is still attached to a layout, as it similarly has virtual hooks like
DetachedFromLayout() that can not be called at this point anymore.

The destructors of BLayout and BLayoutItem now have debugger calls in
case these conditions are not met which should help to avoid
accidentally introducing such hard to debug issues.

To ensure the correct destruction order the sequence is now:

* Destroy the child views first. This cleans up their layout items while
the layout tree is still intact.
* Unset the view layout before removing layout items so it can properly
detach from the layout instead of just deleting it.


# 0cc8c71b 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

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.


# 4656e550 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added method SetExplicitSize() for convenience.


# 8151838e 02-Nov-2011 Alex Wilson <yourpalal2@gmail.com>

Add FBC padding to all (I think..) of the visible Layout related classes.


# a851b3ad 31-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Add Perform() methods to all the layout-related classes that needed them.


# c74faed4 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Add BLayoutItem::LayoutInvalidated() hook. Leave BLayoutItem::InvalidateLayout() (and therefore BLayout::InvalidateLayout()) virtual. This is needed to let BLayout override it for invalidation propagations.


# 449f014b 16-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Fix typo in BLayoutItem::SetLayout() which led to passing the wrong layout to the DetachedFromLayout() hook.


# cc1ca167 09-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Fix a memory leak I introduced with my modification of BLayout::RemoveItem() and add comments so that it doesn't happen again. Also resolve some TODOs on the appropriate timing of calls to hook methods in BLayoutItem/BLayout.


# fa01d084 08-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

User BView's layout item tracking functionality to simplify and optimize some methods in BLayout and BView.
Delete BLayout::RemoveViewRecursive() as it is no longer needed.
Add a few TODO's.


# bd97b9ad 07-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a BObjectList<BLayoutItem> to BView::fLayoutData that keeps track of any BLayoutItems that refer to this view that are part of a layout. BLayoutItem does the registering/deregistering of the items, and BView::Private proxies fLayoutData for us. Currently, this is not used anywhere, but there are many places where it will be used soon.


# 1d6c7b6c 17-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Big change deriving BLayout from BLayoutItem, and allowing viewless BLayouts.
a few highlights:
* BLayout now derives publicly from BLayoutItem
* Added BAbstractLayout class, which our layouts now derive from
* updated layout builders to avoid creating views when they don't need to
* updated layout classes
* updated AboutSystem to fix a little regression
* more details on #6407
* please tell me about any regressions, I've tried to find them all, but some
may have slipped by.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38207 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27d84b48 08-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by Alex Wilson as part of GSoC 2010 : Archiving of Layouted BViews hierarchy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37433 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ecf9d1c 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e837ee8bc6de62d1b98dfe2a3097f4f740dd98b4 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

BView: Fix destruction order of layout items.

Because of the virtual hooks a BLayout must never be destroyed while it
still has layout items. If these items are only removed from the layout
in its destructor, the subclass version of hooks like ItemRemoved() are
not called anymore. This lead to leaks because many BLayout subclasses
use the ItemRemoved() hook to clean up associated data (as is suggested
explicitly in the BLayout documentation).

In the same line of thought, a BLayoutItem must never be deleted when it
is still attached to a layout, as it similarly has virtual hooks like
DetachedFromLayout() that can not be called at this point anymore.

The destructors of BLayout and BLayoutItem now have debugger calls in
case these conditions are not met which should help to avoid
accidentally introducing such hard to debug issues.

To ensure the correct destruction order the sequence is now:

* Destroy the child views first. This cleans up their layout items while
the layout tree is still intact.
* Unset the view layout before removing layout items so it can properly
detach from the layout instead of just deleting it.


# 0cc8c71bba30edfa1923bc528f541adc5d74f55b 14-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

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.


# 4656e550b0998dae6450e63a6a37b2f664b03e4d 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added method SetExplicitSize() for convenience.


# 8151838e3892d0a18d89d73e2cc37e1f5d01264d 02-Nov-2011 Alex Wilson <yourpalal2@gmail.com>

Add FBC padding to all (I think..) of the visible Layout related classes.


# a851b3ad543ebaebc18589b959c01ccaaf35202f 31-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Add Perform() methods to all the layout-related classes that needed them.


# c74faed432e2f2928cf9bfbad2f20af367724840 22-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Add BLayoutItem::LayoutInvalidated() hook. Leave BLayoutItem::InvalidateLayout() (and therefore BLayout::InvalidateLayout()) virtual. This is needed to let BLayout override it for invalidation propagations.


# 449f014bcc6bd13573a7829fbdd5b997a5cd7065 16-Oct-2011 Alex Wilson <yourpalal2@gmail.com>

Fix typo in BLayoutItem::SetLayout() which led to passing the wrong layout to the DetachedFromLayout() hook.


# cc1ca167a4393a08afafab8ab4cca4194cbee56f 09-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Fix a memory leak I introduced with my modification of BLayout::RemoveItem() and add comments so that it doesn't happen again. Also resolve some TODOs on the appropriate timing of calls to hook methods in BLayoutItem/BLayout.


# fa01d084960d9ee5acf5786c5f15c6e956026be8 08-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

User BView's layout item tracking functionality to simplify and optimize some methods in BLayout and BView.
Delete BLayout::RemoveViewRecursive() as it is no longer needed.
Add a few TODO's.


# bd97b9adba41005ca6dafaf0c32f63422ec351b6 07-Sep-2011 Alex Wilson <yourpalal2@gmail.com>

Add a BObjectList<BLayoutItem> to BView::fLayoutData that keeps track of any BLayoutItems that refer to this view that are part of a layout. BLayoutItem does the registering/deregistering of the items, and BView::Private proxies fLayoutData for us. Currently, this is not used anywhere, but there are many places where it will be used soon.


# 1d6c7b6cb6f46c2672074ff137a18833d4dd3041 17-Aug-2010 Alex Wilson <yourpalal2@gmail.com>

Big change deriving BLayout from BLayoutItem, and allowing viewless BLayouts.
a few highlights:
* BLayout now derives publicly from BLayoutItem
* Added BAbstractLayout class, which our layouts now derive from
* updated layout builders to avoid creating views when they don't need to
* updated layout classes
* updated AboutSystem to fix a little regression
* more details on #6407
* please tell me about any regressions, I've tried to find them all, but some
may have slipped by.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38207 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 27d84b482cddb07e4dee8ee345d3b9a61000d2ec 08-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Patch by Alex Wilson as part of GSoC 2010 : Archiving of Layouted BViews hierarchy.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37433 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96