Example #1
0
bool CXFA_FFBarcode::OnLButtonDown(uint32_t dwFlags, const CFX_PointF& point) {
  CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
  if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType())
    return false;
  if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open)
    return false;
  return CXFA_FFTextEdit::OnLButtonDown(dwFlags, point);
}
Example #2
0
FX_BOOL CXFA_FFBarcode::OnRButtonDown(FX_DWORD dwFlags,
                                      FX_FLOAT fx,
                                      FX_FLOAT fy) {
  CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
  if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) {
    return FALSE;
  }
  return CXFA_FFTextEdit::OnRButtonDown(dwFlags, fx, fy);
}
Example #3
0
FX_BOOL CXFA_FFBarcode::OnLButtonDown(FX_DWORD dwFlags,
                                      FX_FLOAT fx,
                                      FX_FLOAT fy) {
  CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
  if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType()) {
    return FALSE;
  }
  if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
    return FALSE;
  }
  return CXFA_FFTextEdit::OnLButtonDown(dwFlags, fx, fy);
}
Example #4
0
FX_BOOL CXFA_FFBarcode::LoadWidget() {
  CFWL_Barcode* pFWLBarcode = CFWL_Barcode::Create();
  if (pFWLBarcode) {
    pFWLBarcode->Initialize();
  }
  m_pNormalWidget = pFWLBarcode;
  IFWL_Widget* pWidget = m_pNormalWidget->GetWidget();
  m_pNormalWidget->SetPrivateData(pWidget, this, NULL);
  IFWL_NoteDriver* pNoteDriver = FWL_GetApp()->GetNoteDriver();
  pNoteDriver->RegisterEventTarget(pWidget, pWidget);
  m_pOldDelegate = m_pNormalWidget->SetDelegate(this);
  m_pNormalWidget->LockUpdate();
  CFX_WideString wsText;
  m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display);
  pFWLBarcode->SetText(wsText);
  UpdateWidgetProperty();
  m_pNormalWidget->UnlockUpdate();
  return CXFA_FFField::LoadWidget();
}
Example #5
0
bool CXFA_FFBarcode::LoadWidget() {
  CFWL_Barcode* pFWLBarcode = new CFWL_Barcode(GetFWLApp());

  m_pNormalWidget = pFWLBarcode;
  m_pNormalWidget->SetLayoutItem(this);
  CFWL_NoteDriver* pNoteDriver =
      m_pNormalWidget->GetOwnerApp()->GetNoteDriver();
  pNoteDriver->RegisterEventTarget(m_pNormalWidget, m_pNormalWidget);

  m_pOldDelegate = m_pNormalWidget->GetDelegate();
  m_pNormalWidget->SetDelegate(this);
  m_pNormalWidget->LockUpdate();

  CFX_WideString wsText;
  m_pDataAcc->GetValue(wsText, XFA_VALUEPICTURE_Display);
  pFWLBarcode->SetText(wsText);
  UpdateWidgetProperty();
  m_pNormalWidget->UnlockUpdate();
  return CXFA_FFField::LoadWidget();
}
Example #6
0
void CXFA_FFBarcode::UpdateWidgetProperty() {
  CXFA_FFTextEdit::UpdateWidgetProperty();
  CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
  CFX_WideString wsType = GetDataAcc()->GetBarcodeType();
  XFA_LPCBARCODETYPEENUMINFO pBarcodeTypeInfo =
      XFA_GetBarcodeTypeByName(wsType);
  pBarCodeWidget->SetType(pBarcodeTypeInfo->eBCType);
  CXFA_WidgetAcc* pAcc = GetDataAcc();
  int32_t intVal;
  FX_CHAR charVal;
  FX_BOOL boolVal;
  FX_FLOAT floatVal;
  if (pAcc->GetBarcodeAttribute_CharEncoding(intVal)) {
    pBarCodeWidget->SetCharEncoding((BC_CHAR_ENCODING)intVal);
  }
  if (pAcc->GetBarcodeAttribute_Checksum(intVal)) {
    pBarCodeWidget->SetCalChecksum(intVal);
  }
  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);
  }
}
Example #7
0
bool CXFA_FFBarcode::OnRButtonDown(uint32_t dwFlags, const CFX_PointF& point) {
  CFWL_Barcode* pBarCodeWidget = (CFWL_Barcode*)m_pNormalWidget;
  if (!pBarCodeWidget || pBarCodeWidget->IsProtectedType())
    return false;
  return CXFA_FFTextEdit::OnRButtonDown(dwFlags, point);
}