// 禁用控件 CControlBase * CDlgPopup::SetControlDisable(CControlBase *pControlBase, BOOL bDisable) { if(pControlBase) { pControlBase->SetDisable(bDisable); UpdateHover(); } return pControlBase; }
// 显示控件 CControlBase * CDlgPopup::SetControlVisible(CControlBase *pControlBase, BOOL bVisible) { if(pControlBase) { pControlBase->SetVisible(bVisible); UpdateHover(); } return pControlBase; }
// 移动控件 CControlBase * CDlgPopup::SetControlRect(CControlBase *pControlBase, CRect rc) { if(pControlBase) { pControlBase->SetRect(rc); UpdateHover(); } return pControlBase; }
// 禁用控件 CControlBase * CDlgPopup::SetControlDisable(UINT uControlID, BOOL bDisable) { CControlBase *pControlBase = GetControl(uControlID); if(pControlBase) { pControlBase->SetDisable(bDisable); UpdateHover(); } return pControlBase; }
// 移动控件 CControlBase * CDlgPopup::SetControlRect(UINT uControlID, CRect rc) { CControlBase *pControlBase = GetControl(uControlID); if(pControlBase) { pControlBase->SetRect(rc); UpdateHover(); } return pControlBase; }
void QuickWidgetHoverBlend::OnTimeOut(OpTimer* timer) { OP_ASSERT(timer == &m_timer); double time_now = g_op_time_info->GetRuntimeMS(); // hover effect if (m_hover_start_time) { double elapsed = time_now - m_hover_start_time; int step = (int)(elapsed * 100 / QUICK_HOVER_BLEND_TOTAL); if (step <= 0) return; m_hover_start_time = time_now; // blend out if (!m_is_hovering) { m_hover_counter -= step; if (m_hover_counter <= 0) { m_hover_counter = 0; m_hover_start_time = 0; } } // blend in else { m_hover_counter += step; if (m_hover_counter >= 100) { m_hover_counter = 100; m_hover_start_time = 0; } } UpdateHover(); if(m_hover_counter != 0 && m_hover_counter != 100) timer->Start(m_timer_delay); } }