]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes for status bar positioning with non-top aligned toolbars
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Oct 2006 13:42:01 +0000 (13:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Oct 2006 13:42:01 +0000 (13:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/frame.cpp

index c93bb168a18da757b1aafab4434ca26789b8a4fe..4cba8083e1ed0771f259fe42d643d0f0e1a1d7be 100644 (file)
@@ -357,9 +357,32 @@ void wxFrame::PositionStatusBar()
     int sw, sh;
     m_frameStatusBar->GetSize(&sw, &sh);
 
+    int x = 0;
+#if wxUSE_TOOLBAR
+    wxToolBar * const toolbar = GetToolBar();
+    if ( toolbar && !toolbar->HasFlag(wxTB_TOP) )
+    {
+        const wxSize sizeTB = toolbar->GetSize();
+
+        if ( toolbar->HasFlag(wxTB_LEFT | wxTB_RIGHT) )
+        {
+            if ( toolbar->HasFlag(wxTB_LEFT) )
+                x -= sizeTB.x;
+
+            w += sizeTB.x;
+        }
+        else // wxTB_BOTTOM
+        {
+            // we need to position the status bar below the toolbar
+            h += sizeTB.y;
+        }
+    }
+    //else: no adjustments necessary for the toolbar on top
+#endif // wxUSE_TOOLBAR
+
     // Since we wish the status bar to be directly under the client area,
     // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
-    m_frameStatusBar->SetSize(0, h, w, sh);
+    m_frameStatusBar->SetSize(x, h, w, sh);
 }
 
 #endif // wxUSE_STATUSBAR