void CXFA_FFBarcode::UpdateWidgetProperty() {
  CXFA_FFTextEdit::UpdateWidgetProperty();
  CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
  CFX_WideString wsType = GetDataAcc()->GetBarcodeType();
  const XFA_BARCODETYPEENUMINFO* pBarcodeTypeInfo =
      XFA_GetBarcodeTypeByName(wsType.AsStringC());
  if (!pBarcodeTypeInfo)
    return;

  pBarCodeWidget->SetType(pBarcodeTypeInfo->eBCType);
  CXFA_WidgetAcc* pAcc = GetDataAcc();
  int32_t intVal;
  FX_CHAR charVal;
  bool boolVal;
  FX_FLOAT floatVal;
  if (pAcc->GetBarcodeAttribute_CharEncoding(intVal)) {
    pBarCodeWidget->SetCharEncoding((BC_CHAR_ENCODING)intVal);
  }
  if (pAcc->GetBarcodeAttribute_Checksum(boolVal)) {
    pBarCodeWidget->SetCalChecksum(boolVal);
  }
  if (pAcc->GetBarcodeAttribute_DataLength(intVal)) {
    pBarCodeWidget->SetDataLength(intVal);
  }
  if (pAcc->GetBarcodeAttribute_StartChar(charVal)) {
    pBarCodeWidget->SetStartChar(charVal);
  }
  if (pAcc->GetBarcodeAttribute_EndChar(charVal)) {
    pBarCodeWidget->SetEndChar(charVal);
  }
  if (pAcc->GetBarcodeAttribute_ECLevel(intVal)) {
    pBarCodeWidget->SetErrorCorrectionLevel(intVal);
  }
  if (pAcc->GetBarcodeAttribute_ModuleWidth(intVal)) {
    pBarCodeWidget->SetModuleWidth(intVal);
  }
  if (pAcc->GetBarcodeAttribute_ModuleHeight(intVal)) {
    pBarCodeWidget->SetModuleHeight(intVal);
  }
  if (pAcc->GetBarcodeAttribute_PrintChecksum(boolVal)) {
    pBarCodeWidget->SetPrintChecksum(boolVal);
  }
  if (pAcc->GetBarcodeAttribute_TextLocation(intVal)) {
    pBarCodeWidget->SetTextLocation((BC_TEXT_LOC)intVal);
  }
  if (pAcc->GetBarcodeAttribute_Truncate(boolVal)) {
    pBarCodeWidget->SetTruncated(boolVal);
  }
  if (pAcc->GetBarcodeAttribute_WideNarrowRatio(floatVal)) {
    pBarCodeWidget->SetWideNarrowRatio((int32_t)floatVal);
  }
  if (pBarcodeTypeInfo->eName == XFA_BARCODETYPE_code3Of9 ||
      pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean8 ||
      pBarcodeTypeInfo->eName == XFA_BARCODETYPE_ean13 ||
      pBarcodeTypeInfo->eName == XFA_BARCODETYPE_upcA) {
    pBarCodeWidget->SetPrintChecksum(true);
  }
}
void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) {
  CXFA_WidgetAcc* pAcc = GetDataAcc();
  if (pAcc && pAcc->GetUIType() == XFA_Element::NumericEdit) {
    IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider();
    if (pAppProvider) {
      CFX_WideString wsTitle;
      pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
      CFX_WideString wsError;
      pAppProvider->LoadString(XFA_IDS_ValidateNumberError, wsError);
      CFX_WideString wsSomField;
      pAcc->GetNode()->GetSOMExpression(wsSomField);
      CFX_WideString wsMessage;
      wsMessage.Format(wsError.c_str(), wsText.c_str(), wsSomField.c_str());
      pAppProvider->MsgBox(wsMessage, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
    }
  }
}