clear the frame statusbar when the mouse leaves the toolbar or enters a tool without help string

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-03-17 13:58:15 +00:00
parent 45647dcf10
commit 66ce9e0609

View File

@@ -505,15 +505,23 @@ void wxToolBarBase::OnMouseEnter(int id)
(void)GetEventHandler()->ProcessEvent(event);
wxToolBarToolBase *tool = FindById(id);
if ( !tool || !tool->GetLongHelp() )
return;
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if ( !frame )
return;
frame->SetStatusText(tool->GetLongHelp());
wxString helpstring;
if ( id != -1 )
{
wxToolBarToolBase *tool = FindById(id);
if ( tool )
helpstring = tool->GetLongHelp();
}
// 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);
}
// ----------------------------------------------------------------------------