Error property in looknfeel

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Akis
Just popping in
Just popping in
Posts: 14
Joined: Fri Jul 02, 2010 01:31
Contact:

Error property in looknfeel

Postby Akis » Fri Jul 02, 2010 01:54

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

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:

Re: Error property in looknfeel

Postby scriptkid » Fri Jul 02, 2010 07:17

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.
Check out my released snake game using Cegui!

Akis
Just popping in
Just popping in
Posts: 14
Joined: Fri Jul 02, 2010 01:31
Contact:

Re: Error property in looknfeel

Postby Akis » Fri Jul 02, 2010 17:26

Hi scriptkid,

Thanks ! I just forgot to add this line ^^

That works well now. Thanks :)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 19 guests