void CPlayerSeekBar::OnTimer(UINT_PTR nIDEvent) { CPoint point; VERIFY(GetCursorPos(&point)); ScreenToClient(&point); switch (nIDEvent) { case TIMER_SHOWHIDE_TOOLTIP: if (m_tooltipState == TOOLTIP_TRIGGERED && m_bHasDuration) { m_tooltipPoint = point; UpdateToolTipText(); m_tooltip.SendMessage(TTM_TRACKACTIVATE, TRUE, (LPARAM)&m_ti); UpdateToolTipPosition(); m_tooltipState = TOOLTIP_VISIBLE; VERIFY(SetTimer(TIMER_SHOWHIDE_TOOLTIP, TOOLTIP_HIDE_TIMEOUT, nullptr)); } else if (m_tooltipState == TOOLTIP_VISIBLE) { HideToolTip(); ASSERT(!m_bIgnoreLastTooltipPoint); KillTimer(TIMER_SHOWHIDE_TOOLTIP); } else { KillTimer(TIMER_SHOWHIDE_TOOLTIP); } break; case TIMER_HOVER_CAPTURED: if (GetCapture() == this && (!m_bHovered || m_rtHoverPos != m_rtPos)) { m_bHovered = true; m_rtHoverPos = m_rtPos; m_hoverPoint = point; SyncVideoToThumb(); } KillTimer(TIMER_HOVER_CAPTURED); break; default: ASSERT(FALSE); } }
void CPlayerSeekBar::OnLButtonUp(UINT nFlags, CPoint point) { if (DraggingThumb()) { ReleaseCapture(); KillTimer(TIMER_HOVER_CAPTURED); if (!m_bHovered || (!CMouse::PointEqualsImprecise(point.x, m_hoverPoint.x) && m_rtPos != m_rtHoverPos)) { SyncVideoToThumb(); } } }
void CPlayerSeekBar::OnLButtonUp(UINT nFlags, CPoint point) { if (GetCapture() == this) { ReleaseCapture(); KillTimer(TIMER_HOVER_CAPTURED); if (!m_bHovered || (abs(point.x - m_hoverPoint.x) > HOVER_CAPTURED_IGNORE_X_DELTA && m_rtPos != m_rtHoverPos)) { SyncVideoToThumb(); } } }