From 5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 21 Apr 2016 13:12:06 -0700 Subject: Remove CFWL_Note. This CL removes the CFWL_Note class. The two subclasses, CFWL_Event and CFWL_Message are distinct types and should not be related by the subclass. The code has been updated to pass the correct types as needed. The various FWL_EVTHASH and FWL_MSGHASH defines have all been removed and turned into an FWL_EventType and FWL_MessageType enum classes. BUG=pdfium:474 Review URL: https://codereview.chromium.org/1901183002 --- xfa/fwl/basewidget/fwl_scrollbarimp.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'xfa/fwl/basewidget/fwl_scrollbarimp.cpp') diff --git a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp index 8812076f6b..fed93fbc07 100644 --- a/xfa/fwl/basewidget/fwl_scrollbarimp.cpp +++ b/xfa/fwl/basewidget/fwl_scrollbarimp.cpp @@ -625,14 +625,17 @@ FX_BOOL CFWL_ScrollBarImp::OnScroll(uint32_t dwCode, FX_FLOAT fPos) { DispatchEvent(&ev); return bRet; } + CFWL_ScrollBarImpDelegate::CFWL_ScrollBarImpDelegate(CFWL_ScrollBarImp* pOwner) : m_pOwner(pOwner) {} + int32_t CFWL_ScrollBarImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { if (!pMessage) return 0; + int32_t iRet = 1; - uint32_t dwMsgCode = pMessage->GetClassID(); - if (dwMsgCode == FWL_MSGHASH_Mouse) { + CFWL_MessageType dwMsgCode = pMessage->GetClassID(); + if (dwMsgCode == CFWL_MessageType::Mouse) { CFWL_MsgMouse* pMsg = static_cast(pMessage); uint32_t dwCmd = pMsg->m_dwCmd; switch (dwCmd) { @@ -652,9 +655,12 @@ int32_t CFWL_ScrollBarImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { OnMouseLeave(); break; } - default: { iRet = 0; } + default: { + iRet = 0; + break; + } } - } else if (dwMsgCode == FWL_MSGHASH_MouseWheel) { + } else if (dwMsgCode == CFWL_MessageType::MouseWheel) { CFWL_MsgMouseWheel* pMsg = static_cast(pMessage); OnMouseWheel(pMsg->m_fx, pMsg->m_fy, pMsg->m_dwFlags, pMsg->m_fDeltaX, pMsg->m_fDeltaY); @@ -663,6 +669,7 @@ int32_t CFWL_ScrollBarImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { } return iRet; } + FWL_ERR CFWL_ScrollBarImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { return m_pOwner->DrawWidget(pGraphics, pMatrix); -- cgit v1.2.3