CELayoutEditor and AutoWindows

Use this forum for:
- Discussion regarding unofficial CEGUI related tools, scripts and utilities.
- User to user help for the obsoleted CELayoutEditor and CEImagesetEditor tools.

Moderators: CEGUI MVP, CEGUI Team

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

CELayoutEditor and AutoWindows

Postby Jamarr » Mon Jan 26, 2009 20:14

Ok, so after playing around with different fonts/sizes I updated my scheme and layouts to use CE's recommended AutoWindow solution to add a pseudo-client-area to my FrameWindow. The issue is that, when you use this approach, if you want to update your layout in CELayoutEditor the layout opens fine, but when you save it none of the child-windows you added to the AutoWindow get saved back into the layout; the AutoWindow, and all of it's children, are missing from the layout.

For example, a layout like this(http://www.cegui.org.uk/wiki/index.php/Introduction_To_Auto_Windows#Test_layout_file):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<GUILayout>
<Window Type="DefaultGUISheet" Name="root">

    <Window Type="WindowsLook/NewFrameWindow" Name="myFrameWindow">
        <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
        <Property Name="UnifiedSize" Value="{{0.4,0},{0.5,0}}" />
        <Property Name="Text" Value="Demo of seperate client area." />

        <AutoWindow NameSuffix="__auto_clientarea__" >
            <Window Type="WindowsLook/Button" Name="myFrameWindow/Button1">
                <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0.01,0},{0.98,0},{0.15,0}}" />
                <Property Name="Text" Value="A Button" />
            </Window>
            <Window Type="WindowsLook/Button" Name="myFrameWindow/Button2">
                <Property Name="UnifiedAreaRect" Value="{{0.04,0},{0.6,0},{0.96,0},{0.75,0}}" />
                <Property Name="Text" Value="Another Button" />
            </Window>
        </AutoWindow>

    </Window>
</Window>
</GUILayout>


will end up like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<GUILayout>
<Window Type="DefaultGUISheet" Name="root">
    <Window Type="WindowsLook/NewFrameWindow" Name="myFrameWindow">
        <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
        <Property Name="UnifiedSize" Value="{{0.4,0},{0.5,0}}" />
        <Property Name="Text" Value="Demo of seperate client area." />
    </Window>
</Window>
</GUILayout>


Is it even possible to update the CELayoutEditor to correctly handle this case? And if so, would it also be possible to update the CELayoutEditor to allow adding child-windows to AutoWindows directly? Perhaps by adding an option to show a second AutoWindow selection tree (based on the selected window, similar to the normal window selection tree) that would allow you to select an AutoWindow to add child-windows too?

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Jan 27, 2009 07:55

Hi,

Saving of AutoWindows is explicitly not done, because that would cause many auto windows to be written, causing duplication exceptions when loading such layouts back in. For example scrollbars, droplists and so on.

So, in order to make you ideal situation work, we need a way to distinguish 'allowed' and 'disallowed' auto windows when saving a layout from the editor.

When i look at your sample, can't AutoWindow be a DefaultWindow either? Or does your auto window gets automatically positioned or offset somewhere else? Not exactly sure where this discussion/idea started.
Check out my released snake game using Cegui!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Jan 27, 2009 09:48

scriptkid wrote:Not exactly sure where this discussion/idea started.

That would be me who started this idea :)

The ability to target auto-windows in a layout is a designed-in feature, though obviously distinguishing which 'auto 'windows should and should not be written to XML is a more challenging task.

To veer off topic slightly, the reason most people use this technique is due to the issues that exist when positioning child content in a FrameWindow - because the client-area is not handled properly, when sizing a window, using switchable skins, or changing resolution, suddenly your precisely designed layout becomes a pile of rubbish as half the content gets hidden by the titlebar.

I have been fixing this recently, and so removing the need for this auto-window work-around. Interested parties should pay attention to this mantis ticket: http://www.cegui.org.uk/mantis/view.php?id=260 (which also has a patch against v0-6 to address the issue, though remember you probably need to build your layout editor against the modified version of the code in order that the resulting positions are correct when later loaded using the modified CEGUI.

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Postby Jamarr » Tue Jan 27, 2009 16:41

Ok. I will look into the patch when I get some time. Thanks.


Return to “Unofficial CEGUI-Related Tools”

Who is online

Users browsing this forum: No registered users and 13 guests