]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
avoid conflict between wxBookCtrlBase::DoSetSelection() and the derived classes;...
[wxWidgets.git] / src / common / sizer.cpp
index 89778aa339e9dc3a441e4cee76bb61f183455874..a691f6431c5af175f8741d922e325819d515c421 100644 (file)
@@ -25,7 +25,9 @@
     #include "wx/math.h"
     #include "wx/utils.h"
     #include "wx/settings.h"
+    #include "wx/button.h"
     #include "wx/statbox.h"
+    #include "wx/toplevel.h"
 #endif // WX_PRECOMP
 
 #include "wx/listimpl.cpp"
@@ -352,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 )
@@ -1694,6 +1701,16 @@ void wxBoxSizer::RecalcSizes()
                 //     wxALIGN_CENTER should be used in new code
                     child_pos.y += (m_size.y - size.y) / 2;
 
+                if ( m_containingWindow )
+                {
+                    child_pos.x = m_containingWindow->AdjustForLayoutDirection
+                                                      (
+                                                        child_pos.x,
+                                                        width,
+                                                        m_size.x
+                                                      );
+                }
+
                 item->SetDimension( child_pos, child_size );
 
                 pt.x += width;