From 242b95e2a9df3b57dd9aa28adea58ad51f84a221 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 16 Nov 2016 14:25:01 -0800 Subject: Move the message definitions to their own files. Currently the CFWL messages are created by a macro in the CFWL_Message header file. This Cl splits out the class to their own files and writes them directly instead of using the macro. Review-Url: https://codereview.chromium.org/2510823003 --- xfa/fwl/core/ifwl_comboboxproxy.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'xfa/fwl/core/ifwl_comboboxproxy.cpp') diff --git a/xfa/fwl/core/ifwl_comboboxproxy.cpp b/xfa/fwl/core/ifwl_comboboxproxy.cpp index 4bc1e294d4..03bfca2727 100644 --- a/xfa/fwl/core/ifwl_comboboxproxy.cpp +++ b/xfa/fwl/core/ifwl_comboboxproxy.cpp @@ -6,6 +6,8 @@ #include "xfa/fwl/core/ifwl_comboboxproxy.h" +#include "xfa/fwl/core/cfwl_msgkillfocus.h" +#include "xfa/fwl/core/cfwl_msgmouse.h" #include "xfa/fwl/core/fwl_noteimp.h" #include "xfa/fwl/core/ifwl_app.h" #include "xfa/fwl/core/ifwl_combobox.h" @@ -42,10 +44,10 @@ void IFWL_ComboBoxProxy::OnProcessMessage(CFWL_Message* pMessage) { break; } case CFWL_MessageType::KillFocus: - OnFocusChanged(static_cast(pMessage), false); + OnFocusChanged(pMessage, false); break; case CFWL_MessageType::SetFocus: - OnFocusChanged(static_cast(pMessage), true); + OnFocusChanged(pMessage, true); break; default: break; @@ -58,7 +60,7 @@ void IFWL_ComboBoxProxy::OnDrawWidget(CFX_Graphics* pGraphics, m_pComboBox->DrawStretchHandler(pGraphics, pMatrix); } -void IFWL_ComboBoxProxy::OnLButtonDown(CFWL_MsgMouse* pMsg) { +void IFWL_ComboBoxProxy::OnLButtonDown(CFWL_Message* pMessage) { const IFWL_App* pApp = GetOwnerApp(); if (!pApp) return; @@ -68,6 +70,8 @@ void IFWL_ComboBoxProxy::OnLButtonDown(CFWL_MsgMouse* pMsg) { CFX_RectF rtWidget; GetWidgetRect(rtWidget); rtWidget.left = rtWidget.top = 0; + + CFWL_MsgMouse* pMsg = static_cast(pMessage); if (rtWidget.Contains(pMsg->m_fx, pMsg->m_fy)) { m_bLButtonDown = true; pDriver->SetGrab(this, true); @@ -78,7 +82,7 @@ void IFWL_ComboBoxProxy::OnLButtonDown(CFWL_MsgMouse* pMsg) { } } -void IFWL_ComboBoxProxy::OnLButtonUp(CFWL_MsgMouse* pMsg) { +void IFWL_ComboBoxProxy::OnLButtonUp(CFWL_Message* pMessage) { m_bLButtonDown = false; const IFWL_App* pApp = GetOwnerApp(); if (!pApp) @@ -92,6 +96,7 @@ void IFWL_ComboBoxProxy::OnLButtonUp(CFWL_MsgMouse* pMsg) { return; } + CFWL_MsgMouse* pMsg = static_cast(pMessage); CFX_RectF rect; GetWidgetRect(rect); rect.left = rect.top = 0; @@ -101,9 +106,11 @@ void IFWL_ComboBoxProxy::OnLButtonUp(CFWL_MsgMouse* pMsg) { } } -void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_MsgKillFocus* pMsg, bool bSet) { +void IFWL_ComboBoxProxy::OnFocusChanged(CFWL_Message* pMessage, bool bSet) { if (bSet) return; + + CFWL_MsgKillFocus* pMsg = static_cast(pMessage); if (!pMsg->m_pSetFocus) m_pComboBox->ShowDropList(false); } -- cgit v1.2.3