More tooltip handling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -89,8 +89,8 @@ bool wxTimer::Start(
|
|||||||
// Create a windowless timer
|
// Create a windowless timer
|
||||||
//
|
//
|
||||||
m_ulId = ::WinStartTimer( m_Hab
|
m_ulId = ::WinStartTimer( m_Hab
|
||||||
,NULL
|
,NULLHANDLE
|
||||||
,(m_ulId ? m_ulId : 1L)
|
,0
|
||||||
,(ULONG)nMilliseconds
|
,(ULONG)nMilliseconds
|
||||||
);
|
);
|
||||||
if (m_ulId > 0L)
|
if (m_ulId > 0L)
|
||||||
@@ -115,7 +115,6 @@ void wxTimer::Stop()
|
|||||||
::WinStopTimer(m_Hab, NULL, m_ulId);
|
::WinStopTimer(m_Hab, NULL, m_ulId);
|
||||||
wxTimerList.DeleteObject(this);
|
wxTimerList.DeleteObject(this);
|
||||||
}
|
}
|
||||||
m_ulId = 0L;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -928,11 +928,6 @@ void wxToolBar::OnMouseEvent(
|
|||||||
if (!pTool)
|
if (!pTool)
|
||||||
{
|
{
|
||||||
m_vToolTimer.Stop();
|
m_vToolTimer.Stop();
|
||||||
if (m_pToolTip)
|
|
||||||
{
|
|
||||||
delete m_pToolTip;
|
|
||||||
m_pToolTip = NULL;
|
|
||||||
}
|
|
||||||
if (m_nCurrentTool > -1)
|
if (m_nCurrentTool > -1)
|
||||||
{
|
{
|
||||||
if (rEvent.LeftIsDown())
|
if (rEvent.LeftIsDown())
|
||||||
@@ -976,6 +971,8 @@ void wxToolBar::OnMouseEvent(
|
|||||||
OnMouseEnter(m_nCurrentTool);
|
OnMouseEnter(m_nCurrentTool);
|
||||||
if (!pTool->GetShortHelp().IsEmpty())
|
if (!pTool->GetShortHelp().IsEmpty())
|
||||||
{
|
{
|
||||||
|
if (m_pToolTip)
|
||||||
|
delete m_pToolTip;
|
||||||
m_pToolTip = new wxToolTip(pTool->GetShortHelp());
|
m_pToolTip = new wxToolTip(pTool->GetShortHelp());
|
||||||
m_vXMouse = (wxCoord)vPoint.x;
|
m_vXMouse = (wxCoord)vPoint.x;
|
||||||
m_vYMouse = (wxCoord)vPoint.y;
|
m_vYMouse = (wxCoord)vPoint.y;
|
||||||
@@ -1449,11 +1446,14 @@ void wxToolBar::OnTimer (
|
|||||||
);
|
);
|
||||||
|
|
||||||
m_pToolTip->DisplayToolTipWindow(vPos);
|
m_pToolTip->DisplayToolTipWindow(vPos);
|
||||||
|
m_vToolTimer.Stop();
|
||||||
m_vToolExpTimer.Start(3000L, TRUE);
|
m_vToolExpTimer.Start(3000L, TRUE);
|
||||||
}
|
}
|
||||||
else if (rEvent.GetId() == (int)m_vToolExpTimer.GetTimerId())
|
else if (rEvent.GetId() == (int)m_vToolExpTimer.GetTimerId())
|
||||||
{
|
{
|
||||||
m_pToolTip->HideToolTipWindow();
|
m_pToolTip->HideToolTipWindow();
|
||||||
|
GetParent()->Refresh();
|
||||||
|
m_vToolExpTimer.Stop();
|
||||||
}
|
}
|
||||||
} // end of wxToolBar::OnTimer
|
} // end of wxToolBar::OnTimer
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ void wxToolTip::Create(
|
|||||||
,sizeof(LONG)
|
,sizeof(LONG)
|
||||||
,(PVOID)&lColor
|
,(PVOID)&lColor
|
||||||
);
|
);
|
||||||
strcpy(zFont, "10.Helv");
|
strcpy(zFont, "8.Helv");
|
||||||
::WinSetPresParam( m_hWnd
|
::WinSetPresParam( m_hWnd
|
||||||
,PP_FONTNAMESIZE
|
,PP_FONTNAMESIZE
|
||||||
,strlen(zFont) + 1
|
,strlen(zFont) + 1
|
||||||
@@ -125,7 +125,7 @@ void wxToolTip::SetTip(
|
|||||||
|
|
||||||
::WinQueryWindowPos(m_hWnd, &vSwp);
|
::WinQueryWindowPos(m_hWnd, &vSwp);
|
||||||
m_sText = rsTip;
|
m_sText = rsTip;
|
||||||
lWidth = rsTip.Length() * 13;
|
lWidth = rsTip.Length() * 8;
|
||||||
lHeight = 15;
|
lHeight = 15;
|
||||||
::WinSetWindowPos( m_hWnd
|
::WinSetWindowPos( m_hWnd
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
|
Reference in New Issue
Block a user