Game Development Community

Specifying the default tab

by BigPapa · in Torque Game Engine · 12/13/2005 (10:49 am) · 4 replies

Hello gang,

I'm modifying the OptionsDlg.gui to use the GuiTabBookCtrl and GuiTabPageCtrl controls of TGE 1.4. For some reason, the last tab instead of the first one is the one that comes up by default when the Option dialog is opened. Does anyone know who to specify which tab should be the default?

Thx!

#1
12/13/2005 (12:50 pm)
Its not got anything to do with the order they appear in the GUI file is it? Like the Control Tab Order.
#2
12/13/2005 (1:46 pm)
I think it's actually in client/scripts/optionsDlg.cs

in the

function optionsDlg::onWake {
...stuff...

yourTabPageThing.setVisible(true);

...stuff...
}

Make sure you don't place this above any other setVisible() calls or they may counteract it.
#3
12/13/2005 (7:55 pm)
@Midhir - I tried it but did work. Shame cuz it looked good.

@David - You are correct in that the last one is the one that gets the focus. I put the first tab in the last place but unfortunately that changed the order of the tab. Now it shows as the last tab.
#4
02/16/2006 (7:33 am)
Hello all, I know this thread has been around for a little while but I have the solution.

In GuiTabBookCtrl.cc add the following:
ConsoleMethod( GuiTabBookCtrl, selectPage, void, 3, 3, "(S32 index)")
{
   object->selectPage(dAtoi(argv[2]));
}

This will allow you to select a tab from script.