From 8efbb8ad3005aee070d6e8da5729b50efa02afe5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 31 Oct 2006 13:42:01 +0000 Subject: [PATCH] fixes for status bar positioning with non-top aligned toolbars git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/frame.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index c93bb168a1..4cba8083e1 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -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 -- 2.45.2