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


C++ GuiControl::isVisible方法代码示例

本文整理汇总了C++中GuiControl::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiControl::isVisible方法的具体用法?C++ GuiControl::isVisible怎么用?C++ GuiControl::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GuiControl的用法示例。


在下文中一共展示了GuiControl::isVisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: onRender

void GuiRolloutCtrl::onRender( Point2I offset, const RectI &updateRect )
{
   if( !mProfile || mProfile->mFont == NULL )
      return;

   // Calculate actual world bounds for rendering
   RectI worldBounds( offset, getExtent() );

   // if opaque, fill the update rect with the fill color
   if ( mProfile->mOpaque )
      GFX->getDrawUtil()->drawRectFill( worldBounds, mProfile->mFillColor );

   if ( mProfile->mBitmapArrayRects.size() >= NumBitmaps )
   {
      GFX->getDrawUtil()->clearBitmapModulation();

      // Draw Rollout From Skin
      if ( !mIsExpanded && !mIsAnimating )
         renderFixedBitmapBordersFilled( worldBounds, 1, mProfile );
      else if ( mHideHeader )
         renderSizableBitmapBordersFilledIndex( worldBounds, MidPageLeft, mProfile );
      else
         renderSizableBitmapBordersFilledIndex( worldBounds, TopLeftHeader, mProfile );
   }

   if ( !(mIsExpanded && mHideHeader ) )
   {
      // Draw Caption ( Vertically Centered )
      ColorI currColor;
      GFX->getDrawUtil()->getBitmapModulation( &currColor );
      Point2I textPosition = mHeader.point + offset + mProfile->mTextOffset;
      GFX->getDrawUtil()->setBitmapModulation( mProfile->mFontColor );
      renderJustifiedText( textPosition, mHeader.extent, mCaption );
      GFX->getDrawUtil()->setBitmapModulation( currColor );
   }

   // If we're collapsed we contain the first child as our content
   // thus we don't render it when collapsed.  but to support modified
   // rollouts with custom header buttons etc we still render our other
   // children. -JDD
   GuiControl *pChild = dynamic_cast<GuiControl*>( at(0) );
   if ( pChild )
   {
      if ( !mIsExpanded && !mIsAnimating && pChild->isVisible() )
	  {
         pChild->setVisible( false );
	  }
      else if ( (mIsExpanded || mIsAnimating) && !pChild->isVisible() )
	  {
         pChild->setVisible( true );
	  }
   }
   renderChildControls( offset, updateRect );

   // Render our border should we have it specified in our profile.
   renderBorder(worldBounds, mProfile);
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:57,代码来源:guiRolloutCtrl.cpp

示例2: layoutControls

bool GuiContainer::layoutControls(  RectI &clientRect )
{
   // This variable is set to the first 'Client' docking 
   //  control that is found.  We defer client docking until
   //  after all other docks have been made since it will consume
   //  the remaining client area available.
   GuiContainer *clientDocking = NULL;

   // Iterate over all children and perform docking
   iterator nI = begin();
   for( ; nI != end(); nI++ )
   {
      // Layout Content with proper docking (Client Default)
      GuiControl *control = static_cast<GuiControl*>(*nI);
      
      // If we're invisible we don't get counted in docking
      if( control == NULL || !control->isVisible() )
         continue;

	  S32 dockingMode = Docking::dockNone;
	  GuiContainer *container = dynamic_cast<GuiContainer*>(control);
	  if( container != NULL )
		  dockingMode = container->getDocking();
     else
        continue;

     // See above note about clientDocking pointer
     if( dockingMode & Docking::dockClient && clientDocking == NULL )
        clientDocking = container;

      // Dock Appropriately
     if( !(dockingMode & Docking::dockClient) )
        dockControl( container, dockingMode, clientRect );
   }

   // Do client dock
   if( clientDocking != NULL )
      dockControl( clientDocking, Docking::dockClient, clientRect );

   return true;
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:41,代码来源:guiContainer.cpp


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