本文整理汇总了C++中CXFA_FFWidget类的典型用法代码示例。如果您正苦于以下问题:C++ CXFA_FFWidget类的具体用法?C++ CXFA_FFWidget怎么用?C++ CXFA_FFWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CXFA_FFWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XFA_ThemeGetOuterWidget
void CXFA_FWLTheme::CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) {
if (pParams->m_pWidget->GetClassID() == FWL_Type::MonthCalendar) {
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
if (!pWidget || !pParams || !m_pTextOut)
return;
m_pTextOut->SetFont(m_pCalendarFont);
m_pTextOut->SetFontSize(FWLTHEME_CAPACITY_FontSize);
m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor);
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->CalcLogicSize(pParams->m_wsText.c_str(),
pParams->m_wsText.GetLength(), rect);
}
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
if (!pWidget)
return;
CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
m_pTextOut->SetFont(pAcc->GetFDEFont());
m_pTextOut->SetFontSize(pAcc->GetFontSize());
m_pTextOut->SetTextColor(pAcc->GetTextColor());
if (!pParams)
return;
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->CalcLogicSize(pParams->m_wsText.c_str(),
pParams->m_wsText.GetLength(), rect);
}
示例2: OnValueChanging
void CXFA_FFNotify::OnValueChanging(CXFA_Node* pSender, XFA_ATTRIBUTE eAttr) {
if (eAttr != XFA_ATTRIBUTE_Presence)
return;
if (pSender->GetPacketID() & XFA_XDPPACKET_Datasets)
return;
if (!pSender->IsFormContainer())
return;
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
if (!pDocView)
return;
if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End)
return;
CXFA_WidgetAcc* pWidgetAcc =
static_cast<CXFA_WidgetAcc*>(pSender->GetWidgetData());
if (!pWidgetAcc)
return;
CXFA_FFWidget* pWidget = nullptr;
while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) {
if (pWidget->IsLoaded())
pWidget->AddInvalidateRect();
}
}
示例3: GetXFAWidgetHandler
FX_BOOL CPDFSDK_XFAAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
CPDFSDK_Annot* pNewAnnot) {
CXFA_FFWidgetHandler* pWidgetHandler = nullptr;
if (pOldAnnot)
pWidgetHandler = GetXFAWidgetHandler(pOldAnnot);
else if (pNewAnnot)
pWidgetHandler = GetXFAWidgetHandler(pNewAnnot);
if (pWidgetHandler) {
FX_BOOL bRet = TRUE;
CXFA_FFWidget* hWidget = pNewAnnot ? pNewAnnot->GetXFAWidget() : nullptr;
if (hWidget) {
CXFA_FFPageView* pXFAPageView = hWidget->GetPageView();
if (pXFAPageView) {
bRet = pXFAPageView->GetDocView()->SetFocus(hWidget);
if (pXFAPageView->GetDocView()->GetFocusWidget() == hWidget)
bRet = TRUE;
}
}
return bRet;
}
return TRUE;
}
示例4: GetXFAWidgetHandler
bool CPDFSDK_XFAWidgetHandler::OnXFAChangedFocus(
CPDFSDK_Annot::ObservedPtr* pOldAnnot,
CPDFSDK_Annot::ObservedPtr* pNewAnnot) {
CXFA_FFWidgetHandler* pWidgetHandler = nullptr;
if (*pOldAnnot)
pWidgetHandler = GetXFAWidgetHandler(pOldAnnot->Get());
else if (*pNewAnnot)
pWidgetHandler = GetXFAWidgetHandler(pNewAnnot->Get());
if (!pWidgetHandler)
return true;
CXFA_FFWidget* hWidget = *pNewAnnot ? (*pNewAnnot)->GetXFAWidget() : nullptr;
if (!hWidget)
return true;
CXFA_FFPageView* pXFAPageView = hWidget->GetPageView();
if (!pXFAPageView)
return true;
bool bRet = pXFAPageView->GetDocView()->SetFocus(hWidget);
if (pXFAPageView->GetDocView()->GetFocusWidget() == hWidget)
bRet = true;
return bRet;
}
示例5: RepaintWidget
void CXFA_FWLAdapterWidgetMgr::RepaintWidget(CFWL_Widget* pWidget) {
if (!pWidget)
return;
CXFA_FFWidget* pFFWidget = pWidget->GetLayoutItem();
if (!pFFWidget)
return;
pFFWidget->InvalidateRect();
}
示例6: GetPopupPos
bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(CFWL_Widget* pWidget,
float fMinHeight,
float fMaxHeight,
const CFX_RectF& rtAnchor,
CFX_RectF* pPopupRect) {
CXFA_FFWidget* pFFWidget = pWidget->GetLayoutItem();
CFX_RectF rtRotateAnchor =
pFFWidget->GetRotateMatrix().TransformRect(rtAnchor);
pFFWidget->GetDoc()->GetDocEnvironment()->GetPopupPos(
pFFWidget, fMinHeight, fMaxHeight, rtRotateAnchor, pPopupRect);
return true;
}
示例7: XFA_GetWidgetFromLayoutItem
void CXFA_FFNotify::OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout,
CXFA_LayoutItem* pSender) {
CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout);
if (!pDocView)
return;
CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender);
if (!pWidget)
return;
pDocView->DeleteLayoutItem(pWidget);
m_pDoc->GetDocProvider()->WidgetPreRemove(pWidget, pWidget->GetDataAcc());
pWidget->AddInvalidateRect(nullptr);
}
示例8: OnWidgetListItemRemoved
void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_WidgetData* pSender,
int32_t iIndex) {
CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender);
if (pWidgetAcc->GetUIType() != XFA_Element::ChoiceList)
return;
CXFA_FFWidget* pWidget = nullptr;
while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) {
if (pWidget->IsLoaded()) {
if (pWidgetAcc->IsListBox()) {
static_cast<CXFA_FFListBox*>(pWidget)->DeleteItem(iIndex);
} else {
static_cast<CXFA_FFComboBox*>(pWidget)->DeleteItem(iIndex);
}
}
}
}
示例9: CreateSpaceOrderWidgetArray
void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() {
m_TabOrderWidgetArray.clear();
std::vector<CXFA_FFWidget*> SpaceOrderWidgetArray;
CreateSpaceOrderWidgetArray(&SpaceOrderWidgetArray);
if (SpaceOrderWidgetArray.empty())
return;
int32_t nWidgetCount = pdfium::CollectionSize<int32_t>(SpaceOrderWidgetArray);
CXFA_FFWidget* hWidget = SpaceOrderWidgetArray[0];
while (pdfium::CollectionSize<int32_t>(m_TabOrderWidgetArray) <
nWidgetCount) {
if (!pdfium::ContainsValue(m_TabOrderWidgetArray, hWidget)) {
m_TabOrderWidgetArray.push_back(hWidget);
CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc();
if (pWidgetAcc->GetUIType() == XFA_Element::ExclGroup) {
auto it = std::find(SpaceOrderWidgetArray.begin(),
SpaceOrderWidgetArray.end(), hWidget);
int32_t iWidgetIndex = it != SpaceOrderWidgetArray.end()
? it - SpaceOrderWidgetArray.begin() + 1
: 0;
while (true) {
CXFA_FFWidget* pRadio =
SpaceOrderWidgetArray[iWidgetIndex % nWidgetCount];
if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) {
break;
}
if (!pdfium::ContainsValue(m_TabOrderWidgetArray, hWidget)) {
m_TabOrderWidgetArray.push_back(pRadio);
}
iWidgetIndex++;
}
}
if (CXFA_FFWidget* hTraverseWidget = GetTraverseWidget(hWidget)) {
hWidget = hTraverseWidget;
continue;
}
}
auto it = std::find(SpaceOrderWidgetArray.begin(),
SpaceOrderWidgetArray.end(), hWidget);
int32_t iWidgetIndex = it != SpaceOrderWidgetArray.end()
? it - SpaceOrderWidgetArray.begin() + 1
: 0;
hWidget = SpaceOrderWidgetArray[iWidgetIndex % nWidgetCount];
}
}
示例10: while
int32_t CXFA_RenderContext::DoRender(IFX_Pause* pPause) {
int32_t iCount = 0;
while (m_pWidget) {
CXFA_FFWidget* pWidget = m_pWidget;
CFX_RectF rtWidgetBox;
pWidget->GetBBox(rtWidgetBox, XFA_WidgetStatus_Visible);
rtWidgetBox.width += 1;
rtWidgetBox.height += 1;
if (rtWidgetBox.IntersectWith(m_rtClipRect))
pWidget->RenderWidget(m_pGS, &m_matrix, m_dwStatus);
m_pWidget = m_pWidgetIterator->MoveToNext();
iCount++;
if (iCount > kMaxCount && pPause && pPause->NeedToPauseNow())
return XFA_RENDERSTATUS_ToBeContinued;
}
return XFA_RENDERSTATUS_Done;
}
示例11: OnWidgetListItemAdded
void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_WidgetData* pSender,
const FX_WCHAR* pLabel,
const FX_WCHAR* pValue,
int32_t iIndex) {
CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pSender);
if (pWidgetAcc->GetUIType() != XFA_Element::ChoiceList)
return;
CXFA_FFWidget* pWidget = nullptr;
while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) {
if (pWidget->IsLoaded()) {
if (pWidgetAcc->IsListBox()) {
static_cast<CXFA_FFListBox*>(pWidget)->InsertItem(pLabel, iIndex);
} else {
static_cast<CXFA_FFComboBox*>(pWidget)->InsertItem(pLabel, iIndex);
}
}
}
}
示例12: CreateSpaceOrderWidgetArray
void CXFA_FFTabOrderPageWidgetIterator::CreateTabOrderWidgetArray() {
m_TabOrderWidgetArray.RemoveAll();
CXFA_WidgetArray SpaceOrderWidgetArray;
CreateSpaceOrderWidgetArray(SpaceOrderWidgetArray);
int32_t nWidgetCount = SpaceOrderWidgetArray.GetSize();
if (nWidgetCount < 1) {
return;
}
CXFA_FFWidget* hWidget = SpaceOrderWidgetArray[0];
for (; m_TabOrderWidgetArray.GetSize() < nWidgetCount;) {
if (m_TabOrderWidgetArray.Find(hWidget) < 0) {
m_TabOrderWidgetArray.Add(hWidget);
CXFA_WidgetAcc* pWidgetAcc = hWidget->GetDataAcc();
if (pWidgetAcc->GetUIType() == XFA_Element::ExclGroup) {
int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget) + 1;
while (TRUE) {
CXFA_FFWidget* pRadio =
SpaceOrderWidgetArray[(iWidgetIndex) % nWidgetCount];
if (pRadio->GetDataAcc()->GetExclGroup() != pWidgetAcc) {
break;
}
if (m_TabOrderWidgetArray.Find(hWidget) < 0) {
m_TabOrderWidgetArray.Add(pRadio);
}
iWidgetIndex++;
}
}
if (CXFA_FFWidget* hTraverseWidget = GetTraverseWidget(hWidget)) {
hWidget = hTraverseWidget;
continue;
}
}
int32_t iWidgetIndex = SpaceOrderWidgetArray.Find(hWidget);
hWidget = SpaceOrderWidgetArray[(iWidgetIndex + 1) % nWidgetCount];
}
}
示例13: CXFA_FFPageView
CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) {
CXFA_LayoutProcessor* pLayout = m_pDoc->GetXFADoc()->GetDocLayout();
CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout);
XFA_Element eType = pNode->GetElementType();
if (eType == XFA_Element::PageArea)
return new CXFA_FFPageView(pDocView, pNode);
if (eType == XFA_Element::ContentArea)
return new CXFA_ContainerLayoutItem(pNode);
CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pNode->GetWidgetData());
if (!pAcc)
return new CXFA_ContentLayoutItem(pNode);
CXFA_FFWidget* pWidget;
switch (pAcc->GetUIType()) {
case XFA_Element::Barcode:
pWidget = new CXFA_FFBarcode(nullptr, pAcc);
break;
case XFA_Element::Button:
pWidget = new CXFA_FFPushButton(nullptr, pAcc);
break;
case XFA_Element::CheckButton:
pWidget = new CXFA_FFCheckButton(nullptr, pAcc);
break;
case XFA_Element::ChoiceList: {
if (pAcc->IsListBox()) {
pWidget = new CXFA_FFListBox(nullptr, pAcc);
} else {
pWidget = new CXFA_FFComboBox(nullptr, pAcc);
}
} break;
case XFA_Element::DateTimeEdit:
pWidget = new CXFA_FFDateTimeEdit(nullptr, pAcc);
break;
case XFA_Element::ImageEdit:
pWidget = new CXFA_FFImageEdit(nullptr, pAcc);
break;
case XFA_Element::NumericEdit:
pWidget = new CXFA_FFNumericEdit(nullptr, pAcc);
break;
case XFA_Element::PasswordEdit:
pWidget = new CXFA_FFPasswordEdit(nullptr, pAcc);
break;
case XFA_Element::Signature:
pWidget = new CXFA_FFSignature(nullptr, pAcc);
break;
case XFA_Element::TextEdit:
pWidget = new CXFA_FFTextEdit(nullptr, pAcc);
break;
case XFA_Element::Arc:
pWidget = new CXFA_FFArc(nullptr, pAcc);
break;
case XFA_Element::Line:
pWidget = new CXFA_FFLine(nullptr, pAcc);
break;
case XFA_Element::Rectangle:
pWidget = new CXFA_FFRectangle(nullptr, pAcc);
break;
case XFA_Element::Text:
pWidget = new CXFA_FFText(nullptr, pAcc);
break;
case XFA_Element::Image:
pWidget = new CXFA_FFImage(nullptr, pAcc);
break;
case XFA_Element::Draw:
pWidget = new CXFA_FFDraw(nullptr, pAcc);
break;
case XFA_Element::Subform:
pWidget = new CXFA_FFSubForm(nullptr, pAcc);
break;
case XFA_Element::ExclGroup:
pWidget = new CXFA_FFExclGroup(nullptr, pAcc);
break;
case XFA_Element::DefaultUi:
default:
pWidget = nullptr;
break;
}
if (pWidget)
pWidget->SetDocView(pDocView);
return pWidget;
}
示例14: SetFocus
FX_BOOL CXFA_FFDocView::SetFocus(IXFA_Widget* hWidget) {
CXFA_FFWidget* pNewFocus = (CXFA_FFWidget*)hWidget;
if (m_pOldFocusWidget == pNewFocus) {
return FALSE;
}
CXFA_FFWidget* pOldFocus = m_pOldFocusWidget;
m_pOldFocusWidget = pNewFocus;
if (pOldFocus) {
if (m_pFocusWidget != m_pOldFocusWidget &&
(pOldFocus->GetStatus() & XFA_WIDGETSTATUS_Focused)) {
m_pFocusWidget = pOldFocus;
pOldFocus->OnKillFocus(pNewFocus);
} else if ((pOldFocus->GetStatus() & XFA_WIDGETSTATUS_Visible)) {
if (!pOldFocus->IsLoaded()) {
pOldFocus->LoadWidget();
}
pOldFocus->OnSetFocus(m_pFocusWidget);
m_pFocusWidget = pOldFocus;
pOldFocus->OnKillFocus(pNewFocus);
}
}
if (m_pFocusWidget == m_pOldFocusWidget) {
return FALSE;
}
pNewFocus = m_pOldFocusWidget;
if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) {
m_pFocusAcc = NULL;
m_pFocusWidget = NULL;
m_pListFocusWidget = NULL;
m_pOldFocusWidget = NULL;
return FALSE;
}
if (pNewFocus && (pNewFocus->GetStatus() & XFA_WIDGETSTATUS_Visible)) {
if (!pNewFocus->IsLoaded()) {
pNewFocus->LoadWidget();
}
pNewFocus->OnSetFocus(m_pFocusWidget);
}
m_pFocusAcc = pNewFocus ? pNewFocus->GetDataAcc() : NULL;
m_pFocusWidget = pNewFocus;
m_pOldFocusWidget = m_pFocusWidget;
return TRUE;
}
示例15: switch
void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender,
XFA_ATTRIBUTE eAttr,
CXFA_Node* pParentNode,
CXFA_Node* pWidgetNode) {
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
if (!pDocView)
return;
if (!(pSender->GetPacketID() & XFA_XDPPACKET_Form)) {
if (eAttr == XFA_ATTRIBUTE_Value)
pDocView->AddCalculateNodeNotify(pSender);
return;
}
XFA_Element eType = pParentNode->GetElementType();
FX_BOOL bIsContainerNode = pParentNode->IsContainerNode();
CXFA_WidgetAcc* pWidgetAcc =
static_cast<CXFA_WidgetAcc*>(pWidgetNode->GetWidgetData());
if (!pWidgetAcc)
return;
bool bUpdateProperty = false;
pDocView->SetChangeMark();
switch (eType) {
case XFA_Element::Caption: {
CXFA_TextLayout* pCapOut = pWidgetAcc->GetCaptionTextLayout();
if (!pCapOut)
return;
pCapOut->Unload();
} break;
case XFA_Element::Ui:
case XFA_Element::Para:
bUpdateProperty = true;
break;
default:
break;
}
if (bIsContainerNode && eAttr == XFA_ATTRIBUTE_Access)
bUpdateProperty = true;
if (eAttr == XFA_ATTRIBUTE_Value) {
pDocView->AddCalculateNodeNotify(pSender);
if (eType == XFA_Element::Value || bIsContainerNode) {
if (bIsContainerNode) {
pWidgetAcc->UpdateUIDisplay();
pDocView->AddCalculateWidgetAcc(pWidgetAcc);
pDocView->AddValidateWidget(pWidgetAcc);
} else if (pWidgetNode->GetNodeItem(XFA_NODEITEM_Parent)
->GetElementType() == XFA_Element::ExclGroup) {
pWidgetAcc->UpdateUIDisplay();
}
return;
}
}
CXFA_FFWidget* pWidget = nullptr;
while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) {
if (!pWidget->IsLoaded())
continue;
if (bUpdateProperty)
pWidget->UpdateWidgetProperty();
pWidget->PerformLayout();
pWidget->AddInvalidateRect();
}
}