本文整理汇总了C++中nuiRect::GetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ nuiRect::GetValue方法的具体用法?C++ nuiRect::GetValue怎么用?C++ nuiRect::GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nuiRect
的用法示例。
在下文中一共展示了nuiRect::GetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetRect
bool nuiScrollView::SetRect(const nuiRect& rRect)
{
#ifdef _DEBUG_LAYOUT
if (GetDebug())
{
NGL_OUT(_T("nuiScrollView::SetRect: %s\n"), rRect.GetValue().GetChars());
}
#endif
nuiWidget::SetRect(rRect);
if (!mpHorizontal || !mpVertical)
return false;
nuiSize XOffset = mpHorizontal->GetRange().GetValue();
nuiSize YOffset = mpVertical->GetRange().GetValue();
if (mSmoothScrolling)
{
if (!mHThumbPressed)
XOffset = mXOffset;
if (!mVThumbPressed)
YOffset = mYOffset;
}
mXOffset = XOffset;
mYOffset = YOffset;
XOffset = (nuiSize)ToNearest(XOffset);
YOffset = (nuiSize)ToNearest(YOffset);
GetIdealRect();
nuiRect rIdealRect(mChildrenUnionRect); ///< needed because GetIdealRect may return a UserRect
if (mMinimalResize)
{
rIdealRect.Right() = MAX(rIdealRect.Right(), mOldIdealRect.Right());
rIdealRect.Bottom() = MAX(rIdealRect.Bottom(), mOldIdealRect.Bottom());
mOldIdealRect = rIdealRect;
}
nuiSize x = rIdealRect.GetWidth();
nuiSize y = rIdealRect.GetHeight();
nuiRange& hrange = mpHorizontal->GetRange();
nuiRange& vrange = mpVertical->GetRange();
if (mMinimalResize)
{
if( (hrange.GetValue() + hrange.GetPageSize()) < hrange.GetMaximum() )
{
x = mChildrenUnionRect.GetWidth();
mOldIdealRect = mChildrenUnionRect;
}
if( (vrange.GetValue() + vrange.GetPageSize()) < vrange.GetMaximum() )
{
y = mChildrenUnionRect.GetHeight();
mOldIdealRect = mChildrenUnionRect;
}
}
nuiSize xx = rRect.GetWidth();
nuiSize yy = rRect.GetHeight();
bool needv = y > yy;
bool needh = x > xx;
needh = needh && !mForceNoHorizontal;
needv = needv && !mForceNoVertical;
nuiSize scrollh = (needh && !mHorizontalIsExternal) ? mBarSize:0;
nuiSize scrollv = (needv && !mVerticalIsExternal) ? mBarSize:0;
for (int i = 0; i<2; i++)
{
if (needv && !mForceNoHorizontal)
{
needh = x > (xx - scrollv);
if (!mVerticalIsExternal)
scrollv = needv?mBarSize:0;
}
if (needh && !mForceNoVertical)
{
needv = y > (yy - scrollh);
if (!mHorizontalIsExternal)
scrollh = needh?mBarSize:0;
}
}
if (needh)
{
double pagesize = xx - scrollv;
if (mHideScrollBars)
pagesize = xx;
hrange.SetRange(0, x);
hrange.SetPageSize(MAX(0, pagesize));
hrange.SetPageIncrement(MAX(0, pagesize));
hrange.SetIncrement(mHIncrement);
hrange.EnableEvents(false);
//.........这里部分代码省略.........