Nested TabControls Cause Tab Index trouble

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
pjcast
Quite a regular
Quite a regular
Posts: 47
Joined: Wed Jan 12, 2005 12:06

Nested TabControls Cause Tab Index trouble

Postby pjcast » Wed Mar 16, 2005 07:09

I have a tabcontrol that has child defaultguisheets & two child tabcontrols (Nested tabs)..

And my handler for reacting to tab changes:

Code: Select all

      const CEGUI::WindowEventArgs&  we = static_cast<const CEGUI::WindowEventArgs&>(args);
      CEGUI::TabControl* tc = static_cast<CEGUI::TabControl*>(we.window);
      uint i = tc->getSelectedTabIndex();
      String newWindow = tc->getTabContentsAtIndex(i)->getName().c_str();
      
      std::stringstream ss;
      ss << "Button ID: " << i << newWindow << ".";
      CEGUI::Logger::getSingleton().logEvent( ss.str() );

      mCurrentBar->setVisible( false );

      if( newWindow == "MainTab/Pane1" )
         mCurrentBar = mObjectIconToolBar;
      if( newWindow == "MainTab/Pane2" )
         mCurrentBar = mSectorIconToolBar;
      if( newWindow == "MainTab/Pane3" )
         mCurrentBar = mSceneIconToolBar;
      if( newWindow == "MainTab/Pane4" )
         mCurrentBar = mFileIconToolBar;
      if( newWindow == "MainTab/Pane5" )
         mCurrentBar = mCameraIconToolBar;
      if( newWindow == "MainTab/Pane6" )
         mCurrentBar = mConsoleIconToolBar;

      mCurrentBar->setVisible( true );
      return true;


Now, everything works fine as long as I only click on the main tab buttons of the first tabcontrol... The TabIndex matches the window name and I am able to have correct logic..

My layout is like:
Pane1 | Pane 2 | Pane 3 | etc

and pane1 & 2 each have a child tabcontrol with two buttons each.

If I click on either of pane1's child tabbuttons... And then back on any of the main tab's... the id's get messed up. In this case, Pane6 reports itself as TabIndex 0 when it is clicked.

If instead of clicking on pane1's child tabs, I click on pane2's child tabs... Tab6 reports itself as Tab Index 1.

I've looked at the tabcontrol class and am not sure why this is happening... I see no reason why a child window (in this case a tabcontrol) is having any effect on the parent tabcontrol :\

I can submit my layout file if needed, but it is fairly large.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Nested TabControls Cause Tab Index trouble

Postby CrazyEddie » Wed Mar 16, 2005 09:44

Hi,

Nothing springs immediately to mind, I'll need to have a play about and get back to you :)

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Nested TabControls Cause Tab Index trouble

Postby CrazyEddie » Wed Mar 16, 2005 21:09

As you know, this is now fixed :)

CE.

User avatar
pjcast
Quite a regular
Quite a regular
Posts: 47
Joined: Wed Jan 12, 2005 12:06

Re: Nested TabControls Cause Tab Index trouble

Postby pjcast » Wed Mar 16, 2005 21:31

Thanks so much CE! You are the quickest bug finder that I know of =)

:pint:


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 4 guests