本文整理汇总了C++中PageView::forceDoLayout方法的典型用法代码示例。如果您正苦于以下问题:C++ PageView::forceDoLayout方法的具体用法?C++ PageView::forceDoLayout怎么用?C++ PageView::forceDoLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageView
的用法示例。
在下文中一共展示了PageView::forceDoLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refreshLayout
//.........这里部分代码省略.........
ownerPosition.x = _leftMargin + ownerAnchor.x * ownerSize.width;
break;
case HorizontalEdge::Right:
if (_isPercentOnly)
break;
if (_usingPercentWidth || _usingStretchWidth)
ownerSize.width = parentSize.width * _percentWidth;
ownerPosition.x = parentSize.width - (_rightMargin + (1 - ownerAnchor.x) * ownerSize.width);
break;
case HorizontalEdge::Center:
if (_isPercentOnly)
break;
if (_usingStretchWidth)
{
ownerSize.width = parentSize.width - _leftMargin - _rightMargin;
if (ownerSize.width < 0)
ownerSize.width = 0;
ownerPosition.x = _leftMargin + ownerAnchor.x * ownerSize.width;
}
else
{
if (_usingPercentWidth)
ownerSize.width = parentSize.width * _percentWidth;
ownerPosition.x = parentSize.width * _positionPercentX;
}
break;
default:
break;
}
switch (this->_verticalEdge)
{
case VerticalEdge::None:
if (_usingStretchHeight && !_isPercentOnly)
{
ownerSize.height = parentSize.height * _percentHeight;
ownerPosition.y = _bottomMargin + ownerAnchor.y * ownerSize.height;
}
else
{
if (_usingPositionPercentY)
ownerPosition.y = parentSize.height * _positionPercentY;
if (_usingPercentHeight)
ownerSize.height = parentSize.height * _percentHeight;
}
break;
case VerticalEdge::Bottom:
if (_isPercentOnly)
break;
if (_usingPercentHeight || _usingStretchHeight)
ownerSize.height = parentSize.height * _percentHeight;
ownerPosition.y = _bottomMargin + ownerAnchor.y * ownerSize.height;
break;
case VerticalEdge::Top:
if (_isPercentOnly)
break;
if (_usingPercentHeight || _usingStretchHeight)
ownerSize.height = parentSize.height * _percentHeight;
ownerPosition.y = parentSize.height - (_topMargin + (1 - ownerAnchor.y) * ownerSize.height);
break;
case VerticalEdge::Center:
if (_isPercentOnly)
break;
if (_usingStretchHeight)
{
ownerSize.height = parentSize.height - _topMargin - _bottomMargin;
if (ownerSize.height < 0)
ownerSize.height = 0;
ownerPosition.y = _bottomMargin + ownerAnchor.y * ownerSize.height;
}
else
{
if (_usingPercentHeight)
ownerSize.height = parentSize.height * _percentHeight;
ownerPosition.y = parentSize.height* _positionPercentY;
}
break;
default:
break;
}
_owner->setPosition(ownerPosition);
_owner->setContentSize(ownerSize);
if (typeid(*_owner) == typeid(PageView))
{
PageView* page = static_cast<PageView*>(_owner);
page->forceDoLayout();
Vector<Widget*> _widgetVector = page->getItems();
for(auto& item : _widgetVector)
{
ui::Helper::doLayout(item);
}
}
else
{
ui::Helper::doLayout(_owner);
}
}