X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f33d6788d71891f91e392d33971dd93a2d231dbc..81b32ce52247c45d278507ebeb532e2535bbe186:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index a68b275b1a..14b0bd80e2 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -507,26 +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 - if (frame->GetStatusBar()) - frame->SetStatusText(helpstring); + (void)GetEventHandler()->ProcessEvent(event); } // ----------------------------------------------------------------------------