Page 1 of 1

Error property in looknfeel

Posted: Fri Jul 02, 2010 01:54
by Akis
Hi everyone,

For my project, I used a ListboxItem with an image. So I looked for on the Wiki and I saw this page which explains how to do with a checkbox.

I try to change it to use an image instead of the checkbox, but I have an error when I use the SetProperty method.

So, the code in my looknfeel is globally the same, except I add this :

Code: Select all

<ImagerySection name="image">
         <ImageryComponent>
            <Area>
               <Dim type="TopEdge">
                  <AbsoluteDim value="0" />
               </Dim>
               <Dim type="LeftEdge">
                  <AbsoluteDim value="0" />
               </Dim>
               <Dim type="RightEdge">
                  <AbsoluteDim value="64" />
               </Dim>
               <Dim type="BottomEdge">
                  <AbsoluteDim value="64" />
               </Dim>
            </Area>
            <ImageProperty name="Image" />
            <VertFormat type="CentreAligned" />
            <HorzFormat type="LeftAligned" />
         </ImageryComponent>
      </ImagerySection>


And in my C++ code, I tried to use the Image property like this :

Code: Select all

item->setProperty("Image", "set:TaharezLook image:ClientBrush");

But I got an error : (Error) CEGUI::UnknownObjectException in file c:\...\ceguipropertyset.cpp(124) : There is no Property named 'Image' available in the set.

I don't see the error. Could you help me ?

Thanks

Re: Error property in looknfeel

Posted: Fri Jul 02, 2010 07:17
by scriptkid
Hi and welcome,

You need to have a definition for your property. For your code to work, you need to have a line like this in the beginning of your widget's looknfeel:

Code: Select all

<PropertyDefinition name="Image" initialValue="" redrawOnWrite="true" />


If you search for 'SelectionBrush' in the wiki page which you mentioned, you will see a sample of this relation. I think you're almost there :)

HTH.

Re: Error property in looknfeel

Posted: Fri Jul 02, 2010 17:26
by Akis
Hi scriptkid,

Thanks ! I just forgot to add this line ^^

That works well now. Thanks :)