| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), | 74 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), |
| 75 pGS, &mt); | 75 pGS, &mt); |
| 76 } | 76 } |
| 77 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, | 77 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, |
| 78 CFX_Matrix* pMatrix, | 78 CFX_Matrix* pMatrix, |
| 79 uint32_t dwStatus, | 79 uint32_t dwStatus, |
| 80 FX_BOOL bEllipse) { | 80 FX_BOOL bEllipse) { |
| 81 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 81 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 82 return; | 82 return; |
| 83 } | 83 } |
| 84 if ((dwStatus & XFA_WIDGETSTATUS_Highlight) && | 84 if ((dwStatus & XFA_WidgetStatus_Highlight) && |
| 85 m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) { | 85 m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) { |
| 86 CXFA_FFDoc* pDoc = GetDoc(); | 86 CXFA_FFDoc* pDoc = GetDoc(); |
| 87 CFX_Color crHighlight(pDoc->GetDocProvider()->GetHighlightColor(pDoc)); | 87 CFX_Color crHighlight(pDoc->GetDocProvider()->GetHighlightColor(pDoc)); |
| 88 pGS->SetFillColor(&crHighlight); | 88 pGS->SetFillColor(&crHighlight); |
| 89 CFX_Path path; | 89 CFX_Path path; |
| 90 path.Create(); | 90 path.Create(); |
| 91 if (bEllipse) { | 91 if (bEllipse) { |
| 92 path.AddEllipse(m_rtUI); | 92 path.AddEllipse(m_rtUI); |
| 93 } else { | 93 } else { |
| 94 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); | 94 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); |
| 95 } | 95 } |
| 96 pGS->FillPath(&path, FXFILL_WINDING, pMatrix); | 96 pGS->FillPath(&path, FXFILL_WINDING, pMatrix); |
| 97 } | 97 } |
| 98 } | 98 } |
| 99 void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { | 99 void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) { |
| 100 if (m_dwStatus & XFA_WIDGETSTATUS_Focused) { | 100 if (m_dwStatus & XFA_WidgetStatus_Focused) { |
| 101 CFX_Color cr(0xFF000000); | 101 CFX_Color cr(0xFF000000); |
| 102 pGS->SetStrokeColor(&cr); | 102 pGS->SetStrokeColor(&cr); |
| 103 FX_FLOAT DashPattern[2] = {1, 1}; | 103 FX_FLOAT DashPattern[2] = {1, 1}; |
| 104 pGS->SetLineDash(0.0f, DashPattern, 2); | 104 pGS->SetLineDash(0.0f, DashPattern, 2); |
| 105 pGS->SetLineWidth(0, FALSE); | 105 pGS->SetLineWidth(0, FALSE); |
| 106 CFX_Path path; | 106 CFX_Path path; |
| 107 path.Create(); | 107 path.Create(); |
| 108 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); | 108 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); |
| 109 pGS->StrokePath(&path, pMatrix); | 109 pGS->StrokePath(&path, pMatrix); |
| 110 } | 110 } |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 526 |
| 527 FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { | 527 FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { |
| 528 CXFA_FFWidget::OnSetFocus(pOldWidget); | 528 CXFA_FFWidget::OnSetFocus(pOldWidget); |
| 529 if (!m_pNormalWidget) { | 529 if (!m_pNormalWidget) { |
| 530 return FALSE; | 530 return FALSE; |
| 531 } | 531 } |
| 532 CFWL_MsgSetFocus ms; | 532 CFWL_MsgSetFocus ms; |
| 533 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 533 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 534 ms.m_pSrcTarget = NULL; | 534 ms.m_pSrcTarget = NULL; |
| 535 TranslateFWLMessage(&ms); | 535 TranslateFWLMessage(&ms); |
| 536 m_dwStatus |= XFA_WIDGETSTATUS_Focused; | 536 m_dwStatus |= XFA_WidgetStatus_Focused; |
| 537 AddInvalidateRect(); | 537 AddInvalidateRect(); |
| 538 return TRUE; | 538 return TRUE; |
| 539 } | 539 } |
| 540 FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { | 540 FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { |
| 541 if (!m_pNormalWidget) { | 541 if (!m_pNormalWidget) { |
| 542 return CXFA_FFWidget::OnKillFocus(pNewWidget); | 542 return CXFA_FFWidget::OnKillFocus(pNewWidget); |
| 543 } | 543 } |
| 544 CFWL_MsgKillFocus ms; | 544 CFWL_MsgKillFocus ms; |
| 545 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 545 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 546 ms.m_pSrcTarget = NULL; | 546 ms.m_pSrcTarget = NULL; |
| 547 TranslateFWLMessage(&ms); | 547 TranslateFWLMessage(&ms); |
| 548 m_dwStatus &= ~XFA_WIDGETSTATUS_Focused; | 548 m_dwStatus &= ~XFA_WidgetStatus_Focused; |
| 549 AddInvalidateRect(); | 549 AddInvalidateRect(); |
| 550 CXFA_FFWidget::OnKillFocus(pNewWidget); | 550 CXFA_FFWidget::OnKillFocus(pNewWidget); |
| 551 return TRUE; | 551 return TRUE; |
| 552 } | 552 } |
| 553 FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { | 553 FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { |
| 554 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 554 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 555 return FALSE; | 555 return FALSE; |
| 556 } | 556 } |
| 557 CFWL_MsgKey ms; | 557 CFWL_MsgKey ms; |
| 558 ms.m_dwCmd = FWL_KeyCommand::KeyDown; | 558 ms.m_dwCmd = FWL_KeyCommand::KeyDown; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); | 820 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); |
| 821 break; | 821 break; |
| 822 } | 822 } |
| 823 default: | 823 default: |
| 824 break; | 824 break; |
| 825 } | 825 } |
| 826 } | 826 } |
| 827 | 827 |
| 828 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 828 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
| 829 const CFX_Matrix* pMatrix) {} | 829 const CFX_Matrix* pMatrix) {} |
| OLD | NEW |