X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0f767c96b244a7b37ac67c6e7e9bff17e50c28a9..235751501d3bb4141424cc08a7d88dd506746d18:/src/msw/tbar95.cpp diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index eae78ec579..f2c24ec171 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -258,7 +258,7 @@ void wxToolBar::Init() m_defaultWidth = DEFAULTBITMAPX; m_defaultHeight = DEFAULTBITMAPY; - m_pInTool = 0; + m_pInTool = NULL; } bool wxToolBar::Create(wxWindow *parent, @@ -400,6 +400,9 @@ wxSize wxToolBar::DoGetBestSize() const sizeBest.y = size.cy; } + if (!IsVertical() && !(GetWindowStyle() & wxTB_NODIVIDER)) + sizeBest.y += 1; + CacheBestSize(sizeBest); return sizeBest; @@ -1452,9 +1455,14 @@ void wxToolBar::OnSysColourChanged(wxSysColourChangedEvent& event) void wxToolBar::OnMouseEvent(wxMouseEvent& event) { - if (event.Leaving() && m_pInTool) + if ( event.Leaving() ) { - OnMouseEnter( -1 ); + if ( m_pInTool ) + { + OnMouseEnter(wxID_ANY); + m_pInTool = NULL; + } + event.Skip(); return; } @@ -1685,18 +1693,11 @@ void wxToolBar::HandleMouseMove(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam) y = GET_Y_LPARAM(lParam); wxToolBarToolBase* tool = FindToolForPosition( x, y ); - // cursor left current tool - if ( tool != m_pInTool && !tool ) - { - m_pInTool = 0; - OnMouseEnter( -1 ); - } - - // cursor entered a tool - if ( tool != m_pInTool && tool ) + // has the current tool changed? + if ( tool != m_pInTool ) { m_pInTool = tool; - OnMouseEnter( tool->GetId() ); + OnMouseEnter(tool ? tool->GetId() : wxID_ANY); } }