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