OLD | NEW |
(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_ffnumericeditdelegate.h" |
| 8 |
| 9 #include "xfa/fwl/core/ifwl_edit.h" |
| 10 #include "xfa/fxfa/app/xfa_fffield.h" |
| 11 #include "xfa/fxfa/app/xfa_fftextedit.h" |
| 12 |
| 13 CXFA_FFNumericEditDelegate::CXFA_FFNumericEditDelegate( |
| 14 std::unique_ptr<IFWL_WidgetDelegate> pDelegate, |
| 15 CXFA_FFNumericEdit* const pWidget) |
| 16 : CXFA_FFTextEditDelegate(std::move(pDelegate), pWidget) {} |
| 17 |
| 18 CXFA_FFNumericEditDelegate::~CXFA_FFNumericEditDelegate() {} |
| 19 |
| 20 void CXFA_FFNumericEditDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
| 21 if (pEvent->GetClassID() == CFWL_EventType::Validate) { |
| 22 CFWL_EvtEdtValidate* event = static_cast<CFWL_EvtEdtValidate*>(pEvent); |
| 23 CXFA_FFNumericEdit* widget = static_cast<CXFA_FFNumericEdit*>(m_pWidget); |
| 24 CFX_WideString wsChange = event->wsInsert; |
| 25 event->bValidate = |
| 26 widget->OnValidate(widget->GetNormalWidget()->GetWidget(), wsChange); |
| 27 return; |
| 28 } |
| 29 CXFA_FFTextEditDelegate::OnProcessEvent(pEvent); |
| 30 } |
OLD | NEW |