]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
Implement wxRendererMac::DrawItemSelectionRect and move the generic wxTreeCtrl to...
[wxWidgets.git] / src / common / sizer.cpp
index ed390865d604d3471cc6f6b798394d6603deb7bd..3429e7b01f2205751fd54b25bba9f55a55536029 100644 (file)
@@ -27,6 +27,7 @@
     #include "wx/settings.h"
     #include "wx/button.h"
     #include "wx/statbox.h"
+    #include "wx/toplevel.h"
 #endif // WX_PRECOMP
 
 #include "wx/listimpl.cpp"
@@ -275,7 +276,7 @@ wxSize wxSizerItem::CalcMin()
     {
         // Since the size of the window may change during runtime, we
         // should use the current minimal/best size.
-        m_minSize = m_window->GetBestFittingSize();
+        m_minSize = m_window->GetEffectiveMinSize();
     }
 
     return GetMinSizeWithBorder();
@@ -353,6 +354,11 @@ void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ )
         size.y -= m_border;
     }
 
+    if (size.x < 0)
+        size.x = 0;
+    if (size.y < 0)
+        size.y = 0;
+
     m_rect = wxRect(pos, size);
 
     switch ( m_kind )