X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cee14ca0c5e9d4d525172f44bab921323becb962..5268c5a32bbe68b834abeaa89c8cfb2099d50d2e:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index f0f946c192..93d6bbfc3f 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -38,11 +38,6 @@ #include "wx/image.h" #include "wx/settings.h" -// For ::UpdateWindow -#ifdef __WXMSW__ -#include -#endif - #include "wx/tbarbase.h" // ---------------------------------------------------------------------------- @@ -510,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); } // ----------------------------------------------------------------------------