本文整理汇总了C++中CFX_RectF::Union方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_RectF::Union方法的具体用法?C++ CFX_RectF::Union怎么用?C++ CFX_RectF::Union使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_RectF
的用法示例。
在下文中一共展示了CFX_RectF::Union方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChangeSelected
void IFWL_ComboList::ChangeSelected(int32_t iSel) {
if (!m_pProperties->m_pDataProvider)
return;
IFWL_ListBoxDP* pData =
static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider);
CFWL_ListItem* hItem = pData->GetItem(this, iSel);
CFX_RectF rtInvalidate;
rtInvalidate.Reset();
CFWL_ListItem* hOld = GetSelItem(0);
int32_t iOld = pData->GetItemIndex(this, hOld);
if (iOld == iSel)
return;
if (iOld > -1) {
GetItemRect(iOld, rtInvalidate);
SetSelItem(hOld, false);
}
if (hItem) {
CFX_RectF rect;
GetItemRect(iSel, rect);
rtInvalidate.Union(rect);
CFWL_ListItem* hSel = pData->GetItem(this, iSel);
SetSelItem(hSel, true);
}
if (!rtInvalidate.IsEmpty())
Repaint(&rtInvalidate);
}
示例2: DisForm_GetBBox
void IFWL_DateTimePicker::DisForm_GetBBox(CFX_RectF& rect) const {
rect = m_pProperties->m_rtWidget;
if (DisForm_IsNeedShowButton())
rect.width += m_fBtn;
if (!IsMonthCalendarVisible())
return;
CFX_RectF rtMonth;
m_pMonthCal->GetWidgetRect(rtMonth);
rtMonth.Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top);
rect.Union(rtMonth);
}
示例3: AddInvalidateRect
void CXFA_FFDocView::AddInvalidateRect(IXFA_PageView* pPageView,
const CFX_RectF& rtInvalidate) {
CFX_RectF* pRect = (CFX_RectF*)m_mapPageInvalidate.GetValueAt(pPageView);
if (!pRect) {
pRect = new CFX_RectF;
pRect->Set(rtInvalidate.left, rtInvalidate.top, rtInvalidate.width,
rtInvalidate.height);
m_mapPageInvalidate.SetAt(pPageView, pRect);
} else {
pRect->Union(rtInvalidate);
}
}
示例4: CalcRangeRectArray
void CFDE_TxtEdtPage::CalcRangeRectArray(int32_t nStart,
int32_t nCount,
CFX_RectFArray& RectFArr) const {
int32_t nPieceCount = m_PieceMassArr.GetSize();
int32_t nEnd = nStart + nCount - 1;
FX_BOOL bInRange = FALSE;
for (int32_t i = 0; i < nPieceCount; i++) {
FDE_TEXTEDITPIECE* piece = m_PieceMassArr.GetPtrAt(i);
if (!bInRange) {
if (nStart >= piece->nStart && nStart < (piece->nStart + piece->nCount)) {
int32_t nRangeEnd = piece->nCount - 1;
FX_BOOL bEnd = FALSE;
if (nEnd >= piece->nStart && nEnd < (piece->nStart + piece->nCount)) {
nRangeEnd = nEnd - piece->nStart;
bEnd = TRUE;
}
CFX_RectFArray rcArr;
m_pTextSet->GetCharRects(piece, rcArr, FALSE);
CFX_RectF rectPiece = rcArr[nStart - piece->nStart];
rectPiece.Union(rcArr[nRangeEnd]);
RectFArr.Add(rectPiece);
if (bEnd) {
return;
}
bInRange = TRUE;
}
} else {
if (nEnd >= piece->nStart && nEnd < (piece->nStart + piece->nCount)) {
CFX_RectFArray rcArr;
m_pTextSet->GetCharRects(piece, rcArr, FALSE);
CFX_RectF rectPiece = rcArr[0];
rectPiece.Union(rcArr[nEnd - piece->nStart]);
RectFArr.Add(rectPiece);
return;
}
RectFArr.Add(piece->rtPiece);
}
}
}
示例5: DisForm_GetBBox
FWL_ERR CFWL_DateTimePickerImp::DisForm_GetBBox(CFX_RectF& rect) {
rect = m_pProperties->m_rtWidget;
if (DisForm_IsNeedShowButton()) {
rect.width += m_fBtn;
}
if (IsMonthCalendarShowed()) {
CFX_RectF rtMonth;
m_pMonthCal->GetWidgetRect(rtMonth);
rtMonth.Offset(m_pProperties->m_rtWidget.left,
m_pProperties->m_rtWidget.top);
rect.Union(rtMonth);
}
return FWL_ERR_Succeeded;
}
示例6: GetBBox
FWL_ERR CFWL_DateTimePickerImp::GetBBox(CFX_RectF& rect) {
if (m_pWidgetMgr->IsFormDisabled()) {
return DisForm_GetBBox(rect);
}
rect = m_pProperties->m_rtWidget;
if (IsMonthCalendarShowed()) {
CFX_RectF rtMonth;
m_pMonthCal->GetWidgetRect(rtMonth);
rtMonth.Offset(m_pProperties->m_rtWidget.left,
m_pProperties->m_rtWidget.top);
rect.Union(rtMonth);
}
return FWL_ERR_Succeeded;
}
示例7: GetBBox
void IFWL_DateTimePicker::GetBBox(CFX_RectF& rect) const {
if (m_pWidgetMgr->IsFormDisabled()) {
DisForm_GetBBox(rect);
return;
}
rect = m_pProperties->m_rtWidget;
if (IsMonthCalendarVisible()) {
CFX_RectF rtMonth;
m_pMonthCal->GetWidgetRect(rtMonth);
rtMonth.Offset(m_pProperties->m_rtWidget.left,
m_pProperties->m_rtWidget.top);
rect.Union(rtMonth);
}
}
示例8: GetBBox
FX_BOOL CXFA_FFDateTimeEdit::GetBBox(CFX_RectF& rtBox,
FX_DWORD dwStatus,
FX_BOOL bDrawFocus) {
if (bDrawFocus) {
return FALSE;
}
#ifndef _XFA_EMB
return CXFA_FFWidget::GetBBox(rtBox, dwStatus);
#endif
GetRectWithoutRotate(rtBox);
if (m_pNormalWidget) {
CFX_RectF rtWidget;
((CFWL_DateTimePicker*)m_pNormalWidget)->GetBBox(rtWidget);
rtBox.Union(rtWidget);
}
CFX_Matrix mt;
GetRotateMatrix(mt);
mt.TransformRect(rtBox);
return TRUE;
}
示例9: OnMouseMoveEx
void CFWL_DateTimeCalendarImpDelegate::OnMouseMoveEx(CFWL_MsgMouse* pMsg) {
if (m_pOwner->m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) {
return;
}
FX_BOOL bRepaint = FALSE;
CFX_RectF rtInvalidate;
rtInvalidate.Set(0, 0, 0, 0);
if (m_pOwner->m_rtDates.Contains(pMsg->m_fx, pMsg->m_fy)) {
int32_t iHover = m_pOwner->GetDayAtPoint(pMsg->m_fx, pMsg->m_fy);
bRepaint = m_pOwner->m_iHovered != iHover;
if (bRepaint) {
if (m_pOwner->m_iHovered > 0) {
m_pOwner->GetDayRect(m_pOwner->m_iHovered, rtInvalidate);
}
if (iHover > 0) {
CFX_RectF rtDay;
m_pOwner->GetDayRect(iHover, rtDay);
if (rtInvalidate.IsEmpty()) {
rtInvalidate = rtDay;
} else {
rtInvalidate.Union(rtDay);
}
}
}
m_pOwner->m_iHovered = iHover;
CFWL_Event_DtpHoverChanged ev;
ev.hoverday = iHover;
m_pOwner->DispatchEvent(&ev);
} else {
bRepaint = m_pOwner->m_iHovered > 0;
if (bRepaint) {
m_pOwner->GetDayRect(m_pOwner->m_iHovered, rtInvalidate);
}
m_pOwner->m_iHovered = -1;
}
if (bRepaint && !rtInvalidate.IsEmpty()) {
m_pOwner->Repaint(&rtInvalidate);
}
}
示例10: ChangeSelected
void CFWL_ComboList::ChangeSelected(int32_t iSel) {
CFWL_ListItem* hItem = GetItem(this, iSel);
CFWL_ListItem* hOld = GetSelItem(0);
int32_t iOld = GetItemIndex(this, hOld);
if (iOld == iSel)
return;
CFX_RectF rtInvalidate;
if (iOld > -1) {
if (CFWL_ListItem* hOldItem = GetItem(this, iOld))
rtInvalidate = hOldItem->GetRect();
SetSelItem(hOld, false);
}
if (hItem) {
if (CFWL_ListItem* hOldItem = GetItem(this, iSel))
rtInvalidate.Union(hOldItem->GetRect());
CFWL_ListItem* hSel = GetItem(this, iSel);
SetSelItem(hSel, true);
}
if (!rtInvalidate.IsEmpty())
RepaintRect(rtInvalidate);
}
示例11: GetCharIndex
int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint,
FX_BOOL& bBefore) {
FX_BOOL bVertical = m_pEditEngine->GetEditParams()->dwLayoutStyles &
FDE_TEXTEDITLAYOUT_DocVertical;
CFX_PointF ptF = fPoint;
NormalizePt2Rect(ptF, m_rtPageContents, kTolerance);
int32_t nCount = m_PieceMassArr.GetSize();
CFX_RectF rtLine;
int32_t nBgn = 0;
int32_t nEnd = 0;
FX_BOOL bInLine = FALSE;
int32_t i = 0;
for (i = 0; i < nCount; i++) {
const FDE_TEXTEDITPIECE* pPiece = m_PieceMassArr.GetPtrAt(i);
if (!bInLine && (bVertical ? (pPiece->rtPiece.left <= ptF.x &&
pPiece->rtPiece.right() > ptF.x)
: (pPiece->rtPiece.top <= ptF.y &&
pPiece->rtPiece.bottom() > ptF.y))) {
nBgn = nEnd = i;
rtLine = pPiece->rtPiece;
bInLine = TRUE;
} else if (bInLine) {
if (bVertical ? (!(pPiece->rtPiece.left <= ptF.x &&
pPiece->rtPiece.right() > ptF.x))
: (pPiece->rtPiece.bottom() <= ptF.y ||
pPiece->rtPiece.top > ptF.y)) {
nEnd = i - 1;
break;
} else {
rtLine.Union(pPiece->rtPiece);
}
}
}
NormalizePt2Rect(ptF, rtLine, kTolerance);
int32_t nCaret = 0;
FDE_TEXTEDITPIECE* pPiece = nullptr;
for (i = nBgn; i <= nEnd; i++) {
pPiece = m_PieceMassArr.GetPtrAt(i);
nCaret = m_nPageStart + pPiece->nStart;
if (pPiece->rtPiece.Contains(ptF)) {
CFX_RectFArray rectArr;
m_pTextSet->GetCharRects(pPiece, rectArr, FALSE);
int32_t nRtCount = rectArr.GetSize();
for (int32_t j = 0; j < nRtCount; j++) {
if (rectArr[j].Contains(ptF)) {
nCaret = m_nPageStart + pPiece->nStart + j;
if (nCaret >= m_pEditEngine->GetTextBufLength()) {
bBefore = TRUE;
return m_pEditEngine->GetTextBufLength();
}
FX_WCHAR wChar = m_pEditEngine->GetTextBuf()->GetCharByIndex(nCaret);
if (wChar == L'\n' || wChar == L'\r') {
if (wChar == L'\n') {
if (m_pEditEngine->GetTextBuf()->GetCharByIndex(nCaret - 1) ==
L'\r') {
nCaret--;
}
}
bBefore = TRUE;
return nCaret;
}
if (bVertical
? (ptF.y > ((rectArr[j].top + rectArr[j].bottom()) / 2))
: (ptF.x > ((rectArr[j].left + rectArr[j].right()) / 2))) {
bBefore = FX_IsOdd(pPiece->nBidiLevel);
} else {
bBefore = !FX_IsOdd(pPiece->nBidiLevel);
}
return nCaret;
}
}
}
}
bBefore = TRUE;
return nCaret;
}
示例12: IsNeedRepaint
FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget,
CFX_Matrix* pMatrix,
const CFX_RectF& rtDirty) {
CFWL_WidgetMgrItem* pItem = m_pWidgetMgr->GetWidgetMgrItem(pWidget);
if (pItem && pItem->iRedrawCounter > 0) {
pItem->iRedrawCounter = 0;
return TRUE;
}
CFX_RectF rtWidget;
pWidget->GetWidgetRect(rtWidget);
rtWidget.left = rtWidget.top = 0;
pMatrix->TransformRect(rtWidget);
if (!rtWidget.IntersectWith(rtDirty))
return FALSE;
IFWL_Widget* pChild =
CFWL_WidgetMgr::GetInstance()->GetFirstChildWidget(pWidget);
if (!pChild)
return TRUE;
CFX_RectF rtChilds;
rtChilds.Empty();
FX_BOOL bChildIntersectWithDirty = FALSE;
FX_BOOL bOrginPtIntersectWidthChild = FALSE;
FX_BOOL bOrginPtIntersectWidthDirty =
rtDirty.Contains(rtWidget.left, rtWidget.top);
static FWL_NEEDREPAINTHITDATA hitPoint[kNeedRepaintHitPoints];
FXSYS_memset(hitPoint, 0, sizeof(hitPoint));
FX_FLOAT fxPiece = rtWidget.width / kNeedRepaintHitPiece;
FX_FLOAT fyPiece = rtWidget.height / kNeedRepaintHitPiece;
hitPoint[2].hitPoint.x = hitPoint[6].hitPoint.x = rtWidget.left;
hitPoint[0].hitPoint.x = hitPoint[3].hitPoint.x = hitPoint[7].hitPoint.x =
hitPoint[10].hitPoint.x = fxPiece + rtWidget.left;
hitPoint[1].hitPoint.x = hitPoint[4].hitPoint.x = hitPoint[8].hitPoint.x =
hitPoint[11].hitPoint.x = fxPiece * 2 + rtWidget.left;
hitPoint[5].hitPoint.x = hitPoint[9].hitPoint.x =
rtWidget.width + rtWidget.left;
hitPoint[0].hitPoint.y = hitPoint[1].hitPoint.y = rtWidget.top;
hitPoint[2].hitPoint.y = hitPoint[3].hitPoint.y = hitPoint[4].hitPoint.y =
hitPoint[5].hitPoint.y = fyPiece + rtWidget.top;
hitPoint[6].hitPoint.y = hitPoint[7].hitPoint.y = hitPoint[8].hitPoint.y =
hitPoint[9].hitPoint.y = fyPiece * 2 + rtWidget.top;
hitPoint[10].hitPoint.y = hitPoint[11].hitPoint.y =
rtWidget.height + rtWidget.top;
do {
CFX_RectF rect;
pChild->GetWidgetRect(rect);
CFX_RectF r = rect;
r.left += rtWidget.left;
r.top += rtWidget.top;
if (r.IsEmpty())
continue;
if (r.Contains(rtDirty))
return FALSE;
if (!bChildIntersectWithDirty && r.IntersectWith(rtDirty))
bChildIntersectWithDirty = TRUE;
if (bOrginPtIntersectWidthDirty && !bOrginPtIntersectWidthChild)
bOrginPtIntersectWidthChild = rect.Contains(0, 0);
if (rtChilds.IsEmpty())
rtChilds = rect;
else if (!(pChild->GetStates() & FWL_WGTSTATE_Invisible))
rtChilds.Union(rect);
for (int32_t i = 0; i < kNeedRepaintHitPoints; i++) {
if (hitPoint[i].bNotContainByDirty || hitPoint[i].bNotNeedRepaint)
continue;
if (!rtDirty.Contains(hitPoint[i].hitPoint)) {
hitPoint[i].bNotContainByDirty = true;
continue;
}
if (r.Contains(hitPoint[i].hitPoint))
hitPoint[i].bNotNeedRepaint = true;
}
pChild = CFWL_WidgetMgr::GetInstance()->GetNextSiblingWidget(pChild);
} while (pChild);
if (!bChildIntersectWithDirty)
return TRUE;
if (bOrginPtIntersectWidthDirty && !bOrginPtIntersectWidthChild)
return TRUE;
if (rtChilds.IsEmpty())
return TRUE;
int32_t repaintPoint = kNeedRepaintHitPoints;
for (int32_t i = 0; i < kNeedRepaintHitPoints; i++) {
if (hitPoint[i].bNotNeedRepaint)
repaintPoint--;
}
if (repaintPoint > 0)
return TRUE;
pMatrix->TransformRect(rtChilds);
if (rtChilds.Contains(rtDirty) || rtChilds.Contains(rtWidget))
return FALSE;
return TRUE;
}