Page 1 of 1

[Resloved]appear error when adds ListHeader

Posted: Mon Nov 16, 2009 11:28
by cty41
Hi, everyone.I am new to CEGUI and now using CELayoutEditor to create GUI.
When I wanna add a ListHeader to listbox ,CELayoutEditor throws a exception

Code: Select all

Description: Error
Exception Location: EditorDocument::GetRelevantProperties
Exception Message: ListHeader::getSortSegment - Sort segment was invalid!  (No segments are attached to the ListHeader?)
Exception Filename: ..\..\..\src\elements\CEGUIListHeader.cpp
Exception Line: 165
16/11/2009 18:56:09 (Std)    EditorDocument::SelectWindow - Newselected: 'DefaultGUISheet/FrameWindow/RoomListbox/ListHeader'


Sorry for trouble you. But I am really unfamiliar with these list widget.I check the source code,found the exception come from here.But I don't know why?

Code: Select all

/*************************************************************************
   Return the sort-key segment.
*************************************************************************/
ListHeaderSegment& ListHeader::getSortSegment(void) const
{
   if (!d_sortSegment){
      throw   InvalidRequestException("ListHeader::getSortSegment - Sort segment was invalid!  (No segments are attached to the ListHeader?)");
   }
   else{
      return *d_sortSegment;
   }
}

And I searched the google and forums ,but came out no results(only serched a same resulthttp://www.cegui.org.uk/phpBB2/viewtopic.php?f=7&t=3406)
Are there any people know where is my mistake?Any help will be helpful!Thank you@0@

Re: appear error when adds ListHeader

Posted: Mon Nov 16, 2009 17:17
by Jamarr
You need to post your CEGUI.log file so we know what version and configuration you are using. In regards to your problem, you should post the xml-layout that you are using so we can verify the window and layout information, and you should also post the relevant code (your code) that is resulting in the exception. Posting the callstack at the point where the exception is thrown would also be beneficial.

From the little information you've given, it is hard to say what is causing the exception. From what I can tell, adding a header to the MultiColumnList has nothing to do with this exception. Judging by the exception, it looks the code is trying to access the header used for (user) sorting, but the (user) sort-header has not been assigned.

Re: appear error when adds ListHeader

Posted: Tue Nov 17, 2009 00:07
by cty41
Thx.
Here is my log file.http://pastebin.com/m3f24f707.My CELayoutEditor version is 0.6.2.
Here is my layout file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>

<GUILayout >
    <Window Type="DefaultWindow" Name="DefaultGUISheet" >
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="AquaLook/FrameWindow" Name="DefaultGUISheet/FrameWindow" >
            <Property Name="Text" Value="Join Room" />
            <Property Name="TitlebarFont" Value="BlueHighway-12" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="TitlebarEnabled" Value="True" />
            <Property Name="UnifiedAreaRect" Value="{{0.148438,0},{0.111979,0},{0.845703,0},{0.851563,0}}" />
            <Window Type="AquaLook/Button" Name="DefaultGUISheet/FrameWindow/JoinButton" >
                <Property Name="Text" Value="Join" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.0469853,0},{0.190352,0},{0.147612,0},{0.244785,0}}" />
            </Window>
            <Window Type="AquaLook/Button" Name="DefaultGUISheet/FrameWindow/RefreshButton" >
                <Property Name="Text" Value="Refresh" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.049434,0},{0.252282,0},{0.150061,0},{0.306715,0}}" />
            </Window>
            <Window Type="AquaLook/Button" Name="DefaultGUISheet/FrameWindow/CancelButton" >
                <Property Name="Text" Value="Cancel" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.0469853,0},{0.317471,0},{0.147613,0},{0.371904,0}}" />
            </Window>
            <Window Type="AquaLook/MultiColumnList" Name="DefaultGUISheet/FrameWindow/MultilineList" >
                <Property Name="Font" Value="BlueHighway-12" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.266387,0},{0.155634,0},{0.944958,0},{0.923239,0}}" />
            </Window>
        </Window>
    </Window>
</GUILayout>

I only use CELayoutEditor, and don't know how to post exception callstack.
I just tried to add a listHeader to MultiColumnList,do I need set something in MultiColumnList?

Re: appear error when adds ListHeader

Posted: Tue Nov 17, 2009 00:24
by DtD
You can upload your log file to http://www.pastebin.com/

~DtD

Re: appear error when adds ListHeader

Posted: Tue Nov 17, 2009 16:50
by Jamarr
Apparently this is a known issue, but it has been fixed. Basically, You need to use a newer version of the CELayoutEditor. There is a work around, which is to manually add the definitions to the layout file using a text editor.

Re: appear error when adds ListHeader

Posted: Wed Nov 18, 2009 00:56
by cty41
Thank a lot!!I will try to add listheader manually