本文整理汇总了C++中CFX_RectF::Offset方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_RectF::Offset方法的具体用法?C++ CFX_RectF::Offset怎么用?C++ CFX_RectF::Offset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_RectF
的用法示例。
在下文中一共展示了CFX_RectF::Offset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshToolTipPos
void CFWL_ToolTipImp::RefreshToolTipPos() {
if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_TTP_NoAnchor) == 0) {
CFX_RectF rtPopup;
CFX_RectF rtWidget(m_pProperties->m_rtWidget);
CFX_RectF rtAnchor(m_rtAnchor);
rtPopup.Set(0, 0, 0, 0);
FX_FLOAT fx = rtAnchor.Center().x + 20;
FX_FLOAT fy = rtAnchor.Center().y + 20;
rtPopup.Set(fx, fy, rtWidget.Width(), rtWidget.Height());
FX_FLOAT fScreenWidth = 0;
FX_FLOAT fScreenHeight = 0;
GetScreenSize(fScreenWidth, fScreenHeight);
if (rtPopup.bottom() > fScreenHeight) {
rtPopup.Offset(0, fScreenHeight - rtPopup.bottom());
}
if (rtPopup.right() > fScreenWidth) {
rtPopup.Offset(fScreenWidth - rtPopup.right(), 0);
}
if (rtPopup.left < 0) {
rtPopup.Offset(0 - rtPopup.left, 0);
}
if (rtPopup.top < 0) {
rtPopup.Offset(0, 0 - rtPopup.top);
}
SetWidgetRect(rtPopup);
Update();
}
}
示例2: GetCaretRect
void CFDE_TxtEdtEngine::GetCaretRect(CFX_RectF& rtCaret,
int32_t nPageIndex,
int32_t nCaret,
FX_BOOL bBefore) {
IFDE_TxtEdtPage* pPage = m_PagePtrArray[m_nCaretPage];
m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0);
FX_BOOL bCombText = m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_CombText;
int32_t nIndexInpage = nCaret - pPage->GetCharStart();
if (bBefore && bCombText && nIndexInpage > 0) {
nIndexInpage--;
bBefore = FALSE;
}
int32_t nBIDILevel = pPage->GetCharRect(nIndexInpage, rtCaret, bCombText);
if (m_Param.dwLayoutStyles & FDE_TEXTEDITLAYOUT_DocVertical) {
if ((!FX_IsOdd(nBIDILevel) && !bBefore) ||
(FX_IsOdd(nBIDILevel) && bBefore)) {
rtCaret.Offset(0, rtCaret.height - 1.0f);
}
if (rtCaret.height == 0 && rtCaret.top > 1.0f)
rtCaret.top -= 1.0f;
rtCaret.height = 1.0f;
} else {
if ((!FX_IsOdd(nBIDILevel) && !bBefore) ||
(FX_IsOdd(nBIDILevel) && bBefore)) {
rtCaret.Offset(rtCaret.width - 1.0f, 0);
}
if (rtCaret.width == 0 && rtCaret.left > 1.0f)
rtCaret.left -= 1.0f;
rtCaret.width = 1.0f;
}
m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0);
}
示例3: DrawCaption
void CFWL_FormTP::DrawCaption(CFX_Graphics* pGraphics,
const CFX_RectF* pRect,
FWLTHEME_STATE eState,
CFX_Matrix* pMatrix,
int32_t iActive) {
CFX_RectF rt;
FX_FLOAT fBottom, fRight;
fBottom = pRect->bottom();
fRight = pRect->right();
rt.Set(pRect->left, pRect->top, pRect->width, 1);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][0], &rt,
pMatrix);
rt.Offset(0, 1);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][1], &rt,
pMatrix);
rt.Offset(0, 1);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeTop[iActive][2], &rt,
pMatrix);
rt.Set(pRect->left, pRect->bottom() - 1, pRect->width, 1);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeBottom[iActive][2], &rt,
pMatrix);
rt.Offset(0, -1);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeBottom[iActive][1], &rt,
pMatrix);
rt.Set(pRect->left, pRect->top, 1, pRect->height);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][2], &rt,
pMatrix);
rt.Set(pRect->left + 1, pRect->top + 1, 1, fBottom - 1);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][1], &rt,
pMatrix);
rt.Set(pRect->left + 2, pRect->top + 2, 1, fBottom - 2);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeLeft[iActive][0], &rt,
pMatrix);
rt.Set(fRight - 1, pRect->top, pRect->width, pRect->height);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][2], &rt,
pMatrix);
rt.Set(fRight - 2, pRect->top + 1, 1, fBottom - 1);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][1], &rt,
pMatrix);
rt.Set(fRight - 3, pRect->top + 2, 1, fBottom - 2);
FillSoildRect(pGraphics, m_pThemeData->clrHeadEdgeRight[iActive][0], &rt,
pMatrix);
CFX_RectF rect(*pRect);
rect.Set(rect.left + 3, rect.top + 3, rect.width - 6, rect.height - 5);
if (iActive == 0) {
pGraphics->StretchImage(m_pActiveBitmap, rect, pMatrix);
} else {
pGraphics->StretchImage(m_pDeactivebitmap, rect, pMatrix);
}
}
示例4: DisForm_OnProcessMessage
int32_t CFWL_DateTimeEditImpDelegate::DisForm_OnProcessMessage(
CFWL_Message* pMessage) {
FX_DWORD dwHashCode = pMessage->GetClassID();
if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
if (dwHashCode == FWL_MSGHASH_Mouse) {
CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage);
if (pMouse->m_dwCmd == FWL_MSGMOUSECMD_LButtonDown ||
pMouse->m_dwCmd == FWL_MSGMOUSECMD_RButtonDown) {
if ((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) {
m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
}
CFWL_DateTimePickerImp* pDateTime =
static_cast<CFWL_DateTimePickerImp*>(m_pOwner->m_pOuter->GetImpl());
if (pDateTime->IsMonthCalendarShowed()) {
CFX_RectF rtInvalidate;
pDateTime->GetWidgetRect(rtInvalidate);
pDateTime->ShowMonthCalendar(FALSE);
rtInvalidate.Offset(-rtInvalidate.left, -rtInvalidate.top);
pDateTime->Repaint(&rtInvalidate);
}
}
} else if (dwHashCode == FWL_MSGHASH_Key) {
return CFWL_EditImpDelegate::OnProcessMessage(pMessage);
}
}
return CFWL_EditImpDelegate::OnProcessMessage(pMessage);
}
示例5: GetPopupPosMenu
bool IFWL_Widget::GetPopupPosMenu(FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup) {
FX_FLOAT fx = 0;
FX_FLOAT fy = 0;
if (GetStylesEx() & FWL_STYLEEXT_MNU_Vert) {
bool bLeft = m_pProperties->m_rtWidget.left < 0;
FX_FLOAT fRight = rtAnchor.right() + rtPopup.width;
TransformTo(nullptr, fx, fy);
if (fRight + fx > 0.0f || bLeft) {
rtPopup.Set(rtAnchor.left - rtPopup.width, rtAnchor.top, rtPopup.width,
rtPopup.height);
} else {
rtPopup.Set(rtAnchor.right(), rtAnchor.top, rtPopup.width,
rtPopup.height);
}
} else {
FX_FLOAT fBottom = rtAnchor.bottom() + rtPopup.height;
TransformTo(nullptr, fx, fy);
if (fBottom + fy > 0.0f) {
rtPopup.Set(rtAnchor.left, rtAnchor.top - rtPopup.height, rtPopup.width,
rtPopup.height);
} else {
rtPopup.Set(rtAnchor.left, rtAnchor.bottom(), rtPopup.width,
rtPopup.height);
}
}
rtPopup.Offset(fx, fy);
return true;
}
示例6: CalCaption
void CFWL_FormTP::CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect) {
CFX_RectF rtWidget;
pWidget->GetWidgetRect(rtWidget);
rtWidget.Offset(-rtWidget.left, -rtWidget.top);
rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin,
rtWidget.top + FWLTHEME_FORMBTN_Margin - 2,
rtWidget.width - FWLTHEME_FORMBTN_Margin * 2,
FWLTHEME_FORMBTN_Size + 2 * FWLTHEME_FORMBTN_Margin + 4);
}
示例7: 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);
}
示例8: CalCloseBox
void CFWL_FormTP::CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect) {
FX_DWORD dwStyles = pWidget->GetStyles();
CFX_RectF rtWidget;
pWidget->GetWidgetRect(rtWidget);
rtWidget.Offset(-rtWidget.left, -rtWidget.top);
if (dwStyles & FWL_WGTSTYLE_CloseBox) {
rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span,
rtWidget.top + FWLTHEME_FORMBTN_Margin, FWLTHEME_FORMBTN_Size,
FWLTHEME_FORMBTN_Size);
} else {
rect.Set(rtWidget.left + FWLTHEME_FORMBTN_Margin + FWLTHEME_FORMBTN_Span,
rtWidget.top + FWLTHEME_FORMBTN_Margin, 0, 0);
}
}
示例9: 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;
}
示例10: 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;
}
示例11: 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);
}
}
示例12: ApplyClip
FX_BOOL CFDE_RenderContext::ApplyClip(IFDE_VisualSet* pVisualSet,
FDE_HVISUALOBJ hObj,
FDE_HDEVICESTATE& hState) {
CFX_RectF rtClip;
if (!pVisualSet->GetClip(hObj, rtClip)) {
return FALSE;
}
CFX_RectF rtObj;
pVisualSet->GetRect(hObj, rtObj);
rtClip.Offset(rtObj.left, rtObj.top);
m_Transform.TransformRect(rtClip);
const CFX_RectF& rtDevClip = m_pRenderDevice->GetClipRect();
rtClip.Intersect(rtDevClip);
hState = m_pRenderDevice->SaveState();
return m_pRenderDevice->SetClipRect(rtClip);
}
示例13: GetClientRect
FWL_ERR CFWL_ToolTipImp::GetClientRect(CFX_RectF& rect) {
FX_FLOAT x = 0;
FX_FLOAT y = 0;
FX_FLOAT t = 0;
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
if (pTheme) {
CFWL_ThemePart part;
part.m_pWidget = m_pInterface;
x = *static_cast<FX_FLOAT*>(
pTheme->GetCapacity(&part, FWL_WGTCAPACITY_CXBorder));
y = *static_cast<FX_FLOAT*>(
pTheme->GetCapacity(&part, FWL_WGTCAPACITY_CYBorder));
}
rect = m_pProperties->m_rtWidget;
rect.Offset(-rect.left, -rect.top);
rect.Deflate(x, t, x, y);
return FWL_ERR_Succeeded;
}
示例14: GetPopupPosGeneral
bool IFWL_Widget::GetPopupPosGeneral(FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup) {
FX_FLOAT fx = 0;
FX_FLOAT fy = 0;
TransformTo(nullptr, fx, fy);
if (rtAnchor.bottom() + fy > 0.0f) {
rtPopup.Set(rtAnchor.left, rtAnchor.top - rtPopup.height, rtPopup.width,
rtPopup.height);
} else {
rtPopup.Set(rtAnchor.left, rtAnchor.bottom(), rtPopup.width,
rtPopup.height);
}
rtPopup.Offset(fx, fy);
return true;
}
示例15: GetPopupPosComboBox
bool IFWL_Widget::GetPopupPosComboBox(FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup) {
FX_FLOAT fx = 0;
FX_FLOAT fy = 0;
FX_FLOAT fPopHeight = rtPopup.height;
if (rtPopup.height > fMaxHeight)
fPopHeight = fMaxHeight;
else if (rtPopup.height < fMinHeight)
fPopHeight = fMinHeight;
FX_FLOAT fWidth = std::max(rtAnchor.width, rtPopup.width);
FX_FLOAT fBottom = rtAnchor.bottom() + fPopHeight;
TransformTo(nullptr, fx, fy);
if (fBottom + fy > 0.0f)
rtPopup.Set(rtAnchor.left, rtAnchor.top - fPopHeight, fWidth, fPopHeight);
else
rtPopup.Set(rtAnchor.left, rtAnchor.bottom(), fWidth, fPopHeight);
rtPopup.Offset(fx, fy);
return true;
}