Duplicating a window

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
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Duplicating a window

Postby arkos » Tue Oct 10, 2006 21:22

Hello,

I want to duplicate a window.

I tried:

Code: Select all

CEGUI::Window* t = CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/FrameWindow", "testframe");
   (*t) = (*(getWindow("report_win")));

but got compiler error, "cannot access protected member declared in class 'CEGUI::Window'.

*after I copied the window, I was going to change its name to be unique.

So how do I copy a window?

User avatar
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Postby arkos » Tue Oct 10, 2006 21:39

I figured out that the window would have to be static cast

Code: Select all

CEGUI::Window* t = CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/FrameWindow", "testframe");
   *((CEGUI::FrameWindow*)t) = *((CEGUI::FrameWindow*)getWindow("report_win"));


This compiles, however, upon intellisensing CEGUI::Window::Window() it seems that windows are not meant to be copied or assigned this way. :(

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Wed Oct 11, 2006 13:45

A long long time ago, in a post far far away...I had started some work on creating multiple windows based on a single .layout file. You can find that code here. It's incomplete but might give you an idea. If you do make it work please put the finished code within the Wiki; that feature may be useful to others.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 9 guests