Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: xfa/fxfa/app/xfa_ffchoicelist.cpp

Issue 2509283003: Unify the three CFWL_EventType::SelectChange classes. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/core/cfwl_combobox.h" 9 #include "xfa/fwl/core/cfwl_combobox.h"
10 #include "xfa/fwl/core/cfwl_evtselectchanged.h"
10 #include "xfa/fwl/core/cfwl_listbox.h" 11 #include "xfa/fwl/core/cfwl_listbox.h"
11 #include "xfa/fwl/core/fwl_noteimp.h" 12 #include "xfa/fwl/core/fwl_noteimp.h"
12 #include "xfa/fwl/core/ifwl_app.h" 13 #include "xfa/fwl/core/ifwl_app.h"
13 #include "xfa/fwl/core/ifwl_edit.h" 14 #include "xfa/fwl/core/ifwl_edit.h"
14 #include "xfa/fxfa/app/xfa_fffield.h" 15 #include "xfa/fxfa/app/xfa_fffield.h"
15 #include "xfa/fxfa/app/xfa_fwladapter.h" 16 #include "xfa/fxfa/app/xfa_fwladapter.h"
16 #include "xfa/fxfa/cxfa_eventparam.h" 17 #include "xfa/fxfa/cxfa_eventparam.h"
17 #include "xfa/fxfa/xfa_ffdoc.h" 18 #include "xfa/fxfa/xfa_ffdoc.h"
18 #include "xfa/fxfa/xfa_ffdocview.h" 19 #include "xfa/fxfa/xfa_ffdocview.h"
19 #include "xfa/fxfa/xfa_ffpageview.h" 20 #include "xfa/fxfa/xfa_ffpageview.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 AddInvalidateRect(); 474 AddInvalidateRect();
474 } 475 }
475 void CXFA_FFComboBox::OnTextChanged(IFWL_Widget* pWidget, 476 void CXFA_FFComboBox::OnTextChanged(IFWL_Widget* pWidget,
476 const CFX_WideString& wsChanged) { 477 const CFX_WideString& wsChanged) {
477 CXFA_EventParam eParam; 478 CXFA_EventParam eParam;
478 m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw); 479 m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw);
479 eParam.m_wsChange = wsChanged; 480 eParam.m_wsChange = wsChanged;
480 FWLEventSelChange(&eParam); 481 FWLEventSelChange(&eParam);
481 } 482 }
482 void CXFA_FFComboBox::OnSelectChanged(IFWL_Widget* pWidget, 483 void CXFA_FFComboBox::OnSelectChanged(IFWL_Widget* pWidget,
483 const CFX_Int32Array& arrSels,
484 bool bLButtonUp) { 484 bool bLButtonUp) {
485 CXFA_EventParam eParam; 485 CXFA_EventParam eParam;
486 m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw); 486 m_pDataAcc->GetValue(eParam.m_wsPrevText, XFA_VALUEPICTURE_Raw);
487 FWLEventSelChange(&eParam); 487 FWLEventSelChange(&eParam);
488 if (m_pDataAcc->GetChoiceListCommitOn() == XFA_ATTRIBUTEENUM_Select && 488 if (m_pDataAcc->GetChoiceListCommitOn() == XFA_ATTRIBUTEENUM_Select &&
489 bLButtonUp) { 489 bLButtonUp) {
490 m_pDocView->SetFocusWidgetAcc(nullptr); 490 m_pDocView->SetFocusWidgetAcc(nullptr);
491 } 491 }
492 } 492 }
493 void CXFA_FFComboBox::OnPreOpen(IFWL_Widget* pWidget) { 493 void CXFA_FFComboBox::OnPreOpen(IFWL_Widget* pWidget) {
(...skipping 10 matching lines...) Expand all
504 } 504 }
505 505
506 void CXFA_FFComboBox::OnProcessMessage(CFWL_Message* pMessage) { 506 void CXFA_FFComboBox::OnProcessMessage(CFWL_Message* pMessage) {
507 m_pOldDelegate->OnProcessMessage(pMessage); 507 m_pOldDelegate->OnProcessMessage(pMessage);
508 } 508 }
509 509
510 void CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) { 510 void CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) {
511 CXFA_FFField::OnProcessEvent(pEvent); 511 CXFA_FFField::OnProcessEvent(pEvent);
512 switch (pEvent->GetClassID()) { 512 switch (pEvent->GetClassID()) {
513 case CFWL_EventType::SelectChanged: { 513 case CFWL_EventType::SelectChanged: {
514 CFWL_EvtCmbSelChanged* postEvent = (CFWL_EvtCmbSelChanged*)pEvent; 514 CFWL_EvtSelectChanged* postEvent =
515 OnSelectChanged(m_pNormalWidget->GetWidget(), postEvent->iArraySels, 515 static_cast<CFWL_EvtSelectChanged*>(pEvent);
516 postEvent->bLButtonUp); 516 OnSelectChanged(m_pNormalWidget->GetWidget(), postEvent->bLButtonUp);
517 break; 517 break;
518 } 518 }
519 case CFWL_EventType::EditChanged: { 519 case CFWL_EventType::EditChanged: {
520 CFX_WideString wsChanged; 520 CFX_WideString wsChanged;
521 OnTextChanged(m_pNormalWidget->GetWidget(), wsChanged); 521 OnTextChanged(m_pNormalWidget->GetWidget(), wsChanged);
522 break; 522 break;
523 } 523 }
524 case CFWL_EventType::PreDropDown: { 524 case CFWL_EventType::PreDropDown: {
525 OnPreOpen(m_pNormalWidget->GetWidget()); 525 OnPreOpen(m_pNormalWidget->GetWidget());
526 break; 526 break;
527 } 527 }
528 case CFWL_EventType::PostDropDown: { 528 case CFWL_EventType::PostDropDown: {
529 OnPostOpen(m_pNormalWidget->GetWidget()); 529 OnPostOpen(m_pNormalWidget->GetWidget());
530 break; 530 break;
531 } 531 }
532 default: 532 default:
533 break; 533 break;
534 } 534 }
535 m_pOldDelegate->OnProcessEvent(pEvent); 535 m_pOldDelegate->OnProcessEvent(pEvent);
536 } 536 }
537 537
538 void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics, 538 void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics,
539 const CFX_Matrix* pMatrix) { 539 const CFX_Matrix* pMatrix) {
540 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix); 540 m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
541 } 541 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698