The tweaker needs to be hierarchical because it will be used for editing our XML files. I drew an ugly picture in paint to illustrate this. I have a name, edit box, and check box for each value.
Unfortunately the current way I'm approaching this is quite slow. It involves creating about 60 Vanilla/StaticText's and edit boxes and it takes about 10 seconds to create the window and is quite slow to render.
I was wondering how a more experienced user would approach making the type of GUI I explained.
Here is a simplified code sample to illustrate approximately what I'm doing at this point.
Code: Select all
m_mngr = WindowManager::getSingletonPtr();
m_rootWin = m_mngr->createWindow("DefaultWindow");
m_mainWin = m_mngr->createWindow("Vanilla/FrameWindow");
m_clientWin = m_mngr->createWindow("WindowsLook/ScrollablePane");
m_rootWin->setMousePassThroughEnabled(true);
m_rootWin->addChildWindow(m_mainWin);
m_mainWin->addChildWindow(m_clientWin);
m_mainWin->setPosition(UVector2(UDim(0,0),UDim(0,0)));
m_mainWin->setMinSize(UVector2(cegui_absdim(300),cegui_absdim(400)));
m_clientWin->setPosition(UVector2(UDim(0,0),UDim(0,0)));
m_clientWin->setSize(UVector2(UDim(1,0),UDim(1,0)));
float curHeight = 10.f;
for( uint i = 0; i < 60; ++i )
{
Window * win = m_mngr->createWindow("Vanilla/StaticText");
m_clientWin->addChildWindow(win);
win->setPosition(UVector2(UDim(0,10.f),UDim(0,curHeight)));
win->setSize(UVector2(UDim(0,200),UDim(0,30.f)));
//move next window down, I also do indenting in my full code.
curHeight += 35.f;
win->setText(itoa(i,buf,10));
}
CEGUI::System::getSingleton().setGUISheet(m_rootWin);