]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/tbarbase.cpp
more efficient implementation of ToAscii/FromAscii in UTF8 build
[wxWidgets.git] / src / common / tbarbase.cpp
index a8ada3fa9bc144ddf2150fcb57102e6934c69345..1e427b825fdd8ccf2f63001adfc02c3522c5f235 100644 (file)
@@ -628,13 +628,19 @@ void wxToolBarBase::OnMouseEnter(int id)
     event.SetInt(id);
 
     wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
-    if( frame )
+    if ( frame )
     {
         wxString help;
-        wxToolBarToolBase* tool = id == wxID_ANY ? (wxToolBarToolBase*)NULL : FindById(id);
-        if(tool)
-            help = tool->GetLongHelp();
-        frame->DoGiveHelp( help, id != wxID_ANY );
+        if ( id != wxID_ANY )
+        {
+           const wxToolBarToolBase * const tool = FindById(id);
+           if ( tool )
+               help = tool->GetLongHelp();
+        }
+
+        // call DoGiveHelp() even if help string is empty to avoid showing the
+        // help for the previously selected tool when another one is selected
+        frame->DoGiveHelp(help, id != wxID_ANY);
     }
 
     (void)GetEventHandler()->ProcessEvent(event);