本文整理汇总了C++中CFXJSE_Value::SetInteger方法的典型用法代码示例。如果您正苦于以下问题:C++ CFXJSE_Value::SetInteger方法的具体用法?C++ CFXJSE_Value::SetInteger怎么用?C++ CFXJSE_Value::SetInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFXJSE_Value
的用法示例。
在下文中一共展示了CFXJSE_Value::SetInteger方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PageImp
void CScript_LayoutPseudoModel::PageImp(CFXJSE_Arguments* pArguments,
FX_BOOL bAbsPage) {
int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
const FX_WCHAR* methodName;
if (bAbsPage) {
methodName = L"absPage";
} else {
methodName = L"page";
}
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName);
return;
}
CXFA_Node* pNode = nullptr;
if (iLength >= 1) {
pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
}
int32_t iPage = 0;
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (!pNode && pValue)
pValue->SetInteger(iPage);
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
return;
}
CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode);
if (!pLayoutItem) {
pValue->SetInteger(-1);
return;
}
iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
if (pValue)
pValue->SetInteger(bAbsPage ? iPage : iPage + 1);
}
示例2: PageSpan
void CScript_LayoutPseudoModel::PageSpan(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageSpan");
return;
}
CXFA_Node* pNode = nullptr;
if (iLength >= 1) {
pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
}
if (!pNode) {
return;
}
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
return;
}
CFXJSE_Value* pValue = pArguments->GetReturnValue();
CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode);
if (!pLayoutItem) {
pValue->SetInteger(-1);
return;
}
int32_t iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex();
int32_t iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
int32_t iPageSpan = iLast - iFirst + 1;
if (pValue)
pValue->SetInteger(iPageSpan);
}
示例3: SheetInBatch
void CScript_LayoutPseudoModel::SheetInBatch(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
if (iLength != 1) {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"sheetInBatch");
return;
}
CXFA_Node* pNode = nullptr;
if (iLength >= 1) {
pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0));
}
if (!pNode) {
return;
}
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
return;
}
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
return;
}
CXFA_FFWidget* hWidget =
pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode));
if (!hWidget) {
return;
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget);
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
pValue->SetInteger(iPageCount);
}
示例4: NumberedPageCount
void CScript_LayoutPseudoModel::NumberedPageCount(CFXJSE_Arguments* pArguments,
FX_BOOL bNumbered) {
CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout();
if (!pDocLayout) {
return;
}
int32_t iPageCount = 0;
int32_t iPageNum = pDocLayout->CountPages();
if (bNumbered) {
for (int32_t i = 0; i < iPageNum; i++) {
CXFA_ContainerLayoutItem* pLayoutPage = pDocLayout->GetPage(i);
if (!pLayoutPage) {
continue;
}
CXFA_Node* pMasterPage = pLayoutPage->GetMasterPage();
if (pMasterPage->GetInteger(XFA_ATTRIBUTE_Numbered)) {
iPageCount++;
}
}
} else {
iPageCount = iPageNum;
}
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
pValue->SetInteger(iPageCount);
}
示例5: Verify
void CScript_SignaturePseudoModel::Verify(CFXJSE_Arguments* pArguments) {
int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 4) {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"verify");
return;
}
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
pValue->SetInteger(0);
}
示例6: SheetCountInBatch
void CScript_LayoutPseudoModel::SheetCountInBatch(
CFXJSE_Arguments* pArguments) {
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
return;
}
CXFA_FFDoc* hDoc = pNotify->GetHDOC();
int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc);
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
pValue->SetInteger(iPageCount);
}
示例7: MessageBox
void CScript_HostPseudoModel::MessageBox(CFXJSE_Arguments* pArguments) {
if (!m_pDocument->GetScriptContext()->IsRunAtClient()) {
return;
}
int32_t iLength = pArguments->GetLength();
if (iLength < 1 || iLength > 4) {
ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"messageBox");
return;
}
CXFA_FFNotify* pNotify = m_pDocument->GetNotify();
if (!pNotify) {
return;
}
CFX_WideString wsMessage;
CFX_WideString bsTitle;
uint32_t dwMessageType = XFA_MBICON_Error;
uint32_t dwButtonType = XFA_MB_OK;
if (iLength >= 1) {
if (!ValidateArgsForMsg(pArguments, 0, wsMessage)) {
return;
}
}
if (iLength >= 2) {
if (!ValidateArgsForMsg(pArguments, 1, bsTitle)) {
return;
}
}
if (iLength >= 3) {
dwMessageType = pArguments->GetInt32(2);
if (dwMessageType > XFA_MBICON_Status) {
dwMessageType = XFA_MBICON_Error;
}
}
if (iLength >= 4) {
dwButtonType = pArguments->GetInt32(3);
if (dwButtonType > XFA_MB_YesNoCancel) {
dwButtonType = XFA_MB_OK;
}
}
int32_t iValue = pNotify->GetAppProvider()->MsgBox(
wsMessage, bsTitle, dwMessageType, dwButtonType);
CFXJSE_Value* pValue = pArguments->GetReturnValue();
if (pValue)
pValue->SetInteger(iValue);
}
示例8: FXJSE_Value_SetInteger
void FXJSE_Value_SetInteger(FXJSE_HVALUE hValue, int32_t nInteger) {
CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue);
ASSERT(lpValue);
return lpValue->SetInteger(nInteger);
}