| 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_ffchoicelist.h" | 7 #include "xfa/fxfa/app/xfa_ffchoicelist.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/basewidget/ifwl_edit.h" | 9 #include "xfa/fwl/basewidget/ifwl_edit.h" |
| 10 #include "xfa/fwl/core/fwl_noteimp.h" | 10 #include "xfa/fwl/core/fwl_noteimp.h" |
| 11 #include "xfa/fwl/core/ifwl_app.h" | 11 #include "xfa/fwl/core/ifwl_app.h" |
| 12 #include "xfa/fwl/lightwidget/cfwl_combobox.h" | 12 #include "xfa/fwl/lightwidget/cfwl_combobox.h" |
| 13 #include "xfa/fwl/lightwidget/cfwl_listbox.h" | 13 #include "xfa/fwl/lightwidget/cfwl_listbox.h" |
| 14 #include "xfa/fxfa/app/xfa_fffield.h" | 14 #include "xfa/fxfa/app/xfa_fffield.h" |
| 15 #include "xfa/fxfa/app/xfa_fwladapter.h" | 15 #include "xfa/fxfa/app/xfa_fwladapter.h" |
| 16 #include "xfa/fxfa/include/cxfa_eventparam.h" | 16 #include "xfa/fxfa/include/cxfa_eventparam.h" |
| 17 #include "xfa/fxfa/include/xfa_ffdoc.h" | 17 #include "xfa/fxfa/include/xfa_ffdoc.h" |
| 18 #include "xfa/fxfa/include/xfa_ffdocview.h" | 18 #include "xfa/fxfa/include/xfa_ffdocview.h" |
| 19 #include "xfa/fxfa/include/xfa_ffpageview.h" | 19 #include "xfa/fxfa/include/xfa_ffpageview.h" |
| 20 #include "xfa/fxfa/include/xfa_ffwidget.h" | 20 #include "xfa/fxfa/include/xfa_ffwidget.h" |
| 21 | 21 |
| 22 CXFA_FFListBox::CXFA_FFListBox(CXFA_FFPageView* pPageView, | 22 CXFA_FFListBox::CXFA_FFListBox(CXFA_FFPageView* pPageView, |
| 23 CXFA_WidgetAcc* pDataAcc) | 23 CXFA_WidgetAcc* pDataAcc) |
| 24 : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(NULL) {} | 24 : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} |
| 25 CXFA_FFListBox::~CXFA_FFListBox() { | 25 CXFA_FFListBox::~CXFA_FFListBox() { |
| 26 if (m_pNormalWidget) { | 26 if (m_pNormalWidget) { |
| 27 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); | 27 IFWL_Widget* pWidget = m_pNormalWidget->GetWidget(); |
| 28 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); | 28 CFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver(); |
| 29 pNoteDriver->UnregisterEventTarget(pWidget); | 29 pNoteDriver->UnregisterEventTarget(pWidget); |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 FX_BOOL CXFA_FFListBox::LoadWidget() { | 32 FX_BOOL CXFA_FFListBox::LoadWidget() { |
| 33 CFWL_ListBox* pListBox = CFWL_ListBox::Create(); | 33 CFWL_ListBox* pListBox = CFWL_ListBox::Create(); |
| 34 pListBox->Initialize(); | 34 pListBox->Initialize(); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 m_pOldDelegate->OnProcessEvent(pEvent); | 197 m_pOldDelegate->OnProcessEvent(pEvent); |
| 198 } | 198 } |
| 199 void CXFA_FFListBox::OnDrawWidget(CFX_Graphics* pGraphics, | 199 void CXFA_FFListBox::OnDrawWidget(CFX_Graphics* pGraphics, |
| 200 const CFX_Matrix* pMatrix) { | 200 const CFX_Matrix* pMatrix) { |
| 201 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); | 201 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); |
| 202 } | 202 } |
| 203 | 203 |
| 204 CXFA_FFComboBox::CXFA_FFComboBox(CXFA_FFPageView* pPageView, | 204 CXFA_FFComboBox::CXFA_FFComboBox(CXFA_FFPageView* pPageView, |
| 205 CXFA_WidgetAcc* pDataAcc) | 205 CXFA_WidgetAcc* pDataAcc) |
| 206 : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(NULL) {} | 206 : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {} |
| 207 | 207 |
| 208 CXFA_FFComboBox::~CXFA_FFComboBox() {} | 208 CXFA_FFComboBox::~CXFA_FFComboBox() {} |
| 209 | 209 |
| 210 FX_BOOL CXFA_FFComboBox::GetBBox(CFX_RectF& rtBox, | 210 FX_BOOL CXFA_FFComboBox::GetBBox(CFX_RectF& rtBox, |
| 211 uint32_t dwStatus, | 211 uint32_t dwStatus, |
| 212 FX_BOOL bDrawFocus) { | 212 FX_BOOL bDrawFocus) { |
| 213 if (bDrawFocus) | 213 if (bDrawFocus) |
| 214 return FALSE; | 214 return FALSE; |
| 215 return CXFA_FFWidget::GetBBox(rtBox, dwStatus); | 215 return CXFA_FFWidget::GetBBox(rtBox, dwStatus); |
| 216 } | 216 } |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 FWLEventSelChange(&eParam); | 472 FWLEventSelChange(&eParam); |
| 473 } | 473 } |
| 474 void CXFA_FFComboBox::OnSelectChanged(IFWL_Widget* pWidget, | 474 void CXFA_FFComboBox::OnSelectChanged(IFWL_Widget* pWidget, |
| 475 const CFX_Int32Array& arrSels, | 475 const CFX_Int32Array& arrSels, |
| 476 FX_BOOL bLButtonUp) { | 476 FX_BOOL bLButtonUp) { |
| 477 CXFA_EventParam eParam; | 477 CXFA_EventParam eParam; |
| 478 m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw); | 478 m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw); |
| 479 FWLEventSelChange(&eParam); | 479 FWLEventSelChange(&eParam); |
| 480 if (m_pDataAcc->GetChoiceListCommitOn() == XFA_ATTRIBUTEENUM_Select && | 480 if (m_pDataAcc->GetChoiceListCommitOn() == XFA_ATTRIBUTEENUM_Select && |
| 481 bLButtonUp) { | 481 bLButtonUp) { |
| 482 m_pDocView->SetFocusWidgetAcc(NULL); | 482 m_pDocView->SetFocusWidgetAcc(nullptr); |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 void CXFA_FFComboBox::OnPreOpen(IFWL_Widget* pWidget) { | 485 void CXFA_FFComboBox::OnPreOpen(IFWL_Widget* pWidget) { |
| 486 CXFA_EventParam eParam; | 486 CXFA_EventParam eParam; |
| 487 eParam.m_eType = XFA_EVENT_PreOpen; | 487 eParam.m_eType = XFA_EVENT_PreOpen; |
| 488 eParam.m_pTarget = m_pDataAcc; | 488 eParam.m_pTarget = m_pDataAcc; |
| 489 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_PreOpen, &eParam); | 489 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_PreOpen, &eParam); |
| 490 } | 490 } |
| 491 void CXFA_FFComboBox::OnPostOpen(IFWL_Widget* pWidget) { | 491 void CXFA_FFComboBox::OnPostOpen(IFWL_Widget* pWidget) { |
| 492 CXFA_EventParam eParam; | 492 CXFA_EventParam eParam; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 default: | 524 default: |
| 525 break; | 525 break; |
| 526 } | 526 } |
| 527 m_pOldDelegate->OnProcessEvent(pEvent); | 527 m_pOldDelegate->OnProcessEvent(pEvent); |
| 528 } | 528 } |
| 529 | 529 |
| 530 void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics, | 530 void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics, |
| 531 const CFX_Matrix* pMatrix) { | 531 const CFX_Matrix* pMatrix) { |
| 532 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); | 532 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); |
| 533 } | 533 } |
| OLD | NEW |