X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f27d62bf2f27f3b0b6e5cd608c8308c8bd81a93c..3571e1add4e6ceb45ad88c224c432609f837a8dd:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index badc6724ab..ebf81ecc1f 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -582,25 +582,20 @@ bool wxSizerItem::IsShown() const return m_window->IsShown(); case Item_Sizer: + { // arbitrarily decide that if at least one of our elements is // shown, so are we (this arbitrariness is the reason for // deprecating this function) + for ( wxSizerItemList::compatibility_iterator + node = m_sizer->GetChildren().GetFirst(); + node; + node = node->GetNext() ) { - // 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) + if ( node->GetData()->IsShown() ) return true; - - for ( wxSizerItemList::compatibility_iterator - node = m_sizer->GetChildren().GetFirst(); - node; - node = node->GetNext() ) - { - if ( node->GetData()->IsShown() ) - return true; - } } return false; + } case Item_Spacer: return m_spacer->IsShown(); @@ -2339,7 +2334,7 @@ wxSize wxBoxSizer::CalcMin() // Using the max ratio ensures that the min size is big enough for all // items to have their min size and satisfy the proportions among them. - SizeInMajorDir(m_minSize) += maxMinSizeToProp*m_totalProportion; + SizeInMajorDir(m_minSize) += (int)(maxMinSizeToProp*m_totalProportion); return m_minSize; }