Game Development Community

Inactivity for Tabs

by Nathan Bowhay (ESAL) · 11/04/2009 (7:17 pm) · 0 comments

Some simple changes you can make to be able to set specific tabs to be inactive. I originally wrote this in T3D Beta 3, so there may be some issues with the movement of tabs they added in one of the following builds, but all changes are to be done to T3D 1.0.1

In guiTabBookCtrl.cpp change the following:

on line 266 change
if( tab != NULL )
      {
         selectPage( tab );
         mDraggingTab = mAllowReorder;
      }
      else
      {
         mDraggingTabRect = true;
      }
to
if( tab->isActive() )
      {
	  if( tab != NULL )
	  {
	     selectPage( tab );
	     mDraggingTab = mAllowReorder;
	  }
	  else
	  {
	      mDraggingTabRect = true;
	  }
      }

on line 443 after
void GuiTabBookCtrl::renderTab( RectI tabRect, GuiTabPageCtrl *tab )
{
add
if(!tab->isActive())
		return;

on line 703 after
// Select the page
   selectPage( mPages[ index ].Page );
add
// Select the page if it is active
   if(mPages[ index ].Page->isActive())
   {
	   selectPage( mPages[ index ].Page );
   }

And that should be it now when you create a tab page you can set it inactive and it should behave correctly. Feel free to post any fixes or bugs you notice, not saying I will for sure get time to fix them, but I may or someone else may.