]> git.saurik.com Git - wxWidgets.git/commitdiff
More tooltip handling
authorDavid Webster <Dave.Webster@bhmi.com>
Wed, 10 Jul 2002 05:47:43 +0000 (05:47 +0000)
committerDavid Webster <Dave.Webster@bhmi.com>
Wed, 10 Jul 2002 05:47:43 +0000 (05:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/timer.cpp
src/os2/toolbar.cpp
src/os2/tooltip.cpp

index 1bd868202c5bc3674f889075813b9beddf967f60..292dfbb1f9f22a8fa7b8ce796af4ef9e848c5c47 100644 (file)
@@ -89,8 +89,8 @@ bool wxTimer::Start(
     // Create a windowless timer
     //
     m_ulId = ::WinStartTimer( m_Hab
-                             ,NULL
-                             ,(m_ulId ? m_ulId : 1L)
+                             ,NULLHANDLE
+                             ,0
                              ,(ULONG)nMilliseconds
                             );
     if (m_ulId > 0L)
@@ -115,7 +115,6 @@ void wxTimer::Stop()
         ::WinStopTimer(m_Hab, NULL, m_ulId);
         wxTimerList.DeleteObject(this);
     }
-    m_ulId = 0L;
 }
 
 // ----------------------------------------------------------------------------
index 0d2812a206cb67c7246330d07fe8283a192e4908..a64272e0ab4129386d393612881ed35c95dcadc6 100644 (file)
@@ -928,11 +928,6 @@ void wxToolBar::OnMouseEvent(
     if (!pTool)
     {
         m_vToolTimer.Stop();
-        if (m_pToolTip)
-        {
-            delete m_pToolTip;
-            m_pToolTip = NULL;
-        }
         if (m_nCurrentTool > -1)
         {
             if (rEvent.LeftIsDown())
@@ -976,6 +971,8 @@ void wxToolBar::OnMouseEvent(
             OnMouseEnter(m_nCurrentTool);
             if (!pTool->GetShortHelp().IsEmpty())
             {
+                if (m_pToolTip)
+                    delete m_pToolTip;
                 m_pToolTip = new wxToolTip(pTool->GetShortHelp());
                 m_vXMouse = (wxCoord)vPoint.x;
                 m_vYMouse = (wxCoord)vPoint.y;
@@ -1449,11 +1446,14 @@ void wxToolBar::OnTimer (
                                         );
 
         m_pToolTip->DisplayToolTipWindow(vPos);
+        m_vToolTimer.Stop();
         m_vToolExpTimer.Start(3000L, TRUE);
     }
     else if (rEvent.GetId() == (int)m_vToolExpTimer.GetTimerId())
     {
         m_pToolTip->HideToolTipWindow();
+        GetParent()->Refresh();
+        m_vToolExpTimer.Stop();
     }
 } // end of wxToolBar::OnTimer
 
index 90254e24821cff9377068628fc8a545aff173fef..38d58abce4ab8c6ede411b4d19d832edc253ab6e 100644 (file)
@@ -81,7 +81,7 @@ void wxToolTip::Create(
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
-    strcpy(zFont, "10.Helv");
+    strcpy(zFont, "8.Helv");
     ::WinSetPresParam( m_hWnd
                       ,PP_FONTNAMESIZE
                       ,strlen(zFont) + 1
@@ -125,7 +125,7 @@ void wxToolTip::SetTip(
 
     ::WinQueryWindowPos(m_hWnd, &vSwp);
     m_sText = rsTip;
-    lWidth = rsTip.Length() * 13;
+    lWidth = rsTip.Length() * 8;
     lHeight = 15;
     ::WinSetWindowPos( m_hWnd
                       ,HWND_TOP