TabControl

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
zola
Quite a regular
Quite a regular
Posts: 48
Joined: Wed Jan 12, 2005 12:06

TabControl

Postby zola » Mon Oct 18, 2004 15:05

Hi
If I remove a tab then add it again the windowmanager throws an AlreadyExistsException, even though i destroy the tabwindow.

Code: Select all

CEGUI::Window* defaultwin=CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow",(CEGUI::utf8*)"Test1");

tabCtrl->addTab(defaultwin);

....

tabCtrl->removeTab(defaultwin);
CEGUI::WindowManager::getSingleton().destroyWindow(defaultwin);
...

CEGUI::Window* defaultwin2=CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"DefaultWindow",(CEGUI::utf8*)"Test1");

tabCtrl->addTab(defaultwin2); // error thrown


I recon this has something to do with the TabButton (error log: Exception: WindowManager::createWindow - A Window object with the name 'btnTest1' already exists within the system. ) but I haven't been able to resolve the problem. I tried destroying the button in TabControl::removeButtonForTabContent but this turned out to be the wrong place :)

Maybe I'm doing something wrong with deleting the tab? Any hints where I should look?

Cheers
Tom

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

TabControl

Postby CrazyEddie » Mon Oct 18, 2004 15:31

This is a bug :shock:

I'll fix it and post back in a little while when I've done it :)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

TabControl

Postby CrazyEddie » Mon Oct 18, 2004 15:45

This is now fixed in CVS.

Here, have a patch ;)

Code: Select all

Index: src/elements/CEGUITabControl.cpp
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/src/elements/CEGUITabControl.cpp,v
retrieving revision 1.4
diff -u -r1.4 CEGUITabControl.cpp
--- src/elements/CEGUITabControl.cpp   16 Oct 2004 16:35:47 -0000   1.4
+++ src/elements/CEGUITabControl.cpp   18 Oct 2004 15:36:55 -0000
@@ -380,6 +380,8 @@
     // remove
     d_tabButtonIndexMap.erase(tb->getTabIndex());
     d_tabButtonPane->removeChildWindow(tb);
+   // destroy
+   WindowManager::getSingleton().destroyWindow(tb);
 }
 /*************************************************************************
 Remove tab button


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 9 guests