BOOL CPropertyBrowser::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
// Check whether the current mouse position is on a control. Add by hsl 2018/5/24
// if (m_bScrolling)
// {
// return TRUE;
// }
// m_bSrolling = TRUE;
for (int i = 0; i < m_arPropCtrls.GetSize(); i++)
{
CRect rect;
CWnd * pCtrl = m_arPropCtrls.GetAt(i)->GetControl(NULL);
CComboBox* pCmbox = dynamic_cast<CComboBox*>(pCtrl);
if (pCmbox )
{
if(pCmbox->GetDroppedState())
pCmbox->GetDroppedControlRect(rect);
}
else
{
pCtrl->GetWindowRect(rect);
}
if (pt.x > rect.left &&
pt.x < rect.right &&
pt.y < rect.bottom &&
pt.y > rect.top)
{
LRESULT lResult = pCtrl->SendMessage(WM_MOUSEWHEEL, MAKEWPARAM(nFlags, zDelta), MAKELPARAM(pt.x, pt.y));
if (lResult)
{
m_bScrolling = FALSE;
return TRUE;
}
}
}
return __super::OnMouseWheel(nFlags, zDelta, pt);
}
{
// Check whether the current mouse position is on a control. Add by hsl 2018/5/24
// if (m_bScrolling)
// {
// return TRUE;
// }
// m_bSrolling = TRUE;
for (int i = 0; i < m_arPropCtrls.GetSize(); i++)
{
CRect rect;
CWnd * pCtrl = m_arPropCtrls.GetAt(i)->GetControl(NULL);
CComboBox* pCmbox = dynamic_cast<CComboBox*>(pCtrl);
if (pCmbox )
{
if(pCmbox->GetDroppedState())
pCmbox->GetDroppedControlRect(rect);
}
else
{
pCtrl->GetWindowRect(rect);
}
if (pt.x > rect.left &&
pt.x < rect.right &&
pt.y < rect.bottom &&
pt.y > rect.top)
{
LRESULT lResult = pCtrl->SendMessage(WM_MOUSEWHEEL, MAKEWPARAM(nFlags, zDelta), MAKELPARAM(pt.x, pt.y));
if (lResult)
{
m_bScrolling = FALSE;
return TRUE;
}
}
}
return __super::OnMouseWheel(nFlags, zDelta, pt);
}