FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg, IFWL_Widget* pMessageForm) { CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); if (!pWidgetMgr) return FALSE; IFWL_Widget* pTarget = NULL; if (m_pGrab) pTarget = m_pGrab; if (!pTarget) { pTarget = pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy); while (pTarget && pTarget->GetClassID() == FWL_CLASSHASH_Grid) { pTarget = pTarget->GetParent(); } } if (pTarget) { if (pMessageForm != pTarget) { pMessageForm->TransformTo(pTarget, pMsg->m_fx, pMsg->m_fy); } } if (!pTarget) return FALSE; pMsg->m_pDstTarget = pTarget; return TRUE; }
FX_BOOL CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg, IFWL_Widget* pMessageForm) { CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); if (!pWidgetMgr) return FALSE; IFWL_Widget* pDst = pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy); if (!pDst) return FALSE; while (pDst && pDst->GetClassID() == FWL_CLASSHASH_Grid) { pDst = pDst->GetParent(); } pMessageForm->TransformTo(pDst, pMsg->m_fx, pMsg->m_fy); pMsg->m_pDstTarget = pDst; return TRUE; }