Page 1 of 1

children in scroll bars [SOLVED... i think]

Posted: Sat Jul 12, 2008 01:26
by ara
im trying to create a vscroll bar working and im getting an assertion error when it tries to load the widget.

line 512

Expression: d_childcomponent != 0

log file is here,

arathalion.alumnaie.net/misc/CELayoutEditor.log

here is the widget that is killing it

Code: Select all

        <!--
    bbUI/vscroll
    -->
    <WidgetLook name="bbUI/vscroll">
       <Property name="VerticalScrollbar" value="True" />
       <Child type="bbUI/vscroll/thumb" nameSuffix="__auto_thumb__">
            <Area>
                <Dim type="LeftEdge">
                    <AbsoluteDim value="0"/>
                </Dim>
                <Dim type="TopEdge">
                    <AbsoluteDim value="0"/>
                </Dim>
                <Dim type="Width">
                    <UnifiedDim scale="1" type="Width"/>
                </Dim>
                <Dim type="Height">
                    <UnifiedDim scale="0.1" type="Height"/>
                </Dim>
            </Area>
        </Child>
        <Child type="bbUI/vscroll/down" nameSuffix="__auto_incbtn__">
            <Area>
                <Dim type="LeftEdge">
                    <AbsoluteDim value="0"/>
                </Dim>
                <Dim type="TopEdge">
                    <AbsoluteDim value="0"/>
                </Dim>
                <Dim type="Width">
                    <UnifiedDim scale="1"
                        type="Width"/>
                </Dim>
                <Dim type="Height">
                    <ImageDim imageset="bbButtons"
             image="down"
             dimension="Height"
                        />
      </Dim>
        </Area>
        <VertAlignment type="BottomAligned" />
      <Property name="NormalImage" value="set:bbButtons image:down"/>
      <Property name="HoverImage" value="set:bbButtons image:downHov"/>
      <Property name="PushedImage" value="set:bbButtons image:downPre"/>
        </Child>
        <Child type="bbUI/vscroll/up" nameSuffix="__auto_decbtn__">
            <Area>
                <Dim type="LeftEdge">
                    <AbsoluteDim value="0"/>
                </Dim>
                <Dim type="TopEdge">
                    <AbsoluteDim value="0"/>
                </Dim>
                <Dim type="Width">
                    <UnifiedDim scale="1"
                        type="Width"/>
                </Dim>
                <Dim type="Height">
                    <ImageDim imageset="bbButtons"
             image="up"
             dimension="Height"
                        />
                </Dim>
            </Area>
      <Property name="NormalImage" value="set:bbButtons image:up"/>
      <Property name="HoverImage" value="set:bbButtons image:upHov"/>
      <Property name="PushedImage" value="set:bbButtons image:upPre"/>
        </Child>
        <ImagerySection name="en">
            <ImageryComponent>
                <Area>
                    <Dim type="LeftEdge">
                        <AbsoluteDim value="0"/>
                    </Dim>
                    <Dim type="TopEdge">
                        <AbsoluteDim value="0"/>
                    </Dim>
                    <Dim type="Width">
                        <UnifiedDim scale="1"
                            type="Width"/>
                    </Dim>
                    <Dim type="Height">
                        <UnifiedDim scale="1"
                            type="Height"/>
                    </Dim>
                </Area>
                <Image imageset="bbButtons"
                    image="vscroll"
                    />
                <VertAlignment type="Stretched"/>
            </ImageryComponent>
        </ImagerySection>
        <StateImagery name="Enabled">
            <Layer>
                <Section section="en"/>
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled"/>
        <NamedArea name="ThumbTrackArea">
            <Area>
                <Dim type="LeftEdge" >
                    <AbsoluteDim value="0" />
                </Dim>
                <Dim type="TopEdge" >
                    <ImageDim imageset="bbButtons"
                        image="up"
                        dimension="Height"
                        />
                </Dim>
                <Dim type="RightEdge" >
                    <UnifiedDim scale="1.0"
                        type="RightEdge" />
                </Dim>
                <Dim type="BottomEdge" >
                    <UnifiedDim scale="1.0" type="BottomEdge">
                        <DimOperator op="Subtract">
                            <ImageDim imageset="bbButtons"
                                image="down"
                                dimension="Height"
                                />
                        </DimOperator>
                    </UnifiedDim>
                </Dim>
            </Area>
        </NamedArea>
        <Property name="VerticalScrollbar" value="True"/>
    </WidgetLook>


