当前位置: 首页>>代码示例>>C++>>正文


C++ CXFA_FFWidgetHandler::ProcessEvent方法代码示例

本文整理汇总了C++中CXFA_FFWidgetHandler::ProcessEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ CXFA_FFWidgetHandler::ProcessEvent方法的具体用法?C++ CXFA_FFWidgetHandler::ProcessEvent怎么用?C++ CXFA_FFWidgetHandler::ProcessEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CXFA_FFWidgetHandler的用法示例。


在下文中一共展示了CXFA_FFWidgetHandler::ProcessEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnAfterNotifySubmit

void CPDFXFA_DocEnvironment::OnAfterNotifySubmit() {
  if (m_pContext->GetDocType() != DOCTYPE_DYNAMIC_XFA &&
      m_pContext->GetDocType() != DOCTYPE_STATIC_XFA)
    return;

  if (!m_pContext->GetXFADocView())
    return;

  CXFA_FFWidgetHandler* pWidgetHandler =
      m_pContext->GetXFADocView()->GetWidgetHandler();
  if (!pWidgetHandler)
    return;

  std::unique_ptr<CXFA_WidgetAccIterator> pWidgetAccIterator(
      m_pContext->GetXFADocView()->CreateWidgetAccIterator());
  if (!pWidgetAccIterator)
    return;

  CXFA_EventParam Param;
  Param.m_eType = XFA_EVENT_PostSubmit;
  CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext();
  while (pWidgetAcc) {
    pWidgetHandler->ProcessEvent(pWidgetAcc, &Param);
    pWidgetAcc = pWidgetAccIterator->MoveToNext();
  }
  m_pContext->GetXFADocView()->UpdateDocView();
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:27,代码来源:cpdfxfa_docenvironment.cpp

示例2: OnBeforeNotifySubmit

bool CPDFXFA_DocEnvironment::OnBeforeNotifySubmit() {
  if (m_pContext->GetDocType() != DOCTYPE_DYNAMIC_XFA &&
      m_pContext->GetDocType() != DOCTYPE_STATIC_XFA) {
    return true;
  }

  if (!m_pContext->GetXFADocView())
    return true;

  CXFA_FFWidgetHandler* pWidgetHandler =
      m_pContext->GetXFADocView()->GetWidgetHandler();
  if (!pWidgetHandler)
    return true;

  std::unique_ptr<CXFA_WidgetAccIterator> pWidgetAccIterator(
      m_pContext->GetXFADocView()->CreateWidgetAccIterator());
  if (pWidgetAccIterator) {
    CXFA_EventParam Param;
    Param.m_eType = XFA_EVENT_PreSubmit;
    while (CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext())
      pWidgetHandler->ProcessEvent(pWidgetAcc, &Param);
  }

  pWidgetAccIterator.reset(
      m_pContext->GetXFADocView()->CreateWidgetAccIterator());
  if (!pWidgetAccIterator)
    return true;

  CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext();
  pWidgetAcc = pWidgetAccIterator->MoveToNext();
  while (pWidgetAcc) {
    int fRet = pWidgetAcc->ProcessValidate(-1);
    if (fRet == XFA_EVENTERROR_Error) {
      CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv();
      if (!pFormFillEnv)
        return false;

      CFX_WideString ws;
      ws.FromLocal(IDS_XFA_Validate_Input);
      CFX_ByteString bs = ws.UTF16LE_Encode();
      int len = bs.GetLength();
      pFormFillEnv->Alert((FPDF_WIDESTRING)bs.GetBuffer(len),
                          (FPDF_WIDESTRING)L"", 0, 1);
      bs.ReleaseBuffer(len);
      return false;
    }
    pWidgetAcc = pWidgetAccIterator->MoveToNext();
  }
  m_pContext->GetXFADocView()->UpdateDocView();

  return true;
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:52,代码来源:cpdfxfa_docenvironment.cpp


注:本文中的CXFA_FFWidgetHandler::ProcessEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。