Hi,
Such a basic thing is not possible out of the box
You'd need a copy method which copies all your properties and such. Something like this:
Code: Select all
//------------------------------------------------------------------------
Window* CopyWindow( const CEGUI::Window* pSource )
{
// create window of same type, but different name
Window* copy = CEGUI::WindowManager::getSingleton().createWindow(pSource->getType(), pSource->getName() + "_copy");
// Copy the properties
CEGUI::PropertySet::Iterator propertyIt = pSource->getPropertyIterator();
while (!propertyIt.isAtEnd())
{
const CEGUI::String propertyName = propertyIt.getCurrentKey();
copy->setProperty(propertyName, pSource->getProperty(propertyName));
propertyIt++;
}
return copy;
}
This should compile pretty well i hope
Of course, wrap some try-catch handlers and all that. And maybe you want an argument to specify your own copy name, instead my "_copy" example. Copying properties like this is more expensive then copying members, but this is the most generic, since different window types support different kinds of properties.
HTH.