本文整理汇总了C++中CPDFDoc_Environment::JS_appAlert方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFDoc_Environment::JS_appAlert方法的具体用法?C++ CPDFDoc_Environment::JS_appAlert怎么用?C++ CPDFDoc_Environment::JS_appAlert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFDoc_Environment
的用法示例。
在下文中一共展示了CPDFDoc_Environment::JS_appAlert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Alert
void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) {
ASSERT(pContext != NULL);
if (pContext->IsMsgBoxEnabled()) {
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
if (pApp)
pApp->JS_appAlert(swMsg, NULL, 0, 3);
}
}
示例2: MsgBox
int32_t CPDFXFA_App::MsgBox(const CFX_WideStringC& wsMessage,
const CFX_WideStringC& wsTitle,
FX_DWORD dwIconType,
FX_DWORD dwButtonType) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
if (!pEnv)
return -1;
FX_DWORD iconType = 0;
int iButtonType = 0;
switch (dwIconType) {
case XFA_MBICON_Error:
iconType |= 0;
break;
case XFA_MBICON_Warning:
iconType |= 1;
break;
case XFA_MBICON_Question:
iconType |= 2;
break;
case XFA_MBICON_Status:
iconType |= 3;
break;
}
switch (dwButtonType) {
case XFA_MB_OK:
iButtonType |= 0;
break;
case XFA_MB_OKCancel:
iButtonType |= 1;
break;
case XFA_MB_YesNo:
iButtonType |= 2;
break;
case XFA_MB_YesNoCancel:
iButtonType |= 3;
break;
}
int32_t iRet = pEnv->JS_appAlert(wsMessage.GetPtr(), wsTitle.GetPtr(),
iButtonType, iconType);
switch (iRet) {
case 1:
return XFA_IDOK;
case 2:
return XFA_IDCancel;
case 3:
return XFA_IDNo;
case 4:
return XFA_IDYes;
}
return XFA_IDYes;
}