当前位置: 首页>>代码示例>>C++>>正文


C++ Base::Bottom方法代码示例

本文整理汇总了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 );
}
开发者ID:Ochakko,项目名称:MameBake3D,代码行数:60,代码来源:ScrollControl.cpp

示例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;
}
开发者ID:Ochakko,项目名称:MameBake3D,代码行数:15,代码来源:Base.cpp

示例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;
}
开发者ID:MegaThorx,项目名称:GWEN,代码行数:18,代码来源:Base.cpp


注:本文中的Base::Bottom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。