From bc4dba6b4c2926e785ca4a486017cbce6da69c36 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 9 Aug 2007 15:09:03 +0000 Subject: [PATCH] Gave toolbars some extra height, Without which DoGetBestSize can report a size that's smaller than the actual window, causing windows to overlap slightly in some circumstances, leading to missing borders. Removed a hack in AUI to adjust for wrongly reported size. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/framemanager.cpp | 7 ++++--- src/msw/tbar95.cpp | 12 ++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 65215f9211..32ce8e43ec 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -524,7 +524,7 @@ wxAuiManager::~wxAuiManager() delete pinfo.window; } #endif - + delete m_art; } @@ -929,7 +929,8 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info) // I believe this to be the correct action, until // wxToolBar::GetBestSize() is fixed. Is this assumption // correct? - pinfo.best_size.y++; + // commented out by JACS 2007-9-08 after having added a pixel in wxMSW's wxToolBar::DoGetBestSize() + // pinfo.best_size.y++; } if (pinfo.min_size != wxDefaultSize) @@ -3566,7 +3567,7 @@ void wxAuiManager::OnRender(wxAuiManagerEvent& evt) // if the frame is about to be deleted, don't bother if (!m_frame || wxPendingDelete.Member(m_frame)) return; - + wxDC* dc = evt.GetDC(); #ifdef __WXMAC__ diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 2bc842c318..aab0385511 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -362,8 +362,16 @@ wxSize wxToolBar::DoGetBestSize() const sizeBest.y = size.cy; } - if (!IsVertical() && !(GetWindowStyle() & wxTB_NODIVIDER)) - sizeBest.y += 1; + if (!IsVertical()) + { + // Without the extra height, DoGetBestSize can report a size that's + // smaller than the actual window, causing windows to overlap slightly + // in some circumstances, leading to missing borders (especially noticeable + // in AUI layouts). + if (!(GetWindowStyle() & wxTB_NODIVIDER)) + sizeBest.y += 2; + sizeBest.y ++; + } CacheBestSize(sizeBest);