I'm having trouble getting a basic tabcontrol working....for some reason, only one tab shows up, while the rest remain hidden. I've looked through the tutorials, API, an swam through other posts on this forum. All other CEGUI elements are working fine, and since I can't get *any* tab sample code to work properly, clearly I'm missing something fundamental. Can someone please help?
What I've done:
1/ Created a layout using scriptkid's editor (ver ~0.7). Per instructions in the wiki, tabs are done as default windows, which are "unattached" in the editor
2/ Tabs are attached in code, using "addTab"
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<GUILayout >
<Window Type="DefaultWindow" Name="Settings" >
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
<Window Type="DefaultWindow" Name="Settings/GraphicsTab" >
<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.069633,0},{0.8,0},{0.635079,0}}" />
<Window Type="TaharezLook/StaticText" Name="Settings/graphics/" >
<Property Name="Text" Value="Graphics" />
<Property Name="HorzExtent" Value="41" />
<Property Name="VertExtent" Value="11.7287" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{-0.00231481,0},{0.3,0},{0.117685,0}}" />
</Window>
</Window>
<Window Type="DefaultWindow" Name="Settings/SoundTab" >
<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.119633,0},{0.8,0},{0.685078,0}}" />
<Window Type="TaharezLook/StaticText" Name="Settings/Sound/text" >
<Property Name="Text" Value="Sound" />
<Property Name="HorzExtent" Value="28" />
<Property Name="VertExtent" Value="11.7287" />
<Property Name="UnifiedAreaRect" Value="{{0.296296,0},{-0.00462963,0},{0.596296,0},{0.11537,0}}" />
</Window>
</Window>
<Window Type="DefaultWindow" Name="Settings/GameplayTab" >
<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.169633,0},{0.8,0},{0.735078,0}}" />
<Window Type="TaharezLook/StaticText" Name="Settings/Gameplay/text" >
<Property Name="Text" Value="Gameplay" />
<Property Name="HorzExtent" Value="46" />
<Property Name="VertExtent" Value="11.7287" />
<Property Name="UnifiedAreaRect" Value="{{0.595082,0},{-0.00231482,0},{0.895082,0},{0.117685,0}}" />
</Window>
</Window>
<Window Type="DefaultWindow" Name="Settings/HelpTab" >
<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.219633,0},{0.8,0},{0.785078,0}}" />
<Window Type="TaharezLook/StaticText" Name="Settings/Help/text" >
<Property Name="Text" Value="Help" />
<Property Name="HorzExtent" Value="20" />
<Property Name="VertExtent" Value="11.7287" />
<Property Name="UnifiedAreaRect" Value="{{0.896359,0},{0,0},{1.19636,0},{0.12,0}}" />
</Window>
</Window>
<Window Type="TaharezLook/TabControl" Name="Settings/TabControl" >
<Property Name="TabHeight" Value="{0,19.7287}" />
<Property Name="TabPanePosition" Value="Top" />
<Property Name="UnifiedAreaRect" Value="{{0.0505859,0},{0.304712,0},{0.94707,0},{0.850524,0}}" />
</Window>
</Window>
</GUILayout>
Code: Select all
SettingsWindow::SettingsWindow(CEGUI::WindowManager * wmgrIn)
{
wmgr = wmgrIn;
myTabs = (CEGUI::TabControl*)wmgr->getWindow((CEGUI::utf8*)"Settings/TabControl");
myTabs->setTabHeight((CEGUI::UDim(15, 27)));
GraphicsTab = (CEGUI::Window*)wmgr->getWindow((CEGUI::utf8*)"Settings/GraphicsTab");
SoundTab = (CEGUI::Window*)wmgr->getWindow((CEGUI::utf8*)"Settings/SoundTab");
GameplayTab = (CEGUI::Window*)wmgr->getWindow((CEGUI::utf8*)"Settings/GameplayTab");
HelpTab = (CEGUI::Window*)wmgr->getWindow((CEGUI::utf8*)"Settings/HelpTab");
GraphicsTab->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, 0.0f), CEGUI::UDim(1.0f, 0.0f)));
SoundTab->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, 0.0f), CEGUI::UDim(1.0f, 0.0f)));
GameplayTab->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, 0.0f), CEGUI::UDim(1.0f, 0.0f)));
HelpTab->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, 0.0f), CEGUI::UDim(1.0f, 0.0f)));
GraphicsTab->setPosition(CEGUI::UVector2(CEGUI::UDim(0.0f, 0.0f), CEGUI::UDim(0.0f, 0.0f)));
SoundTab->setPosition(CEGUI::UVector2(CEGUI::UDim(0.0f, 0.25f), CEGUI::UDim(0.0f, 0.0f)));
GameplayTab->setPosition(CEGUI::UVector2(CEGUI::UDim(0.0f, 0.5f), CEGUI::UDim(0.0f, 0.0f)));
HelpTab->setPosition(CEGUI::UVector2(CEGUI::UDim(0.0f, 0.75f), CEGUI::UDim(0.0f, 0.0f)));
myTabs->addTab(GraphicsTab);
myTabs->addTab(SoundTab);
myTabs->addTab(GameplayTab);
myTabs->addTab(HelpTab);
myTabs->setSelectedTabAtIndex(0);
Not quite sure what's missing, but I'm hoping it's something obvious to the rest of you. Thanks in advance,
Jason