+ Layout();
+}
+
+wxSize wxSizer::GetMinSize()
+{
+ wxSize ret( CalcMin() );
+ if (ret.x < m_minSize.x) ret.x = m_minSize.x;
+ if (ret.y < m_minSize.y) ret.y = m_minSize.y;
+ return ret;
+}
+
+void wxSizer::DoSetMinSize( int width, int height )
+{
+ m_minSize.x = width;
+ m_minSize.y = height;
+}
+
+bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height )
+{
+ wxASSERT_MSG( window, _T("SetMinSize for NULL window") );
+
+ // Is it our immediate child?
+
+ wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if (item->GetWindow() == window)
+ {
+ item->SetInitSize( width, height );
+ return true;
+ }
+ node = node->GetNext();
+ }
+
+ // No? Search any subsizers we own then
+
+ node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if ( item->GetSizer() &&
+ item->GetSizer()->DoSetItemMinSize( window, width, height ) )
+ {
+ // A child sizer found the requested windw, exit.
+ return true;
+ }
+ node = node->GetNext();
+ }
+
+ return false;
+}
+
+bool wxSizer::DoSetItemMinSize( wxSizer *sizer, int width, int height )
+{
+ wxASSERT_MSG( sizer, _T("SetMinSize for NULL sizer") );
+
+ // Is it our immediate child?
+
+ wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if (item->GetSizer() == sizer)
+ {
+ item->GetSizer()->DoSetMinSize( width, height );
+ return true;
+ }
+ node = node->GetNext();
+ }
+
+ // No? Search any subsizers we own then
+
+ node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if ( item->GetSizer() &&
+ item->GetSizer()->DoSetItemMinSize( sizer, width, height ) )
+ {
+ // A child found the requested sizer, exit.
+ return true;
+ }
+ node = node->GetNext();
+ }
+
+ return false;
+}
+
+bool wxSizer::DoSetItemMinSize( size_t index, int width, int height )
+{
+ wxSizerItemList::compatibility_iterator node = m_children.Item( index );
+
+ wxCHECK_MSG( node, false, _T("Failed to find child node") );
+
+ wxSizerItem *item = node->GetData();
+
+ if (item->GetSizer())
+ {
+ // Sizers contains the minimal size in them, if not calculated ...
+ item->GetSizer()->DoSetMinSize( width, height );
+ }
+ else
+ {
+ // ... but the minimal size of spacers and windows in stored in them
+ item->SetInitSize( width, height );
+ }
+
+ return true;
+}
+
+void wxSizer::Show( wxWindow *window, bool show )
+{
+ wxASSERT_MSG( window, _T("Show for NULL window") );
+
+ wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if (item->GetWindow() == window)
+ {
+ item->Show( show );
+ break;
+ }
+ node = node->GetNext();
+ }
+}
+
+void wxSizer::Show( wxSizer *sizer, bool show )
+{
+ wxASSERT_MSG( sizer, _T("Show for NULL sizer") );
+
+ wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if (item->GetSizer() == sizer)
+ {
+ item->Show( show );
+ break;
+ }
+ node = node->GetNext();
+ }
+}
+
+void wxSizer::Show( size_t index, bool show )
+{
+ wxCHECK_RET( index < m_children.GetCount(),
+ _T("Show index is out of range") );
+
+ m_children.Item( index )->GetData()->Show( show );
+}
+
+void wxSizer::ShowItems( bool show )
+{
+ wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ while (node)
+ {
+ node->GetData()->Show( show );
+ node = node->GetNext();
+ }
+}
+
+bool wxSizer::IsShown( wxWindow *window ) const
+{
+ wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if (item->GetWindow() == window)
+ {
+ return item->IsShown();
+ }
+ node = node->GetNext();
+ }
+
+ wxFAIL_MSG( _T("IsShown failed to find sizer item") );
+
+ return false;
+}
+
+bool wxSizer::IsShown( wxSizer *sizer ) const
+{
+ wxSizerItemList::compatibility_iterator node = m_children.GetFirst();
+ while (node)
+ {
+ wxSizerItem *item = node->GetData();
+
+ if (item->GetSizer() == sizer)
+ {
+ return item->IsShown();
+ }
+ node = node->GetNext();
+ }
+
+ wxFAIL_MSG( _T("IsShown failed to find sizer item") );
+
+ return false;
+}
+
+bool wxSizer::IsShown( size_t index ) const
+{
+ wxCHECK_MSG( index < m_children.GetCount(),
+ false,
+ _T("IsShown index is out of range") );
+
+ return m_children.Item( index )->GetData()->IsShown();