OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/app/xfa_fffield.h" | 7 #include "xfa/fxfa/app/xfa_fffield.h" |
8 | 8 |
9 #include "xfa/fwl/basewidget/ifwl_edit.h" | 9 #include "xfa/fwl/basewidget/ifwl_edit.h" |
10 #include "xfa/fwl/core/cfwl_message.h" | 10 #include "xfa/fwl/core/cfwl_message.h" |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 } | 787 } |
788 FX_BOOL CXFA_FFField::IsDataChanged() { | 788 FX_BOOL CXFA_FFField::IsDataChanged() { |
789 return FALSE; | 789 return FALSE; |
790 } | 790 } |
791 void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) { | 791 void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) { |
792 GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage); | 792 GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage); |
793 } | 793 } |
794 int32_t CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) { | 794 int32_t CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) { |
795 return FWL_ERR_Succeeded; | 795 return FWL_ERR_Succeeded; |
796 } | 796 } |
| 797 |
797 FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { | 798 FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { |
798 uint32_t dwEventID = pEvent->GetClassID(); | 799 switch (pEvent->GetClassID()) { |
799 switch (dwEventID) { | 800 case CFWL_EventType::Mouse: { |
800 case FWL_EVTHASH_Mouse: { | |
801 CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent; | 801 CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent; |
802 if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseEnter) { | 802 if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseEnter) { |
803 CXFA_EventParam eParam; | 803 CXFA_EventParam eParam; |
804 eParam.m_eType = XFA_EVENT_MouseEnter; | 804 eParam.m_eType = XFA_EVENT_MouseEnter; |
805 eParam.m_pTarget = m_pDataAcc; | 805 eParam.m_pTarget = m_pDataAcc; |
806 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter, &eParam); | 806 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter, &eParam); |
807 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseLeave) { | 807 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseLeave) { |
808 CXFA_EventParam eParam; | 808 CXFA_EventParam eParam; |
809 eParam.m_eType = XFA_EVENT_MouseExit; | 809 eParam.m_eType = XFA_EVENT_MouseExit; |
810 eParam.m_pTarget = m_pDataAcc; | 810 eParam.m_pTarget = m_pDataAcc; |
811 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseExit, &eParam); | 811 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseExit, &eParam); |
812 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_LButtonDown) { | 812 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_LButtonDown) { |
813 CXFA_EventParam eParam; | 813 CXFA_EventParam eParam; |
814 eParam.m_eType = XFA_EVENT_MouseDown; | 814 eParam.m_eType = XFA_EVENT_MouseDown; |
815 eParam.m_pTarget = m_pDataAcc; | 815 eParam.m_pTarget = m_pDataAcc; |
816 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseDown, &eParam); | 816 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseDown, &eParam); |
817 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_LButtonUp) { | 817 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_LButtonUp) { |
818 CXFA_EventParam eParam; | 818 CXFA_EventParam eParam; |
819 eParam.m_eType = XFA_EVENT_MouseUp; | 819 eParam.m_eType = XFA_EVENT_MouseUp; |
820 eParam.m_pTarget = m_pDataAcc; | 820 eParam.m_pTarget = m_pDataAcc; |
821 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseUp, &eParam); | 821 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseUp, &eParam); |
822 } | 822 } |
823 break; | 823 break; |
824 } | 824 } |
825 case FWL_EVTHASH_Click: { | 825 case CFWL_EventType::Click: { |
826 CXFA_EventParam eParam; | 826 CXFA_EventParam eParam; |
827 eParam.m_eType = XFA_EVENT_Click; | 827 eParam.m_eType = XFA_EVENT_Click; |
828 eParam.m_pTarget = m_pDataAcc; | 828 eParam.m_pTarget = m_pDataAcc; |
829 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); | 829 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); |
830 break; | 830 break; |
831 } | 831 } |
832 default: {} | 832 default: |
| 833 break; |
833 } | 834 } |
834 return FWL_ERR_Succeeded; | 835 return FWL_ERR_Succeeded; |
835 } | 836 } |
| 837 |
836 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 838 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
837 const CFX_Matrix* pMatrix) { | 839 const CFX_Matrix* pMatrix) { |
838 return FWL_ERR_Succeeded; | 840 return FWL_ERR_Succeeded; |
839 } | 841 } |
OLD | NEW |