7#include "xfa/fxfa/cxfa_ffnumericedit.h"
9#include "third_party/base/check.h"
10#include "xfa/fwl/cfwl_edit.h"
11#include "xfa/fwl/cfwl_eventvalidate.h"
12#include "xfa/fwl/cfwl_notedriver.h"
13#include "xfa/fxfa/cxfa_ffdoc.h"
14#include "xfa/fxfa/parser/cxfa_localevalue.h"
15#include "xfa/fxfa/parser/cxfa_node.h"
16#include "xfa/fxfa/parser/xfa_utils.h"
26 CFWL_Edit* pWidget = cppgc::MakeGarbageCollected<CFWL_Edit>(
27 GetFWLApp()->GetHeap()->GetAllocationHandle(), GetFWLApp(),
28 CFWL_Widget::Properties(),
nullptr);
32 CFWL_NoteDriver* pNoteDriver = pWidget
->GetFWLApp()->GetNoteDriver();
34 m_pOldDelegate = pWidget->GetDelegate();
39 pWidget->SetText(m_pNode->GetValue(XFA_ValuePicture::kDisplay));
51 uint32_t dwExtendedStyle =
55 if (!m_pNode->IsHorizontalScrollPolicyOff())
58 absl::optional<int32_t> numCells = m_pNode->GetNumberOfCells();
59 if (numCells.has_value() && numCells.value() > 0) {
61 pWidget->SetLimit(numCells.value());
64 if (!m_pNode->IsOpenAccess() || !GetDoc()->GetXFADoc()->IsInteractive())
67 GetNormalWidget()->ModifyStyleExts(dwExtendedStyle, 0xFFFFFFFF);
72 CFWL_EventValidate* event =
static_cast<CFWL_EventValidate*>(pEvent);
79bool CXFA_FFNumericEdit::OnValidate(
CFWL_Widget* pWidget,
80 const WideString& wsText) {
81 WideString wsPattern = m_pNode->GetPictureContent(XFA_ValuePicture::kEdit);
87 widgetValue.GetNumericFormat(wsFormat, m_pNode->GetLeadDigits(),
88 m_pNode->GetFracDigits());
89 return widgetValue.ValidateNumericTemp(wsText, wsFormat,
90 m_pNode->GetLocale());
#define FWL_STYLEEXT_EDT_ShowScrollbarFocus
#define FWL_STYLEEXT_EDT_OuterScrollbar
#define FWL_STYLEEXT_EDT_AutoHScroll
#define FWL_STYLEEXT_EDT_ReadOnly
#define FWL_STYLEEXT_EDT_Validate
#define FWL_STYLEEXT_EDT_Number
#define FWL_STYLEEXT_EDT_CombText
void SetValidate(bool bValidate)
WideString GetInsert() const
void RegisterEventTarget(CFWL_Widget *pListener, CFWL_Widget *pEventSource)
bool LoadWidget() override
void SetNormalWidget(CFWL_Widget *widget)
uint32_t UpdateUIProperty()
CXFA_FFNumericEdit(CXFA_Node *pNode)
void OnProcessEvent(CFWL_Event *pEvent) override
bool LoadWidget() override
~CXFA_FFNumericEdit() override
void UpdateWidgetProperty() override
void OnProcessEvent(CFWL_Event *pEvent) override
CXFA_FFTextEdit(CXFA_Node *pNode)