本文整理汇总了C++中nuiRect::Size方法的典型用法代码示例。如果您正苦于以下问题:C++ nuiRect::Size方法的具体用法?C++ nuiRect::Size怎么用?C++ nuiRect::Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nuiRect
的用法示例。
在下文中一共展示了nuiRect::Size方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetRect
bool nuiStateDummy::SetRect(const nuiRect& rRect)
{
nuiWidget::SetRect(rRect);
nuiWidgetPtr pWidget = mpState[(IsEnabled(mCombined)?1:0) + (IsSelected(mCombined)?2:0)];
if (pWidget)
pWidget->SetLayout(rRect.Size());
return true;
}
示例2: SetRect
bool nuiLayout::SetRect(const nuiRect& rRect)
{
nuiWidget::SetRect(rRect);
//NGL_OUT("nuiLayout::SetRect(%s)\n", rRect.GetValue().GetChars());
nuiRect r(rRect.Size());
DoLayout(r);
return true;
}
示例3: SetRect
bool nuiButton::SetRect(const nuiRect& rRect)
{
nuiWidget::SetRect(rRect);
nuiRect Rect = rRect.Size();
IteratorPtr pIt;
for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
{
nuiWidgetPtr pItem = pIt->GetWidget();
if (pItem)
pItem->SetLayout(Rect);
}
delete pIt;
return true;
}
示例4: SetRect
bool nuiWindow::SetRect(const nuiRect& rRect)
{
//NGL_OUT(_T("nuiWindow::SetRect\n"));
nuiWidget::SetRect(rRect);
nuiRect Rect = GetRectFromFlags(rRect.Size(), GetFlags(), false);
LayoutConstraint constraint;
constraint.mMaxWidth = Rect.GetWidth();
constraint.mMaxHeight = Rect.GetHeight();
nuiWidgetList::iterator it;
nuiWidgetList::iterator end = mpChildren.end();
for (it=mpChildren.begin(); it != end; ++it)
{
nuiWidgetPtr pItem = *it;
if (pItem != mpCloseButton)
{
if (mStaticChildren)
{
// Children are static, honor their size and position requests.
pItem->SetLayout(pItem->GetIdealRect());
}
else
{
// Children are not static, let's ignore their request...
pItem->SetLayoutConstraint(constraint);
pItem->GetIdealRect();
pItem->SetLayout(Rect);
}
}
else
{
nuiRect r(Rect);
r.Move(Rect.GetWidth() - 18, -21);
r.SetSize((long)12,(long)15);
pItem->SetLayout(r);
}
}
return true;
}
示例5: SetRect
bool nuiPositioner::SetRect(const nuiRect& rRect)
{
nuiWidget::SetRect(rRect);
//NGL_OUT(_T("nuiPositioner::SetRect: %d x %d\n"),(int)rRect.GetWidth(),(int)rRect.GetHeight());
nuiWidget::LayoutConstraint contraint;
contraint.mMaxWidth = rRect.GetWidth();
contraint.mMaxHeight = rRect.GetHeight();
IteratorPtr pIt;
for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
{
nuiWidgetPtr pItem = pIt->GetWidget();
pItem->SetLayoutConstraint(contraint);
}
delete pIt;
mIdealRect = CalcIdealSize();
nuiRect mainrect(rRect.Size());
pIt = NULL;
for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
{
nuiWidgetPtr pItem = pIt->GetWidget();
nuiRect rect = pItem->GetIdealRect().Size();
if (mExpandWidth)
rect.SetSize(mainrect.GetWidth(), rect.GetHeight());
if (mExpandHeight)
rect.SetSize(rect.GetWidth(), mainrect.GetHeight());
rect.SetPosition(mPPosition, mainrect);
if (mLimitBounds)
rect.Intersect(rect, mainrect);
rect.RoundToBiggest();
pItem->SetLayout(rect);
}
delete pIt;
return true;
}
示例6: SetRect
bool nuiToggleButton::SetRect(const nuiRect& rRect)
{
if (mDisplayAsFrameBox)
{
nuiWidget::SetRect(rRect);
nuiRect rect(rRect.Size());
//rect.Grow(-2,-2);
IteratorPtr pIt;
for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
{
nuiWidgetPtr pItem = pIt->GetWidget();
if (mCanRespectConstraint)
pItem->SetLayoutConstraint(mConstraint);
pItem->GetIdealRect();
pItem->SetLayout(rect);
}
delete pIt;
return true;
}
return nuiButton::SetRect(rRect);
}
示例7: SetRect
bool nuiFrameView::SetRect(const nuiRect& rRect)
{
nuiRect r(rRect.Size());
if (mpFrame)
mpFrame->GlobalToClientRect(r, this);
nuiWidget::SetRect(rRect);
IteratorPtr pIt;
for (pIt = GetFirstChild(); pIt && pIt->IsValid(); GetNextChild(pIt))
{
nuiWidgetPtr pItem = pIt->GetWidget();
if (mCanRespectConstraint)
pItem->SetLayoutConstraint(mConstraint);
pItem->GetIdealRect();
r.RoundToSmallest();
pItem->SetLayout(r);
}
delete pIt;
DebugRefreshInfo();
return true;
}