X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e76c0b5fc59b06273ebbe9c1d9b2646befd0acd0..e83ecba968c94965523be449a56fffcf4c55010b:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index eb371ebc84..14b0bd80e2 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -507,25 +507,15 @@ void wxToolBarBase::OnMouseEnter(int id) event.SetEventObject(this); event.SetInt(id); - (void)GetEventHandler()->ProcessEvent(event); - wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); - if ( !frame ) - return; - - wxString helpstring; - - if ( id != -1 ) + if( frame ) { - wxToolBarToolBase *tool = FindById(id); - if ( tool ) - helpstring = tool->GetLongHelp(); + wxToolBarToolBase* tool = id == -1 ? (wxToolBarToolBase*)0 : FindById(id); + wxString help = tool ? tool->GetLongHelp() : wxString(); + frame->DoGiveHelp( help, id != -1 ); } - // set the status text anyhow, even if the string is empty: this ensures - // that it is cleared when the mouse leaves the toolbar or enters a tool - // without help - frame->SetStatusText(helpstring); + (void)GetEventHandler()->ProcessEvent(event); } // ----------------------------------------------------------------------------