本文整理汇总了C++中IFWL_Widget::Update方法的典型用法代码示例。如果您正苦于以下问题:C++ IFWL_Widget::Update方法的具体用法?C++ IFWL_Widget::Update怎么用?C++ IFWL_Widget::Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFWL_Widget
的用法示例。
在下文中一共展示了IFWL_Widget::Update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAllWidgetsRect
//.........这里部分代码省略.........
FX_FLOAT fColumnWidth = 0;
if (iColumns > 0) {
for (int32_t j = 0; j < pInfo->m_iColumnSpan; j++) {
CFWL_GridColRow* pCol = reinterpret_cast<CFWL_GridColRow*>(
GetColRow(TRUE, pInfo->m_iColumn + j));
if (!pCol) {
break;
}
fColumnWidth += pCol->m_fActualSize;
}
} else {
fColumnWidth = m_pProperties->m_rtWidget.width;
}
FX_FLOAT fRowHeight = 0;
if (iRows > 0) {
for (int32_t k = 0; k < pInfo->m_iRowSpan; k++) {
CFWL_GridColRow* pR = reinterpret_cast<CFWL_GridColRow*>(
GetColRow(FALSE, pInfo->m_iRow + k));
if (!pR) {
break;
}
fRowHeight += pR->m_fActualSize;
}
} else {
fRowHeight = m_pProperties->m_rtWidget.height;
}
FX_FLOAT fLeftMargin = 0, fRightMargin = 0;
FX_BOOL bLeftMargin =
GetWidgetMargin(pWidget, FWL_GRIDMARGIN_Left, fLeftMargin);
FX_BOOL bRightMargin =
GetWidgetMargin(pWidget, FWL_GRIDMARGIN_Right, fRightMargin);
FX_FLOAT fTopMargin = 0, fBottomMargin = 0;
FX_BOOL bTopMargin =
GetWidgetMargin(pWidget, FWL_GRIDMARGIN_Top, fTopMargin);
FX_BOOL bBottomMargin =
GetWidgetMargin(pWidget, FWL_GRIDMARGIN_Bottom, fBottomMargin);
if (pInfo->m_Size[FWL_GRIDSIZE_Width].eUnit == FWL_GRIDUNIT_Fixed) {
SetWidgetActualWidth(pInfo, pInfo->m_Size[FWL_GRIDSIZE_Width].fLength);
} else {
if (bLeftMargin && bRightMargin) {
SetWidgetActualWidth(pInfo, fColumnWidth - fLeftMargin - fRightMargin);
} else {
CFX_RectF rtAuto;
pWidget->GetWidgetRect(rtAuto, TRUE);
SetWidgetActualWidth(pInfo, rtAuto.width);
}
}
if (pInfo->m_Size[FWL_GRIDSIZE_Height].eUnit == FWL_GRIDUNIT_Fixed) {
SetWidgetActualHeight(pInfo, pInfo->m_Size[FWL_GRIDSIZE_Height].fLength);
} else {
if (bTopMargin && bBottomMargin) {
SetWidgetActualHeight(pInfo, fRowHeight - fTopMargin - fBottomMargin);
} else {
CFX_RectF rtAuto;
pWidget->GetWidgetRect(rtAuto, TRUE);
SetWidgetActualHeight(pInfo, rtAuto.height);
}
}
if (bLeftMargin && bRightMargin &&
pInfo->m_Size[FWL_GRIDSIZE_Width].eUnit == FWL_GRIDUNIT_Fixed) {
fLeftMargin =
fColumnStart + fLeftMargin +
(fColumnWidth - fLeftMargin - fRightMargin - pInfo->m_fActualWidth) /
2;
} else if (bLeftMargin) {
fLeftMargin = fColumnStart + fLeftMargin;
} else if (bRightMargin) {
fLeftMargin =
fColumnStart + fColumnWidth - fRightMargin - pInfo->m_fActualWidth;
} else {
fLeftMargin = fColumnStart;
}
if (bTopMargin && bBottomMargin &&
pInfo->m_Size[FWL_GRIDSIZE_Height].eUnit == FWL_GRIDUNIT_Fixed) {
fTopMargin =
fRowStart + fTopMargin +
(fRowHeight - fTopMargin - fBottomMargin - pInfo->m_fActualHeight) /
2;
} else if (bTopMargin) {
fTopMargin = fRowStart + fTopMargin;
} else if (bBottomMargin) {
fTopMargin =
fRowStart + fRowHeight - fBottomMargin - pInfo->m_fActualHeight;
} else {
fTopMargin = fRowStart;
}
CFX_RectF rtWidget, rtOld;
rtWidget.Set(fLeftMargin, fTopMargin, pInfo->m_fActualWidth,
pInfo->m_fActualHeight);
pWidget->GetWidgetRect(rtOld);
if (rtWidget == rtOld) {
continue;
}
pWidget->SetWidgetRect(rtWidget);
if (rtWidget.width == rtOld.width && rtWidget.height == rtOld.height) {
continue;
}
pWidget->Update();
}
}