本文整理汇总了C++中CFX_RectF::Deflate方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_RectF::Deflate方法的具体用法?C++ CFX_RectF::Deflate怎么用?C++ CFX_RectF::Deflate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_RectF
的用法示例。
在下文中一共展示了CFX_RectF::Deflate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDrawWidget
void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) {
if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
(m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
CFX_RectF rtFill;
m_pNormalWidget->GetWidgetRect(rtFill);
rtFill.left = rtFill.top = 0;
FX_FLOAT fLineWith = GetLineWidth();
rtFill.Deflate(fLineWith, fLineWith);
CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255));
pGraphics->SetFillColor(&cr);
CFX_Path path;
path.Create();
path.AddRectangle(rtFill.left, rtFill.top, rtFill.width, rtFill.height);
pGraphics->FillPath(&path, FXFILL_WINDING, (CFX_Matrix*)pMatrix);
}
} else if (m_pNormalWidget->GetStylesEx() &
XFA_FWL_PSBSTYLEEXT_HiliteOutLine) {
if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
(m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
FX_FLOAT fLineWidth = GetLineWidth();
CFX_Color cr(FXARGB_MAKE(255, 128, 255, 255));
pGraphics->SetStrokeColor(&cr);
pGraphics->SetLineWidth(fLineWidth);
CFX_Path path;
path.Create();
CFX_RectF rect;
m_pNormalWidget->GetWidgetRect(rect);
path.AddRectangle(0, 0, rect.width, rect.height);
pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix);
}
}
}
示例2: GetRectFromHand
void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect,
int32_t iHand,
FX_FLOAT fLineWidth) {
FX_FLOAT fHalfWidth = fLineWidth / 2.0f;
if (rect.height < 1.0f) {
switch (iHand) {
case XFA_ATTRIBUTEENUM_Left:
rect.top -= fHalfWidth;
break;
case XFA_ATTRIBUTEENUM_Right:
rect.top += fHalfWidth;
}
} else if (rect.width < 1.0f) {
switch (iHand) {
case XFA_ATTRIBUTEENUM_Left:
rect.left += fHalfWidth;
break;
case XFA_ATTRIBUTEENUM_Right:
rect.left += fHalfWidth;
break;
}
} else {
switch (iHand) {
case XFA_ATTRIBUTEENUM_Left:
rect.Inflate(fHalfWidth, fHalfWidth);
break;
case XFA_ATTRIBUTEENUM_Right:
rect.Deflate(fHalfWidth, fHalfWidth);
break;
}
}
}
示例3: GetClientRect
void IFWL_Widget::GetClientRect(CFX_RectF& rect) {
GetEdgeRect(rect);
if (HasEdge()) {
FX_FLOAT fEdge = GetEdgeWidth();
rect.Deflate(fEdge, fEdge);
}
}
示例4: GetEdgeRect
void IFWL_Widget::GetEdgeRect(CFX_RectF& rtEdge) {
rtEdge = m_pProperties->m_rtWidget;
rtEdge.left = rtEdge.top = 0;
if (HasBorder()) {
FX_FLOAT fCX = GetBorderSize();
FX_FLOAT fCY = GetBorderSize(false);
rtEdge.Deflate(fCX, fCY);
}
}
示例5: 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;
}
示例6: CapPlacement
void CXFA_FFField::CapPlacement() {
CFX_RectF rtWidget;
GetRectWithoutRotate(rtWidget);
CXFA_Margin mgWidget = m_pDataAcc->GetMargin();
if (mgWidget) {
CXFA_LayoutItem* pItem = this;
FX_FLOAT fLeftInset = 0, fRightInset = 0, fTopInset = 0, fBottomInset = 0;
mgWidget.GetLeftInset(fLeftInset);
mgWidget.GetRightInset(fRightInset);
mgWidget.GetTopInset(fTopInset);
mgWidget.GetBottomInset(fBottomInset);
if (!pItem->GetPrev() && !pItem->GetNext()) {
rtWidget.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset);
} else {
if (!pItem->GetPrev()) {
rtWidget.Deflate(fLeftInset, fTopInset, fRightInset, 0);
} else if (!pItem->GetNext()) {
rtWidget.Deflate(fLeftInset, 0, fRightInset, fBottomInset);
} else {
rtWidget.Deflate(fLeftInset, 0, fRightInset, 0);
}
}
}
XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
FX_FLOAT fCapReserve = 0;
CXFA_Caption caption = m_pDataAcc->GetCaption();
if (caption && caption.GetPresence() != XFA_ATTRIBUTEENUM_Hidden) {
iCapPlacement = (XFA_ATTRIBUTEENUM)caption.GetPlacementType();
if (iCapPlacement == XFA_ATTRIBUTEENUM_Top && GetPrev()) {
m_rtCaption.Set(0, 0, 0, 0);
} else if (iCapPlacement == XFA_ATTRIBUTEENUM_Bottom && GetNext()) {
m_rtCaption.Set(0, 0, 0, 0);
} else {
fCapReserve = caption.GetReserve();
CXFA_LayoutItem* pItem = this;
if (!pItem->GetPrev() && !pItem->GetNext()) {
m_rtCaption.Set(rtWidget.left, rtWidget.top, rtWidget.width,
rtWidget.height);
} else {
pItem = pItem->GetFirst();
pItem->GetRect(m_rtCaption);
pItem = pItem->GetNext();
while (pItem) {
CFX_RectF rtRect;
pItem->GetRect(rtRect);
m_rtCaption.height += rtRect.Height();
pItem = pItem->GetNext();
}
XFA_RectWidthoutMargin(m_rtCaption, mgWidget);
}
CXFA_TextLayout* pCapTextLayout = m_pDataAcc->GetCaptionTextLayout();
if (fCapReserve <= 0 && pCapTextLayout) {
CFX_SizeF size;
CFX_SizeF minSize;
CFX_SizeF maxSize;
pCapTextLayout->CalcSize(minSize, maxSize, size);
if (iCapPlacement == XFA_ATTRIBUTEENUM_Top ||
iCapPlacement == XFA_ATTRIBUTEENUM_Bottom) {
fCapReserve = size.y;
} else {
fCapReserve = size.x;
}
}
}
}
m_rtUI = rtWidget;
switch (iCapPlacement) {
case XFA_ATTRIBUTEENUM_Left: {
m_rtCaption.width = fCapReserve;
CapLeftRightPlacement(caption, rtWidget, iCapPlacement);
m_rtUI.width -= fCapReserve;
m_rtUI.left += fCapReserve;
} break;
case XFA_ATTRIBUTEENUM_Top: {
m_rtCaption.height = fCapReserve;
CapTopBottomPlacement(caption, rtWidget, iCapPlacement);
m_rtUI.top += fCapReserve;
m_rtUI.height -= fCapReserve;
} break;
case XFA_ATTRIBUTEENUM_Right: {
m_rtCaption.left = m_rtCaption.right() - fCapReserve;
m_rtCaption.width = fCapReserve;
CapLeftRightPlacement(caption, rtWidget, iCapPlacement);
m_rtUI.width -= fCapReserve;
} break;
case XFA_ATTRIBUTEENUM_Bottom: {
m_rtCaption.top = m_rtCaption.bottom() - fCapReserve;
m_rtCaption.height = fCapReserve;
CapTopBottomPlacement(caption, rtWidget, iCapPlacement);
m_rtUI.height -= fCapReserve;
} break;
case XFA_ATTRIBUTEENUM_Inline:
break;
default:
break;
}
CXFA_Border borderUI = m_pDataAcc->GetUIBorder();
if (borderUI) {
CXFA_Margin margin = borderUI.GetMargin();
if (margin) {
//.........这里部分代码省略.........