Doing so has caused a number of issues however there seems to be one issue I cannot solve.
When I child any type of CEGUI window to a CEGUI ScrollablePane type window it does not want to show the window.
I have searched the forums and couldn't find anything. I have also attempted setting different sizes/positions/visibility etc to no avail
Has anyone come across this issue or know a fix / error I have made?
Any help will be greatly appreciated
Here is a cut down of the relevant code :
Code: Select all
// Creating Demo Interface:
CEGUI::Window* pRootWindow = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();
// Instruct CEGUI to create the window:
CEGUI::WindowManager& rWindowManager = CEGUI::WindowManager::getSingleton();
// Convert pixel-size to the size relative to the screen:
const CEGUI::UDim udNewElementWidth (0.f, 0.f);
const CEGUI::UDim udNewElementHeight(0.f, 0.f);
const CEGUI::UDim udNewElementLeft (0.f, 640.f);
const CEGUI::UDim udNewElementTop (0.f, 384.f);
// Demo Interface TabControl:
{
CEGUI::Window* pTabControl = rWindowManager.createWindow("TaharezLook/TabControl", "Demo Interface");
// Set values for the CEGUI Tab Control layout:
pTabControl->setPosition(CEGUI::Vector2<CEGUI::UDim>(udNewElementLeft, udNewElementTop));
pTabControl->setSize (CEGUI::USize(udNewElementWidth, udNewElementHeight));
pTabControl->setText ("Demo Interface");
pTabControl->setName("Demo Interface");
pTabControl->setVisible(false);
//pTabControl->setTabHeight(CEGUI::UDim(0.f, 20.f));
//pTabControl->setTabTextPadding(CEGUI::UDim(0.f, 15.f));
pTabControl->setWidth(CEGUI::UDim(0.f, 1024.f));
// Add tab control to root window.
pRootWindow->addChild(pTabControl);
}
// Misc. ScrollablePane:
{
CEGUI::Window* pMiscTab = rWindowManager.createWindow("TaharezLook/ScrollablePane", "Misc.");
pMiscTab->setPosition(CEGUI::Vector2<CEGUI::UDim>(udNewElementLeft, udNewElementTop));
pMiscTab->setSize (CEGUI::USize(udNewElementWidth, udNewElementHeight));
pMiscTab->setText ("Misc.");
pMiscTab->setVisible(true);
pMiscTab->setName("Misc.");
pRootWindow->addChild(pMiscTab);
const CEGUI::UDim udNewElementWidth (0.f, 1024.f);
const CEGUI::UDim udNewElementHeight(0.f, 0.f);
pMiscTab->setSize (CEGUI::USize(udNewElementWidth, udNewElementHeight));
pMiscTab->setMinSize (CEGUI::USize(udNewElementWidth, udNewElementHeight));
pMiscTab->setMaxSize (CEGUI::USize(udNewElementWidth, udNewElementHeight));
pMiscTab->setPosition(CEGUI::Vector2<CEGUI::UDim>(CEGUI::UDim(0.0f, 0.0f), CEGUI::UDim(0.0f, 0.0f)));
CEGUI::TabControl* pTabControl = dynamic_cast<CEGUI::TabControl*>(pRootWindow->getChild("Demo Interface"));
pTabControl->addTab(pMiscTab);
}
// Misc. ScrollablePane Elements:
{
CEGUI::Window* pEnableSound = rWindowManager.createWindow("TaharezLook/RadioButton", "Sound Enabled");
pEnableSound->setSize (CEGUI::USize(udNewElementWidth, udNewElementHeight));
pEnableSound->setText ("Sound Enabled");
pEnableSound->setName ("Sound Enabled");
pEnableSound->setVisible(true);
CEGUI::UDim udNewPositionLeft(0.f, 20.f);
CEGUI::UDim udNewPositionTop (0.f, 10.f);
pEnableSound->setPosition(CEGUI::Vector2<CEGUI::UDim>(udNewPositionLeft, udNewPositionTop));
// When adding this window to the misc. ScrollablePane window, it will no longer show the Sound Enabled window!
// However if i comment it out and leave it set to the root then it will show the Sound Enabled window
pRootWindow->getChild("Demo Interface/Misc.")->addChild(pRootWindow->getChild("Sound Enabled"));
}