Page 1 of 1

Sharing layout??

Posted: Thu Apr 30, 2009 12:34
by masch
Hello...
Is it possible to make a layout with 2 or or layout??..
For example: I have layout_1, layout_2 and layout_3 and I create a layout_4= layout_1 + layout_2 and another layout_5=layout_1+layout_3.

Salu2...
masch...

Re: Sharing layout??

Posted: Fri May 01, 2009 08:54
by CrazyEddie
Yes, but with the caveat that you need to avoid name clashes (maybe by use of a naming prefix).

You include a layout as content of a Window in another layout via the LayoutImport tag, which takes Filename, ResourceGroup and Prefix attributes.

Example:

Code: Select all

<GUILayout>
    <Window Type="DefaultWindow" Name="layout_4_root">
        <LayoutImport Filename="layout_1.layout" Prefix="layout_4_root/" />
        <LayoutImport Filename="layout_2.layout" Prefix="layout_4_root/" />
    </Window>
</GUILayout>

and

Code: Select all

<GUILayout>
    <Window Type="DefaultWindow" Name="layout_5_root">
        <LayoutImport Filename="layout_1.layout" Prefix="layout_5_root/" />
        <LayoutImport Filename="layout_3.layout" Prefix="layout_5_root/" />
    </Window>
</GUILayout>



Note that I believe CELayoutEditor is not currently aware of this system, so loading such a layout and resaving will result in different XML between the original and saved versions (the saved version will explicitly include all windows rather than use the imports).

CE.

Re: Sharing layout??

Posted: Fri May 01, 2009 09:50
by scriptkid
CrazyEddie wrote:Note that I believe CELayoutEditor is not currently aware of this system, so loading such a layout and resaving will result in different XML between the original and saved versions (the saved version will explicitly include all windows rather than use the imports).


Yes, that's true. Thanks for the heads-up on this, i've raised a ticket:
http://www.cegui.org.uk/mantis/view.php?id=294

Re: Sharing layout??

Posted: Fri May 01, 2009 14:17
by masch
Great Eddie!....It's exactly what I need, but I like the hard way to do it, I use gedit to make the layout .:D

Thanks!...

Re: Sharing layout??

Posted: Mon May 04, 2009 15:14
by masch
I have working differents layout, but I have a problem with ZOrderChangeEnabled property. Is it possible that the property does not work between layout?? Because when I put the property in false and I do a mouse click to the parent layout, the child layout disappear.

Re: Sharing layout??

Posted: Mon May 04, 2009 19:09
by scriptkid
I am not sure what exactly goes wrong, but a hierarchie in a layout is just relative. As soon as a layout is loaded, the concept of layout is lost in Cegui and Z ordering takes into account all currently windows in the WindowManager.

HTH.