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

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

Issue 2466273003: Change IFWL_Widget to store a single delegate. (Closed)
Patch Set: Fix Mac 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
« no previous file with comments | « xfa/fxfa/app/cxfa_ffcomboboxdelegate.h ('k') | xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "xfa/fxfa/app/cxfa_ffcomboboxdelegate.h"
8
9 #include "xfa/fwl/core/ifwl_combobox.h"
10 #include "xfa/fxfa/app/xfa_ffchoicelist.h"
11
12 CXFA_FFComboBoxDelegate::CXFA_FFComboBoxDelegate(
13 std::unique_ptr<IFWL_WidgetDelegate> pDelegate,
14 CXFA_FFComboBox* const pWidget)
15 : CXFA_FFFieldDelegate(std::move(pDelegate), pWidget) {}
16
17 CXFA_FFComboBoxDelegate::~CXFA_FFComboBoxDelegate() {}
18
19 void CXFA_FFComboBoxDelegate::OnProcessMessage(CFWL_Message* pMessage) {
20 m_pDelegate->OnProcessMessage(pMessage);
21 }
22
23 void CXFA_FFComboBoxDelegate::OnProcessEvent(CFWL_Event* pEvent) {
24 CXFA_FFFieldDelegate::OnProcessEvent(pEvent);
25
26 CXFA_FFComboBox* widget = static_cast<CXFA_FFComboBox*>(m_pWidget);
27 CFWL_Widget* pNormalWidget = widget->GetNormalWidget();
28
29 switch (pEvent->GetClassID()) {
30 case CFWL_EventType::SelectChanged: {
31 CFWL_EvtCmbSelChanged* postEvent = (CFWL_EvtCmbSelChanged*)pEvent;
32 widget->OnSelectChanged(pNormalWidget->GetWidget(), postEvent->iArraySels,
33 postEvent->bLButtonUp);
34 break;
35 }
36 case CFWL_EventType::EditChanged: {
37 CFX_WideString wsChanged;
38 widget->OnTextChanged(pNormalWidget->GetWidget(), wsChanged);
39 break;
40 }
41 case CFWL_EventType::PreDropDown: {
42 widget->OnPreOpen(pNormalWidget->GetWidget());
43 break;
44 }
45 case CFWL_EventType::PostDropDown: {
46 widget->OnPostOpen(pNormalWidget->GetWidget());
47 break;
48 }
49 default:
50 break;
51 }
52 m_pDelegate->OnProcessEvent(pEvent);
53 }
54
55 void CXFA_FFComboBoxDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
56 const CFX_Matrix* pMatrix) {
57 m_pDelegate->OnDrawWidget(pGraphics, pMatrix);
58 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/cxfa_ffcomboboxdelegate.h ('k') | xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698