X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05facebb89314f458099e0297abaa9a1b152c3a9..a536e411022b21280532c9daadc806a437fbb4c6:/src/os2/toolbar.cpp?ds=sidebyside diff --git a/src/os2/toolbar.cpp b/src/os2/toolbar.cpp index 0d2812a206..7975660d48 100644 --- a/src/os2/toolbar.cpp +++ b/src/os2/toolbar.cpp @@ -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,10 +971,12 @@ 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; - m_vToolTimer.Start(3000L, TRUE); + m_vToolTimer.Start(1000L, TRUE); } if (!pTool->IsToggled()) RaiseTool(pTool); @@ -1442,18 +1439,21 @@ void wxToolBar::OnTimer ( wxTimerEvent& rEvent ) { - if (rEvent.GetId() == (int)m_vToolTimer.GetTimerId()) + if (rEvent.GetId() == m_vToolTimer.GetTimerId()) { wxPoint vPos( m_vXMouse ,m_vYMouse ); m_pToolTip->DisplayToolTipWindow(vPos); - m_vToolExpTimer.Start(3000L, TRUE); + m_vToolTimer.Stop(); + m_vToolExpTimer.Start(4000L, TRUE); } - else if (rEvent.GetId() == (int)m_vToolExpTimer.GetTimerId()) + else if (rEvent.GetId() == m_vToolExpTimer.GetTimerId()) { m_pToolTip->HideToolTipWindow(); + GetParent()->Refresh(); + m_vToolExpTimer.Stop(); } } // end of wxToolBar::OnTimer