Page 1 of 1

Trouble finding windows in 0.6.2

Posted: Thu Dec 04, 2008 17:41
by kripken
I've run into the following problem when migrating from 0.6.1 to 0.6.2. When I do "layout:getChild" (from Lua) to get the edit box listed here, it fails:

Code: Select all

<GUILayout >
    <Window Type="DefaultWindow" Name="Root" >
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />

        <Window Type="MainLook/FrameWindow" Name="Login/MainWindow" >
            <Property Name="Text" Value="Log In" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />

            <Property Name="TitlebarEnabled" Value="True" />
            <Property Name="CloseButtonEnabled" Value="False" />
            <Property Name="SizingEnabled" Value="False"/>

            <Property Name="UnifiedAreaRect" Value="{{0.3,0},{0.1,0},{0.7,0},{0.4,0}}" />


            <Window Type="MainLook/Editbox" Name="Login/MainWindow/Username" >
                <Property Name="Text" Value="" />
                <Property Name="MaxTextLength" Value="20" />
                <Property Name="UnifiedAreaRect" Value="{{0.45,0},{0.23,0},{0.9,0},{0.37,0}}" />

            </Window>

[...]

I can get "Login/MainWindow", the parent window, but "Login/MainWindow/Username" fails as if the window doesn't exist. Now, if I move that editbox up one level - in parallel to "Login/MainWindow" - then I can find it. So, the problem appears to be that children beyond a certain level are not accessible, somehow.

Note that the exact same file works fine in 0.6.1. Has how the getChild/getWindow functions operate changed between 0.6.1 and 0.6.2? (I don't see a mention in the changelog, but perhaps I'm not looking for the right thing)

Posted: Thu Dec 04, 2008 18:43
by CrazyEddie
Hi,

Yes the behaviour has been restored to it's original intended function (looking for directly attached children only). A new function Window::getChildRecursive has been added for the recursive / 'deep search' cases.

ChangeLog wrote:Bug Fix: The Window::getChild(const CEGUI::String&) function was incorrectly made recursive after the 0.5.x series of releases. This fix restores the correct behaviour and adds a Window::getChildRecursive(const CEGUI::String&) function for the highly expensive recursive case. See: http://www.cegui.org.uk/mantis/view.php?id=237


HTH and sorry for the inconvenience.

CE.

Posted: Thu Dec 04, 2008 19:55
by kripken
CrazyEddie wrote:Hi,

Yes the behaviour has been restored to it's original intended function (looking for directly attached children only). A new function Window::getChildRecursive has been added for the recursive / 'deep search' cases.

ChangeLog wrote:Bug Fix: The Window::getChild(const CEGUI::String&) function was incorrectly made recursive after the 0.5.x series of releases. This fix restores the correct behaviour and adds a Window::getChildRecursive(const CEGUI::String&) function for the highly expensive recursive case. See: http://www.cegui.org.uk/mantis/view.php?id=237


HTH and sorry for the inconvenience.

CE.

Thanks for the quick response, that was indeed the issue. A quick replace (of around 100 changes :) ) and now things appear to work ok.