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


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

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


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

示例1: attachToCanvas

void MenuBar::attachToCanvas(GuiCanvas *owner, S32 pos)
{
   if(owner == NULL || isAttachedToCanvas())
      return;

   // This is set for popup menus in the onAttachToMenuBar() callback
   mCanvas = owner;

   PlatformWindowSDL *pWindow = dynamic_cast<PlatformWindowSDL*>(owner->getPlatformWindow());
   if(pWindow == NULL) 
      return;

   // Setup the native menu bar
   GuiMenuBar *hWindowMenu = static_cast<GuiMenuBar*>( pWindow->getMenuHandle() );
	if( hWindowMenu == NULL && !Journal::IsPlaying() )
      hWindowMenu = _FindMenuBarCtrl();

   if(hWindowMenu)
   {
      pWindow->setMenuHandle( hWindowMenu );
      GuiControl *base = hWindowMenu->getParent();
         
      while( base->getParent() )
      {
         base = base->getParent();
      }         

      mCanvas->setMenuBar( base );
   }
   
}
开发者ID:fr1tz,项目名称:terminal-overload,代码行数:31,代码来源:menuBarSDL.cpp

示例2: processTick

void GuiRolloutCtrl::processTick()
{
   // We do nothing here if we're NOT animating
   if ( !mIsAnimating )
      return;

   // Sanity check to fix non collapsing panels.
   if ( mAnimateStep == 0 )
      mAnimateStep = 1;

   S32 newHeight = getHeight();
   // We're collapsing ourself down (Hiding our contents)
   if( mCollapsing )
   {
      if ( newHeight < mAnimateDestHeight )
         newHeight = mAnimateDestHeight;
      else if ( ( newHeight - mAnimateStep ) < mAnimateDestHeight )
         newHeight = mAnimateDestHeight;

      if ( newHeight == mAnimateDestHeight )
         mIsAnimating = false;
      else
         newHeight -= mAnimateStep;

      if( !mIsAnimating )
	  {
         mIsExpanded = false;
	  }
   }
   else // We're expanding ourself (Showing our contents)
   {
      if ( newHeight > mAnimateDestHeight )
         newHeight = mAnimateDestHeight;
      else if ( ( newHeight + mAnimateStep ) > mAnimateDestHeight )
         newHeight = mAnimateDestHeight;

      if ( newHeight == mAnimateDestHeight )
         mIsAnimating = false;
      else
         newHeight += mAnimateStep;

      if ( !mIsAnimating )
         mIsExpanded = true;
   }

   if ( newHeight != getHeight() )
      setHeight( newHeight );

   if ( !mIsAnimating )
   {
      if( mCollapsing )
         onCollapsed_callback();
      else if( !mCollapsing )
         onExpanded_callback();

      calculateHeights();
   }

   GuiControl* parent = getParent();
   if ( parent )
   {
      parent->childResized( this );
      // if our parent's parent is a scroll control, scrollvisible.
      GuiScrollCtrl* scroll = dynamic_cast<GuiScrollCtrl*>( parent->getParent() );
      if ( scroll )
      {
         scroll->scrollRectVisible( getBounds() );
      }
   }
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:70,代码来源:guiRolloutCtrl.cpp


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