]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
New WM decoration code. It fails to resize dialogs
[wxWidgets.git] / src / common / tbarbase.cpp
index f0f946c192ea54325325d178620674bfdd43321b..93d6bbfc3f1dad28a521f16a7fc5eec955fb1598 100644 (file)
 #include "wx/image.h"
 #include "wx/settings.h"
 
-// For ::UpdateWindow
-#ifdef __WXMSW__
-#include <windows.h>
-#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);
 }
 
 // ----------------------------------------------------------------------------