本文整理汇总了C++中Base::Hidden方法的典型用法代码示例。如果您正苦于以下问题:C++ Base::Hidden方法的具体用法?C++ Base::Hidden怎么用?C++ Base::Hidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base
的用法示例。
在下文中一共展示了Base::Hidden方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoRender
void Base::DoRender( Gwen::Skin::Base* skin )
{
// If this control has a different skin,
// then so does its children.
if ( m_Skin )
skin = m_Skin;
// Do think
Think();
Gwen::Renderer::Base* render = skin->GetRender();
if ( render->GetCTT() && ShouldCacheToTexture() )
{
DoCacheRender( skin, this );
return;
}
Gwen::Point pOldRenderOffset = render->GetRenderOffset();
render->AddRenderOffset( GetBounds() );
RenderUnder( skin );
Gwen::Rect rOldRegion = render->ClipRegion();
render->AddClipRegion( GetBounds() );
if ( render->ClipRegionVisible() )
{
render->StartClip();
//Render myself first
Render( skin );
if ( !Children.empty() )
{
//Now render my kids
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if ( pChild->Hidden() ) continue;
pChild->DoRender( skin );
}
}
render->SetClipRegion( rOldRegion );
render->StartClip();
RenderOver( skin );
}
else
{
render->SetClipRegion( rOldRegion );
}
RenderFocus( skin );
render->SetRenderOffset( pOldRenderOffset );
}
示例2: RenderRecursive
void Base::RenderRecursive(Gwen::Skin::Base* skin, const Gwen::Rect& cliprect)
{
Gwen::Renderer::Base* render = skin->GetRender();
Gwen::Point pOldRenderOffset = render->GetRenderOffset();
render->AddRenderOffset(cliprect);
RenderUnder(skin);
Gwen::Rect rOldRegion = render->ClipRegion();
//
// If this control is clipping, change the clip rect to ourselves
// ( if not then we still clip using our parents clip rect )
//
if (ShouldClip())
{
render->AddClipRegion(cliprect);
if (!render->ClipRegionVisible())
{
render->SetRenderOffset(pOldRenderOffset);
render->SetClipRegion(rOldRegion);
return;
}
}
//
// Render this control and children controls
//
render->StartClip();
{
Render(skin);
if (!Children.empty())
{
// Now render my kids
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if (pChild->Hidden())
continue;
pChild->DoRender(skin);
}
}
}
render->EndClip();
//
// Render overlay/focus
//
{
render->SetClipRegion(rOldRegion);
render->StartClip();
{
RenderOver(skin);
RenderFocus(skin);
}
render->EndClip();
render->SetRenderOffset(pOldRenderOffset);
}
}
示例3: DoCacheRender
void Base::DoCacheRender( Gwen::Skin::Base* skin, Gwen::Controls::Base* pMaster )
{
Gwen::Renderer::Base* render = skin->GetRender();
Gwen::Renderer::ICacheToTexture* cache = render->GetCTT();
if ( !cache ) return;
Gwen::Point pOldRenderOffset = render->GetRenderOffset();
Gwen::Rect rOldRegion = render->ClipRegion();
if ( this != pMaster )
{
render->AddRenderOffset( GetBounds() );
render->AddClipRegion( GetBounds() );
}
else
{
render->SetRenderOffset( Gwen::Point( 0, 0 ) );
render->SetClipRegion( GetBounds() );
}
if ( m_bCacheTextureDirty && render->ClipRegionVisible() )
{
render->StartClip();
if ( ShouldCacheToTexture() )
cache->SetupCacheTexture( this );
//Render myself first
Render( skin );
if ( !Children.empty() )
{
//Now render my kids
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if ( pChild->Hidden() ) continue;
pChild->DoCacheRender( skin, pMaster );
}
}
if ( ShouldCacheToTexture() )
{
cache->FinishCacheTexture( this );
m_bCacheTextureDirty = false;
}
}
render->SetClipRegion( rOldRegion );
render->StartClip();
render->SetRenderOffset( pOldRenderOffset );
cache->DrawCachedControlTexture( this );
}
示例4: 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;
}
示例5: 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;
}
示例6: RecurseLayout
void Base::RecurseLayout( Skin::Base* skin )
{
if ( m_Skin ) { skin = m_Skin; }
if ( Hidden() ) { return; }
if ( NeedsLayout() )
{
m_bNeedsLayout = false;
Layout( skin );
}
Gwen::Rect rBounds = GetRenderBounds();
// Adjust bounds for padding
rBounds.x += m_Padding.left;
rBounds.w -= m_Padding.left + m_Padding.right;
rBounds.y += m_Padding.top;
rBounds.h -= m_Padding.top + m_Padding.bottom;
for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter )
{
Base* pChild = *iter;
if ( pChild->Hidden() )
{ continue; }
int iDock = pChild->GetDock();
if ( iDock & Pos::Fill )
{ continue; }
if ( iDock & Pos::Top )
{
const Margin & margin = pChild->GetMargin();
pChild->SetBounds( rBounds.x + margin.left, rBounds.y + margin.top, rBounds.w - margin.left - margin.right, pChild->Height() );
int iHeight = margin.top + margin.bottom + pChild->Height();
rBounds.y += iHeight;
rBounds.h -= iHeight;
}
if ( iDock & Pos::Left )
{
const Margin & margin = pChild->GetMargin();
pChild->SetBounds( rBounds.x + margin.left, rBounds.y + margin.top, pChild->Width(), rBounds.h - margin.top - margin.bottom );
int iWidth = margin.left + margin.right + pChild->Width();
rBounds.x += iWidth;
rBounds.w -= iWidth;
}
if ( iDock & Pos::Right )
{
// TODO: THIS MARGIN CODE MIGHT NOT BE FULLY FUNCTIONAL
const Margin & margin = pChild->GetMargin();
pChild->SetBounds( ( rBounds.x + rBounds.w ) - pChild->Width() - margin.right, rBounds.y + margin.top, pChild->Width(), rBounds.h - margin.top - margin.bottom );
int iWidth = margin.left + margin.right + pChild->Width();
rBounds.w -= iWidth;
}
if ( iDock & Pos::Bottom )
{
// TODO: THIS MARGIN CODE MIGHT NOT BE FULLY FUNCTIONAL
const Margin & margin = pChild->GetMargin();
pChild->SetBounds( rBounds.x + margin.left, ( rBounds.y + rBounds.h ) - pChild->Height() - margin.bottom, rBounds.w - margin.left - margin.right, pChild->Height() );
rBounds.h -= pChild->Height() + margin.bottom + margin.top;
}
pChild->RecurseLayout( skin );
}
m_InnerBounds = rBounds;
//
// Fill uses the left over space, so do that now.
//
for ( Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter )
{
Base* pChild = *iter;
int iDock = pChild->GetDock();
if ( !( iDock & Pos::Fill ) )
{ continue; }
const Margin & margin = pChild->GetMargin();
pChild->SetBounds( rBounds.x + margin.left, rBounds.y + margin.top, rBounds.w - margin.left - margin.right, rBounds.h - margin.top - margin.bottom );
pChild->RecurseLayout( skin );
}
PostLayout( skin );
if ( IsTabable() && !IsDisabled() )
{
if ( !GetCanvas()->FirstTab ) { GetCanvas()->FirstTab = this; }
if ( !GetCanvas()->NextTab ) { GetCanvas()->NextTab = this; }
}
if ( Gwen::KeyboardFocus == this )
{
GetCanvas()->NextTab = NULL;
}
//.........这里部分代码省略.........
示例7: DoCacheRender
void Base::DoCacheRender(Gwen::Skin::Base* skin, Gwen::Controls::Base* pMaster)
{
Gwen::Renderer::Base* render = skin->GetRender();
Gwen::Renderer::ICacheToTexture* cache = render->GetCTT();
if (!cache)
return;
Gwen::Point pOldRenderOffset = render->GetRenderOffset();
Gwen::Rect rOldRegion = render->ClipRegion();
if (this != pMaster)
{
render->AddRenderOffset(GetBounds());
render->AddClipRegion(GetBounds());
}
else
{
render->SetRenderOffset(Gwen::Point(0, 0));
render->SetClipRegion(GetBounds());
}
// See if we need to update the cached texture. Dirty?
if (m_bCacheTextureDirty && render->ClipRegionVisible())
{
render->StartClip();
{
if (IsCachedToTexture())
cache->SetupCacheTexture(this);
// Render myself first
Render(skin);
if (!Children.empty())
{
// Now render my kids
for (Base::List::iterator iter = Children.begin(); iter != Children.end(); ++iter)
{
Base* pChild = *iter;
if (!pChild->Hidden())
{
// Draw child control using normal render. If it is cached it will
// be handled in the same way as this one.
pChild->DoRender(skin);
}
}
}
if (IsCachedToTexture())
{
cache->FinishCacheTexture(this);
m_bCacheTextureDirty = false;
}
}
render->EndClip();
}
// Draw the cached texture.
render->SetClipRegion(rOldRegion);
render->StartClip();
{
render->SetRenderOffset(pOldRenderOffset);
cache->DrawCachedControlTexture(this);
}
render->EndClip();
}