Loading multiple layouts - CElayouteditor not working?
Posted: Wed Dec 20, 2006 10:40
Hi all.
Could someone tell me how to load multiple layouts into one guisheet?
Assume you have two .layout files, one containing projectspecific (menus for the game etc...) stuff and the other contains more general stuff (console, messagewindows etc)
Now if I do:
Window *l1 = loadLayout("game.layout");
Window *l2 = loadLayout("system.layout");
Now I want to merge these two:
I could do:
l1->addChildWindow(l2);
or l2->addChildWIndow(l1);
or
Window *w = new GUISheet()
w->addChildWindow(l1);
w->addChildWindow(l2);
Now all these approaches fails on the following point:
- Only the last added layout can be interacted with.
The content of both layouts is visible, but only the windows in the last added layout reacts to mouse events. That is only the last windows can be made active.
Now I just realized that the reason for this is that the Root window (created by CELayouteditor) is actually of size 1,1, that is it obscures the whole window. This means that the root of the last added window will obscure anything loaded previously.
The root of evil here is then CElayouteditor, which dont allow you to save a layout without a root window (you cant delete the root window).
So layouteditor is a tool to only create full layouts, not partial ones.
If one edit the resulting layoutfiles and removes the root window, it actually works.
It should be possible to store a layout without the root, or just to make it possible to remove the root from the scene in Layouteditor
/A
Could someone tell me how to load multiple layouts into one guisheet?
Assume you have two .layout files, one containing projectspecific (menus for the game etc...) stuff and the other contains more general stuff (console, messagewindows etc)
Now if I do:
Window *l1 = loadLayout("game.layout");
Window *l2 = loadLayout("system.layout");
Now I want to merge these two:
I could do:
l1->addChildWindow(l2);
or l2->addChildWIndow(l1);
or
Window *w = new GUISheet()
w->addChildWindow(l1);
w->addChildWindow(l2);
Now all these approaches fails on the following point:
- Only the last added layout can be interacted with.
The content of both layouts is visible, but only the windows in the last added layout reacts to mouse events. That is only the last windows can be made active.
Now I just realized that the reason for this is that the Root window (created by CELayouteditor) is actually of size 1,1, that is it obscures the whole window. This means that the root of the last added window will obscure anything loaded previously.
The root of evil here is then CElayouteditor, which dont allow you to save a layout without a root window (you cant delete the root window).
So layouteditor is a tool to only create full layouts, not partial ones.
If one edit the resulting layoutfiles and removes the root window, it actually works.
It should be possible to store a layout without the root, or just to make it possible to remove the root from the scene in Layouteditor
/A