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); |
+} |