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

Unified Diff: xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.h ('k') | xfa/fxfa/app/cxfa_fffielddelegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.cpp
diff --git a/xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.cpp b/xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..06b1676a0ab56da4e334dfa0323e7843d6214c87
--- /dev/null
+++ b/xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.cpp
@@ -0,0 +1,31 @@
+// 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_ffdatetimeeditdelegate.h"
+
+#include "xfa/fwl/core/cfwl_event.h"
+#include "xfa/fwl/core/ifwl_datetimepicker.h"
+#include "xfa/fxfa/app/xfa_fftextedit.h"
+
+CXFA_FFDateTimeEditDelegate::CXFA_FFDateTimeEditDelegate(
+ std::unique_ptr<IFWL_WidgetDelegate> pDelegate,
+ CXFA_FFDateTimeEdit* const pWidget)
+ : CXFA_FFTextEditDelegate(std::move(pDelegate), pWidget) {}
+
+CXFA_FFDateTimeEditDelegate::~CXFA_FFDateTimeEditDelegate() {}
+
+void CXFA_FFDateTimeEditDelegate::OnProcessEvent(CFWL_Event* pEvent) {
+ if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) {
+ CXFA_FFDateTimeEdit* widget = static_cast<CXFA_FFDateTimeEdit*>(m_pWidget);
+ CFWL_Event_DtpSelectChanged* event =
+ static_cast<CFWL_Event_DtpSelectChanged*>(pEvent);
+
+ widget->OnSelectChanged(widget->GetNormalWidget()->GetWidget(),
+ event->iYear, event->iMonth, event->iDay);
+ return;
+ }
+ CXFA_FFTextEditDelegate::OnProcessEvent(pEvent);
+}
« no previous file with comments | « xfa/fxfa/app/cxfa_ffdatetimeeditdelegate.h ('k') | xfa/fxfa/app/cxfa_fffielddelegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698