PushButton::setStandardImageryEnabled

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

User avatar
tgraupmann
Quite a regular
Quite a regular
Posts: 78
Joined: Thu Aug 18, 2005 00:47
Contact:

PushButton::setStandardImageryEnabled

Postby tgraupmann » Mon Oct 15, 2007 01:10

What did PushButton::setStandardImageryEnabled from CEGUI 4 convert to in CEGUI 5?

User avatar
tgraupmann
Quite a regular
Quite a regular
Posts: 78
Joined: Thu Aug 18, 2005 00:47
Contact:

Postby tgraupmann » Fri Oct 19, 2007 02:26

I just need to know what SetProperty should I use:
http://www.cegui.org.uk/wiki/index.php/SetProperty

Since there's nothing like the old method that I can see?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Oct 28, 2007 09:02

IIRC a replacement provision for this was not enabled in the skins provided with 0.5.x code; I guess at the time the idea was that people could basically knock up a simple button skin to do whatever they needed, so this particular ability was omitted.

If you need that specific behaviour, it can be emulated by modifying the skin. The <Section> element, which is used within <Layer> elements which appear in the various <StateImagery> specifications, has an attribute called 'controlProperty' - this can be used to specify the name of a boolean property (which should be added to the widget via a <PropertyDefinition>) that controls whether the section imagery will be rendered.

Basically you add a property named "StandardImageryEnabled" and use the 'controlPropery' feature described above to decide whether to render certain imagery.

Somewhere at the top of the LookNFeel for a button...

Code: Select all

...
<PropertyDefinition name="StandardImageryEnabled" initialValue="True" redrawOnWrite="true" />
...


Later on in the StateImagery bits...

Code: Select all

...
<StateImagery name="Normal">
    <Layer>
        <Section section="normal" controlProperty="StandardImageryEnabled" />
        <Section section="label">
            <ColourProperty name="NormalTextColour" />
        <Section>
    </Layer>
</StateImagery>
<StateImagery name="Hover">
    <Layer>
        <Section section="hover" controlProperty="StandardImageryEnabled" />
        <Section section="label">
            <ColourProperty name="HoverTextColour" />
        </Section>
    </Layer>
</StateImagery>
...

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:

Postby scriptkid » Sun Oct 28, 2007 11:38

Guess who's back ;)

User avatar
tgraupmann
Quite a regular
Quite a regular
Posts: 78
Joined: Thu Aug 18, 2005 00:47
Contact:

Postby tgraupmann » Sun Oct 28, 2007 18:57

Thanks for the tip. I feared I would never see an answer to this post. This is exactly what I was looking for.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 4 guests