本文整理汇总了C++中CFX_RectF::Inflate方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_RectF::Inflate方法的具体用法?C++ CFX_RectF::Inflate怎么用?C++ CFX_RectF::Inflate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_RectF
的用法示例。
在下文中一共展示了CFX_RectF::Inflate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWidgetRect
void IFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
if (!bAutoSize) {
rect = m_pProperties->m_rtWidget;
return;
}
if (HasEdge()) {
FX_FLOAT fEdge = GetEdgeWidth();
rect.Inflate(fEdge, fEdge);
}
if (HasBorder()) {
FX_FLOAT fBorder = GetBorderSize();
rect.Inflate(fBorder, fBorder);
}
}
示例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: GetWidgetRect
FWL_ERR CFWL_CheckBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pThemeProvider)
m_pProperties->m_pThemeProvider = GetAvailableTheme();
if (!m_pProperties->m_pThemeProvider)
return FWL_ERR_Indefinite;
if (!m_pProperties->m_pDataProvider)
return FWL_ERR_Indefinite;
CFX_WideString wsCaption;
m_pProperties->m_pDataProvider->GetCaption(m_pInterface, wsCaption);
if (wsCaption.GetLength() > 0) {
CFX_SizeF sz = CalcTextSize(
wsCaption, m_pProperties->m_pThemeProvider,
m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine);
rect.Set(0, 0, sz.x, sz.y);
}
rect.Inflate(FWL_CKB_CaptionMargin, FWL_CKB_CaptionMargin);
IFWL_CheckBoxDP* pData =
static_cast<IFWL_CheckBoxDP*>(m_pProperties->m_pDataProvider);
FX_FLOAT fCheckBox = pData->GetBoxSize(m_pInterface);
rect.width += fCheckBox;
if (rect.height < fCheckBox) {
rect.height = fCheckBox;
}
CFWL_WidgetImp::GetWidgetRect(rect, TRUE);
} else {
rect = m_pProperties->m_rtWidget;
}
return FWL_ERR_Succeeded;
}
示例4: GetWidgetRect
FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (m_pProperties->m_pThemeProvider == NULL) {
m_pProperties->m_pThemeProvider = GetAvailableTheme();
}
CFX_WideString wsCaption;
IFWL_PushButtonDP* pData =
static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider);
if (pData) {
pData->GetCaption(m_pInterface, wsCaption);
}
int32_t iLen = wsCaption.GetLength();
if (iLen > 0) {
CFX_SizeF sz = CalcTextSize(wsCaption, m_pProperties->m_pThemeProvider);
rect.Set(0, 0, sz.x, sz.y);
}
FX_FLOAT* fcaption =
static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_PSB_Margin));
rect.Inflate(*fcaption, *fcaption);
CFWL_WidgetImp::GetWidgetRect(rect, TRUE);
} else {
rect = m_pProperties->m_rtWidget;
}
return FWL_ERR_Succeeded;
}