Is there a way to copy a whole window tree ? Like, I have this window, with tons of widgets on it and I want to duplicate it and don't wanna copy-paste tons of XML with just a single position changed for each copy. Besides, I need a certain number of them so code is preferable.
I'm thinking I could recurs the whole tree and make copies of windows & properties, but that involves tons of renaming.
Copying window trees
Moderators: CEGUI MVP, CEGUI Team
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Hi,
you need a recursive copy, and you have to deal with naming issue
The layout editor does the exact thing when it copies & pastes though. The code should be pretty straightforward and can be found in this file:
http://crayzedsgui.svn.sourceforge.net/ ... iew=markup
I think that -besides the pieces of wxWidgets code- the CopiedSelection class can be reused easily, so feel free to use it
There's one line which i didn't understand myself anymore: the check for "_TabPane_". I think that the if-statement is wrong, and should also have "!= npos" behind it. I'll look into this.
HTH.
you need a recursive copy, and you have to deal with naming issue
The layout editor does the exact thing when it copies & pastes though. The code should be pretty straightforward and can be found in this file:
http://crayzedsgui.svn.sourceforge.net/ ... iew=markup
I think that -besides the pieces of wxWidgets code- the CopiedSelection class can be reused easily, so feel free to use it
There's one line which i didn't understand myself anymore: the check for "_TabPane_". I think that the if-statement is wrong, and should also have "!= npos" behind it. I'll look into this.
HTH.
Check out my released snake game using Cegui!
Thanks, I thought it was built-in or something. As for the copied selection class, it looked pretty weird, like that map that I don't see why it's there, so i decided to write my own function today because I would have to intervene with a different naming scheme than it was presented there, but anyways, I managed to solve it, so thanks again
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Hi,
not sure which map you mean, but glad that you have a working solution now
Maybe that one day, this copying should be part of Cegui itself...
not sure which map you mean, but glad that you have a working solution now
Maybe that one day, this copying should be part of Cegui itself...
Check out my released snake game using Cegui!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 7 guests