本文整理汇总了C++中CXFA_FFWidget::GetDataAcc方法的典型用法代码示例。如果您正苦于以下问题:C++ CXFA_FFWidget::GetDataAcc方法的具体用法?C++ CXFA_FFWidget::GetDataAcc怎么用?C++ CXFA_FFWidget::GetDataAcc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CXFA_FFWidget
的用法示例。
在下文中一共展示了CXFA_FFWidget::GetDataAcc方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalcTextRect
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: CreateTabOrderWidgetArray
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];
}
}
示例3: OnLayoutItemRemoving
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);
}
示例4: CreateTabOrderWidgetArray
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];
}
}
示例5: 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;
}
示例6: OnLayoutItemAdded
void CXFA_FFNotify::OnLayoutItemAdded(CXFA_LayoutProcessor* pLayout,
CXFA_LayoutItem* pSender,
int32_t iPageIdx,
uint32_t dwStatus) {
CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pLayout);
if (!pDocView)
return;
CXFA_FFWidget* pWidget = XFA_GetWidgetFromLayoutItem(pSender);
if (!pWidget)
return;
CXFA_FFPageView* pNewPageView = pDocView->GetPageView(iPageIdx);
uint32_t dwFilter = XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable |
XFA_WidgetStatus_Printable;
pWidget->ModifyStatus(dwStatus, dwFilter);
CXFA_FFPageView* pPrePageView = pWidget->GetPageView();
if (pPrePageView != pNewPageView ||
(dwStatus & (XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable)) ==
(XFA_WidgetStatus_Visible | XFA_WidgetStatus_Viewable)) {
pWidget->SetPageView(pNewPageView);
m_pDoc->GetDocProvider()->WidgetPostAdd(pWidget, pWidget->GetDataAcc());
}
if (pDocView->GetLayoutStatus() != XFA_DOCVIEW_LAYOUTSTATUS_End ||
!(dwStatus & XFA_WidgetStatus_Visible)) {
return;
}
if (pWidget->IsLoaded()) {
CFX_RectF rtOld;
pWidget->GetWidgetRect(rtOld);
if (rtOld != pWidget->ReCacheWidgetRect())
pWidget->PerformLayout();
} else {
pWidget->LoadWidget();
}
pWidget->AddInvalidateRect(nullptr);
}
示例7: DrawText
void CXFA_FWLTheme::DrawText(CFWL_ThemeText* pParams) {
if (pParams->m_wsText.IsEmpty())
return;
if (pParams->m_pWidget->GetClassID() == FWL_Type::MonthCalendar) {
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
if (!pWidget)
return;
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
m_pTextOut->SetFont(m_pCalendarFont);
m_pTextOut->SetFontSize(FWLTHEME_CAPACITY_FontSize);
m_pTextOut->SetTextColor(FWLTHEME_CAPACITY_TextColor);
if ((pParams->m_iPart == CFWL_Part::DatesIn) &&
!(pParams->m_dwStates & FWL_ITEMSTATE_MCD_Flag) &&
(pParams->m_dwStates &
(CFWL_PartState_Hovered | CFWL_PartState_Selected))) {
m_pTextOut->SetTextColor(0xFFFFFFFF);
}
if (pParams->m_iPart == CFWL_Part::Caption) {
if (m_pMonthCalendarTP->GetThemeID(pParams->m_pWidget) == 0) {
m_pTextOut->SetTextColor(ArgbEncode(0xff, 0, 153, 255));
} else {
m_pTextOut->SetTextColor(ArgbEncode(0xff, 128, 128, 0));
}
}
CFX_Graphics* pGraphics = pParams->m_pGraphics;
CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice();
if (!pRenderDevice)
return;
m_pTextOut->SetRenderDevice(pRenderDevice);
CFX_Matrix mtPart = pParams->m_matrix;
CFX_Matrix* pMatrix = pGraphics->GetMatrix();
if (pMatrix) {
mtPart.Concat(*pMatrix);
}
m_pTextOut->SetMatrix(mtPart);
m_pTextOut->DrawLogicText(pParams->m_wsText.c_str(),
pParams->m_wsText.GetLength(), pParams->m_rtPart);
return;
}
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
if (!pWidget)
return;
CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
CFX_Graphics* pGraphics = pParams->m_pGraphics;
CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice();
if (!pRenderDevice)
return;
m_pTextOut->SetRenderDevice(pRenderDevice);
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
m_pTextOut->SetFont(pAcc->GetFDEFont());
m_pTextOut->SetFontSize(pAcc->GetFontSize());
m_pTextOut->SetTextColor(pAcc->GetTextColor());
CFX_Matrix mtPart = pParams->m_matrix;
CFX_Matrix* pMatrix = pGraphics->GetMatrix();
if (pMatrix)
mtPart.Concat(*pMatrix);
m_pTextOut->SetMatrix(mtPart);
m_pTextOut->DrawLogicText(pParams->m_wsText.c_str(),
pParams->m_wsText.GetLength(), pParams->m_rtPart);
}
示例8: GetCapacity
void* CXFA_FWLTheme::GetCapacity(CFWL_ThemePart* pThemePart,
CFWL_WidgetCapacity dwCapacity) {
switch (dwCapacity) {
case CFWL_WidgetCapacity::Font: {
if (CXFA_FFWidget* pWidget =
XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) {
return pWidget->GetDataAcc()->GetFDEFont();
}
break;
}
case CFWL_WidgetCapacity::FontSize: {
if (CXFA_FFWidget* pWidget =
XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) {
m_fCapacity = pWidget->GetDataAcc()->GetFontSize();
return &m_fCapacity;
}
break;
}
case CFWL_WidgetCapacity::TextColor: {
if (CXFA_FFWidget* pWidget =
XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) {
m_dwCapacity = pWidget->GetDataAcc()->GetTextColor();
return &m_dwCapacity;
}
break;
}
case CFWL_WidgetCapacity::LineHeight: {
if (CXFA_FFWidget* pWidget =
XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) {
m_fCapacity = pWidget->GetDataAcc()->GetLineHeight();
return &m_fCapacity;
}
break;
}
case CFWL_WidgetCapacity::ScrollBarWidth: {
m_fCapacity = 9;
return &m_fCapacity;
}
case CFWL_WidgetCapacity::UIMargin: {
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pThemePart->m_pWidget);
if (pWidget) {
CXFA_LayoutItem* pItem = pWidget;
CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc();
pWidgetAcc->GetUIMargin(m_Rect);
if (CXFA_Para para = pWidgetAcc->GetPara()) {
m_Rect.left += para.GetMarginLeft();
if (pWidgetAcc->IsMultiLine()) {
m_Rect.width += para.GetMarginRight();
}
}
if (!pItem->GetPrev()) {
if (pItem->GetNext()) {
m_Rect.height = 0;
}
} else if (!pItem->GetNext()) {
m_Rect.top = 0;
} else {
m_Rect.top = 0;
m_Rect.height = 0;
}
}
return &m_Rect;
}
case CFWL_WidgetCapacity::SpaceAboveBelow: {
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pThemePart->m_pWidget);
if (pWidget) {
CXFA_WidgetAcc* pWidgetAcc = pWidget->GetDataAcc();
if (CXFA_Para para = pWidgetAcc->GetPara()) {
m_SizeAboveBelow.x = para.GetSpaceAbove();
m_SizeAboveBelow.y = para.GetSpaceBelow();
}
}
return &m_SizeAboveBelow;
}
default:
break;
}
int dwCapValue = static_cast<int>(dwCapacity);
if (pThemePart->m_pWidget->GetClassID() == FWL_Type::MonthCalendar &&
dwCapValue >= static_cast<int>(CFWL_WidgetCapacity::Today) &&
dwCapValue <= static_cast<int>(CFWL_WidgetCapacity::December)) {
if (CXFA_FFWidget* pWidget =
XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) {
IXFA_AppProvider* pAppProvider = pWidget->GetAppProvider();
m_wsResource.clear();
switch (dwCapacity) {
case CFWL_WidgetCapacity::Sun:
pAppProvider->LoadString(XFA_IDS_StringWeekDay_Sun, m_wsResource);
break;
case CFWL_WidgetCapacity::Mon:
pAppProvider->LoadString(XFA_IDS_StringWeekDay_Mon, m_wsResource);
break;
case CFWL_WidgetCapacity::Tue:
pAppProvider->LoadString(XFA_IDS_StringWeekDay_Tue, m_wsResource);
break;
case CFWL_WidgetCapacity::Wed:
pAppProvider->LoadString(XFA_IDS_StringWeekDay_Wed, m_wsResource);
break;
case CFWL_WidgetCapacity::Thu:
//.........这里部分代码省略.........