m_defaultWidth = DEFAULTBITMAPX;
m_defaultHeight = DEFAULTBITMAPY;
- m_pInTool = 0;
+ m_pInTool = NULL;
}
bool wxToolBar::Create(wxWindow *parent,
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;
}
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);
}
}