if anyone can tell me what im doing wrong it would be much appreceated.

Edit: I think its worth saying that i only added the <Property name="State" value="set:imageset image:iamge"/> lines cause it seemed to be the only major difference between that vscroll and working ones.

i have a working sliding bar and its child reference and the child widget look pretty much the same so i have little idea whats going wrong.

Posted: Sat Jul 12, 2008 06:30
by CrazyEddie
Hi, and welcome :)

Firstly, I'd highly recommend the use of the Xerces XML parser module when doing any XML development work - since it validates your XML and can indicate many issues early - though sometimes it can also be a PITA ;)

The XML posted looks generally fine (though it's not 100% 'valid' according to the schema). The only potential issues I saw were:

Code: Select all

<Property name="VerticalScrollbar" value="True" />

The value should really be "true" (no capital). I'm not sure if or how this affects things, and may be dependent upon the XML parser in use (a slight aside: I know layouts use "True" in property values, this is an historical inconsistency, and I apologise!).

You have another copy of the above property setter at the bottom of the XML.

The named area should be before the child definitions, I don't think this would cause an issue though (excepting the fact it's not 100% valid from a xerces perspective).

oh, and I couldn't view the log, as the site was not responding.

CE.

Posted: Sat Jul 12, 2008 08:24
by ara
try here for the log.

i think the site may have been down a little, cause it seems to work for me.
if that doesnt work, then ill upload it elsewhere. yeah, its in there twice cause i copyed it in a second time whilst debugging. whoops.

ill swap the named area position and check at some point soon and post back.

i dont know which xml passer we are using, ive only been testing it with the layout editor.

thanks for the help though. ill post back when i get round to testing it, though ill change the xml now. (i havent been bothered compiling the layout editor in linux.)

Posted: Sat Jul 12, 2008 10:27
by ara
well, i moved the named area to the top and changed it to true and it threw the same error and the log was the same.

Posted: Sun Jul 13, 2008 08:57
by CrazyEddie
The line:

Code: Select all

<VertAlignment type="Stretched"/>
in the ImageryComponent should be using the VertFormat tag and not VertAlignment.

CE

Posted: Sun Jul 13, 2008 12:18
by ara
thanks again for the reply, but unfortunatly that didnt fix it. log is still the same.

Posted: Mon Jul 14, 2008 00:09
by ara
could it be the slider that passed before or one of the children widgets its referencing causing the problem?
i can post them up here aswell.

Posted: Mon Jul 14, 2008 08:28
by CrazyEddie
The assertion mentioned in the original post is only triggered by three possible scenarios:
1) VertAlignment element used when not in a Child element.
2) HorzAlignment element used when not in a Child element.
3) Area specification closed when not in a Child, NamedArea, ImageryComponent, TextComponent, or FrameComponent.

Aside from checking those, I have no further ideas for that issue.

CE.

Posted: Wed Jul 16, 2008 00:47
by ara
hmm. well thanks anyway. ive asked some other people on the project to go through the looknfeel file just in case ive missed anything, but i cant see any problem with any of those things.

ill post back here when we come to some kind of decision.

Posted: Wed Jul 16, 2008 08:35
by CrazyEddie
A while back we (as in the CEGUI devs) spoke about the possibility of providing a small stand-alone tool to perform XML validation for those people who do not use Xerces with CEGUI. I think we should definitely make that happen for the next release, as such a tool would make your task here much, much easier.

CE.

Posted: Sat Jul 19, 2008 00:41
by ara
well. i dunno, but it isnt breaking anymore. thanks for the suggestions. i think i might have inadvertadly changed something cause of them and then not tested it... dunno, but it works now (well, im not getting the assert). thanks.

and yeah, that tool would be really handy. especially since there doesnt seem to be a way (at a glance) to force log generation with the layout editor.]

EDIT: Well that was smart, not checking in the layout editor folder for a log... whoops.