Child window of ScrollablePane not showing.

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

bananaPeel
Just popping in
Just popping in
Posts: 2
Joined: Tue Apr 02, 2019 02:45

Child window of ScrollablePane not showing.

Postby bananaPeel » Tue Apr 02, 2019 07:10

I have an application that uses CEGUI 0.7.5 perfect fine, however recently I've need to update the application to use CEGUI 0.8.7
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 :D

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"));
}
Last edited by bananaPeel on Wed Apr 03, 2019 23:05, edited 1 time in total.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Child window of ScrollablePane not showing.

Postby Ident » Tue Apr 02, 2019 20:09

Do you have a minimal repro case? This is quite a complex example and I cannot pinpoint anything down regarding what could be wrong. If you could narrow it down please I could help.
CrazyEddie: "I don't like GUIs"

bananaPeel
Just popping in
Just popping in
Posts: 2
Joined: Tue Apr 02, 2019 02:45

Re: Child window of ScrollablePane not showing.

Postby bananaPeel » Wed Apr 03, 2019 22:57

Ident, thanks for your response.

I have since found the reason as to why any child elements to a ScrollablePane were not appearing.
Seems I (think I) have incorrectly set the size of the pane.

The issue is outline in below code:

Code: Select all

// Demo Interface TabControl:
CEGUI::TabControl* pTabControl = dynamic_cast<CEGUI::TabControl*>(CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/TabControl", "Demo Interface"));

// Child tab control to root window.
CEGUI::Window* pRootWindow = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow();
pRootWindow->addChild(pTabControl);

// Create Misc. ScrollablePane:
CEGUI::ScrollablePane* pScrollablePane = dynamic_cast<CEGUI::ScrollablePane*>(CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ScrollablePane", "Misc."));

// Child the window to root.
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->addChild(pScrollablePane);

// Below altering the size, causes elements that are or will be childed to pScrollablePane to not show:
const CEGUI::UDim udNewElementWidth(0.f, 1024.f);
const CEGUI::UDim udNewElementHeight(0.f, 0.f);
pScrollablePane->setSize(CEGUI::USize(udNewElementWidth, udNewElementHeight));

// Alter position of pane.
pScrollablePane->setPosition(CEGUI::Vector2<CEGUI::UDim>(CEGUI::UDim(0.0f, 0.0f), CEGUI::UDim(0.0f, 0.0f)));

// Add ScrollablePane as tab to tabcontrol:
pTabControl->addTab(pScrollablePane);


The issue arose because the size of the ScrollablePane was altered incorrectly?, not sure how this only caused an issue after updating to 0.8.7 though.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Child window of ScrollablePane not showing.

Postby Ident » Sun Apr 21, 2019 19:24

I don't know either, if you think it is an actual bug please add a bug ticket on bitbucket or if you are extra good and have a fix, please make a PR :)
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests