]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sizer.cpp
Implement left indentation and tab stops support in wxTextCtrl, patch #1518114 -...
[wxWidgets.git] / src / common / sizer.cpp
index 6c536703f1489aaef110d4890a3691b2ef4454a4..a691f6431c5af175f8741d922e325819d515c421 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"
@@ -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 )
@@ -1695,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;