| Index: xfa/fxfa/app/cxfa_ffcomboboxdelegate.cpp
|
| diff --git a/xfa/fxfa/app/cxfa_ffcomboboxdelegate.cpp b/xfa/fxfa/app/cxfa_ffcomboboxdelegate.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..da71ac438b38afbe1dae0e7353a501f43a57981c
|
| --- /dev/null
|
| +++ b/xfa/fxfa/app/cxfa_ffcomboboxdelegate.cpp
|
| @@ -0,0 +1,58 @@
|
| +// Copyright 2016 PDFium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
| +
|
| +#include "xfa/fxfa/app/cxfa_ffcomboboxdelegate.h"
|
| +
|
| +#include "xfa/fwl/core/ifwl_combobox.h"
|
| +#include "xfa/fxfa/app/xfa_ffchoicelist.h"
|
| +
|
| +CXFA_FFComboBoxDelegate::CXFA_FFComboBoxDelegate(
|
| + std::unique_ptr<IFWL_WidgetDelegate> pDelegate,
|
| + CXFA_FFComboBox* const pWidget)
|
| + : CXFA_FFFieldDelegate(std::move(pDelegate), pWidget) {}
|
| +
|
| +CXFA_FFComboBoxDelegate::~CXFA_FFComboBoxDelegate() {}
|
| +
|
| +void CXFA_FFComboBoxDelegate::OnProcessMessage(CFWL_Message* pMessage) {
|
| + m_pDelegate->OnProcessMessage(pMessage);
|
| +}
|
| +
|
| +void CXFA_FFComboBoxDelegate::OnProcessEvent(CFWL_Event* pEvent) {
|
| + CXFA_FFFieldDelegate::OnProcessEvent(pEvent);
|
| +
|
| + CXFA_FFComboBox* widget = static_cast<CXFA_FFComboBox*>(m_pWidget);
|
| + CFWL_Widget* pNormalWidget = widget->GetNormalWidget();
|
| +
|
| + switch (pEvent->GetClassID()) {
|
| + case CFWL_EventType::SelectChanged: {
|
| + CFWL_EvtCmbSelChanged* postEvent = (CFWL_EvtCmbSelChanged*)pEvent;
|
| + widget->OnSelectChanged(pNormalWidget->GetWidget(), postEvent->iArraySels,
|
| + postEvent->bLButtonUp);
|
| + break;
|
| + }
|
| + case CFWL_EventType::EditChanged: {
|
| + CFX_WideString wsChanged;
|
| + widget->OnTextChanged(pNormalWidget->GetWidget(), wsChanged);
|
| + break;
|
| + }
|
| + case CFWL_EventType::PreDropDown: {
|
| + widget->OnPreOpen(pNormalWidget->GetWidget());
|
| + break;
|
| + }
|
| + case CFWL_EventType::PostDropDown: {
|
| + widget->OnPostOpen(pNormalWidget->GetWidget());
|
| + break;
|
| + }
|
| + default:
|
| + break;
|
| + }
|
| + m_pDelegate->OnProcessEvent(pEvent);
|
| +}
|
| +
|
| +void CXFA_FFComboBoxDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix) {
|
| + m_pDelegate->OnDrawWidget(pGraphics, pMatrix);
|
| +}
|
|
|