From b4c61ec4753e91b99249d7bd3bbdea4d687b33d9 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 27 Mar 2007 13:41:12 +0000 Subject: [PATCH] Need an extra pixel or best size is incorrect when we have a divider (apparent with e.g. wxAUI) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45091 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/tbar95.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 5e4d811bf0..a276d1834c 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -362,6 +362,9 @@ wxSize wxToolBar::DoGetBestSize() const sizeBest.y = size.cy; } + if (!IsVertical() && !(GetWindowStyle() & wxTB_NODIVIDER)) + sizeBest.y += 1; + CacheBestSize(sizeBest); return sizeBest; @@ -1073,7 +1076,7 @@ bool wxToolBar::Realize() { // if not set yet, have one column m_maxRows = 1; - SetRows(m_nButtons); + SetRows(m_nButtons); } InvalidateBestSize(); @@ -1340,7 +1343,7 @@ void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) tool->SetNormalBitmap(bitmap); Realize(); - } + } } void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) @@ -1352,7 +1355,7 @@ void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) tool->SetDisabledBitmap(bitmap); Realize(); - } + } } // ----------------------------------------------------------------------------