Don't show empty sizers.

Revert the change of r44514 and do hide the empty sizers. Code relying on them
being shown/positioned should use wxRESERVE_SPACE_EVEN_IF_HIDDEN flag but
assuming it by default results in completely unexpected layouts, e.g. still
using margins around a sizer with hidden window if it contains an empty
sub-sizer.

Closes #11426.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-07-24 12:27:34 +00:00
parent 5bdeabafbe
commit cbc751bc56

View File

@@ -585,12 +585,6 @@ bool wxSizerItem::IsShown() const
// arbitrarily decide that if at least one of our elements is // arbitrarily decide that if at least one of our elements is
// shown, so are we (this arbitrariness is the reason for // shown, so are we (this arbitrariness is the reason for
// deprecating this function) // deprecating this function)
{
// Some apps (such as dialog editors) depend on an empty sizer still
// being laid out correctly and reporting the correct size and position.
if (m_sizer->GetChildren().GetCount() == 0)
return true;
for ( wxSizerItemList::compatibility_iterator for ( wxSizerItemList::compatibility_iterator
node = m_sizer->GetChildren().GetFirst(); node = m_sizer->GetChildren().GetFirst();
node; node;
@@ -599,7 +593,6 @@ bool wxSizerItem::IsShown() const
if ( node->GetData()->IsShown() ) if ( node->GetData()->IsShown() )
return true; return true;
} }
}
return false; return false;
case Item_Spacer: case Item_Spacer: