Tabutton fills whole tabcontrol window
Posted: Thu Feb 22, 2007 07:56
Hi
been following the widget galore example for creating a tabcontrol, but I seem to have some difficulties as the tabpane button fills the whole tabcontrol in the vertical direction, I had a working example previously but I'm failing getting it to work now. Btw I'm using CEGUI 0.5.0b.
Heres some layout Im using
And the code to make it work.
Kind regards
Martin B. Andersen
been following the widget galore example for creating a tabcontrol, but I seem to have some difficulties as the tabpane button fills the whole tabcontrol in the vertical direction, I had a working example previously but I'm failing getting it to work now. Btw I'm using CEGUI 0.5.0b.
Heres some layout Im using
Code: Select all
<Window Type="TaharezLook/TabControl" Name="Test/TabControl" >
<Property Name="TabHeight" Value="{0.0,0,0.02}" />
<Property Name="TabTextPadding" Value="{0,0}" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.106814,0},{0.433333,0},{0.681177,0},{0.95,0}}" />
</Window>
<Window Type="TaharezLook/TabPane" Name="Test/TabPane" >
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.4,0},{0.65,0},{0.65,0}}" />
</Window>
And the code to make it work.
Code: Select all
CEGUI::TabControl *tc =
static_cast<CEGUI::TabControl*>(CGfx::win_mgr->getWindow((CEGUI::utf8*)"Test/TabControl"));
tc->setTabHeight(CEGUI::UDim(0.15f,0.0f));
CEGUI::Window *tp = CGfx::win_mgr->getWindow((CEGUI::utf8*)"Test/TabPane");
tp->setText("Test");
tp->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f,0.0),CEGUI::UDim(1.0f,0.0)));
tp->setPosition(CEGUI::UVector2(CEGUI::UDim(0.0f,0.0),CEGUI::UDim(0.0f,0.0)));
tc->addTab(tp);
Kind regards
Martin B. Andersen