X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2fb18bf45bcf391a8eb973886072dc67893e9bbe..4ac483ebb295cf318c79ae9078af06daa686f51d:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index a2218c3933..b250c0c048 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -447,7 +447,20 @@ bool wxSizerItem::IsShown() const return m_window->IsShown(); case Item_Sizer: - return m_sizer->IsShown(); + // 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() ) + { + if ( node->GetData()->IsShown() ) + return true; + } + } + return false; case Item_Spacer: return m_spacer->IsShown(); @@ -475,11 +488,6 @@ int wxSizerItem::GetOption() const // wxSizer //--------------------------------------------------------------------------- -wxSizer::wxSizer() -{ - m_isShown = true; -} - wxSizer::~wxSizer() { WX_CLEAR_LIST(wxSizerItemList, m_children); @@ -1324,10 +1332,12 @@ void wxFlexGridSizer::AdjustForFlexDirection() wxArrayInt& array = m_flexDirection == wxVERTICAL ? m_colWidths : m_rowHeights; - const int count = array.GetCount(); + const size_t count = array.GetCount(); // find the largest value in this array - int n, largest = 0; + size_t n; + int largest = 0; + for ( n = 0; n < count; ++n ) { if ( array[n] > largest )