本文整理汇总了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();
}
示例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;
}