本文整理汇总了C++中Base::Bottom方法的典型用法代码示例。如果您正苦于以下问题:C++ Base::Bottom方法的具体用法?C++ Base::Bottom怎么用?C++ Base::Bottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base::Bottom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateScrollBars
void ScrollControl::UpdateScrollBars()
{
if ( !m_InnerPanel )
return;
int childrenWidth = 0;
int childrenHeight = 0;
//Get the max size of all our children together
for ( Base::List::iterator iter = m_InnerPanel->Children.begin(); iter != m_InnerPanel->Children.end(); ++iter )
{
Base* pChild = *iter;
childrenWidth = Utility::Max( childrenWidth, pChild->Right() );
childrenHeight = Utility::Max( childrenHeight, pChild->Bottom() );
}
m_InnerPanel->SetSize( Utility::Max(Width(), childrenWidth), Utility::Max(Height(), childrenHeight));
float hg = (float)(childrenWidth + (m_VerticalScrollBar->Hidden() ? 0 : m_VerticalScrollBar->Width()));
if (hg==0.f)
hg = 0.00001f;
float wPercent = (float)Width() / hg;
hg = (float)(childrenHeight + (m_HorizontalScrollBar->Hidden() ? 0 : m_HorizontalScrollBar->Height()));
if (hg==0.f)
hg = 0.00001f;
float hPercent = (float)Height() / hg;
if ( m_bCanScrollV )
SetVScrollRequired( hPercent >= 1 );
else
m_VerticalScrollBar->SetHidden( true );
if ( m_bCanScrollH )
SetHScrollRequired( wPercent >= 1 );
else
m_HorizontalScrollBar->SetHidden( true );
m_VerticalScrollBar->SetContentSize( m_InnerPanel->Height() );
m_VerticalScrollBar->SetViewableContentSize( Height() - (m_HorizontalScrollBar->Hidden() ? 0 : m_HorizontalScrollBar->Height()));
m_HorizontalScrollBar->SetContentSize( m_InnerPanel->Width() );
m_HorizontalScrollBar->SetViewableContentSize( Width() - (m_VerticalScrollBar->Hidden() ? 0 : m_VerticalScrollBar->Width()) );
int newInnerPanelPosX = 0;
int newInnerPanelPosY = 0;
if ( CanScrollV() && !m_VerticalScrollBar->Hidden() )
{
newInnerPanelPosY = -( ( m_InnerPanel->Height() ) - Height() + (m_HorizontalScrollBar->Hidden() ? 0 : m_HorizontalScrollBar->Height()) ) * m_VerticalScrollBar->GetScrolledAmount();
}
if ( CanScrollH() && !m_HorizontalScrollBar->Hidden() )
{
newInnerPanelPosX = - ( ( m_InnerPanel->Width() ) - Width() + (m_VerticalScrollBar->Hidden() ? 0 : m_VerticalScrollBar->Width())) * m_HorizontalScrollBar->GetScrolledAmount();
}
m_InnerPanel->SetPos( newInnerPanelPosX , newInnerPanelPosY );
}
示例2: ChildrenSize
Gwen::Point Base::ChildrenSize()
{
Gwen::Point size;
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if ( pChild->Hidden() ) continue;
size.x = GwenUtil_Max( size.x, pChild->Right() );
size.y = GwenUtil_Max( size.y, pChild->Bottom() );
}
return size;
}
示例3: ChildrenSize
gwen::Point Base::ChildrenSize()
{
gwen::Point size;
for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter )
{
Base* pChild = *iter;
if ( pChild->Hidden() ) { continue; }
if ( !pChild->ShouldIncludeInSize() ) { continue; }
size.x = gwen::Max( size.x, pChild->Right() );
size.y = gwen::Max( size.y, pChild->Bottom() );
}
return size;
}