BackgroundEnabled and FrameEnabled not honored

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:

BackgroundEnabled and FrameEnabled not honored

Postby tgraupmann » Sun Dec 02, 2007 18:22

I have a button that keeps showing the frame even though I've disabled it. Here is the layout and relevant XML:

Code: Select all

      <Window Type="TaharezLook/StaticImage" Name="MainMenuTitle">
         <Property Name="BackgroundEnabled" Value="False" />
         <Property Name="FrameEnabled" Value="False" />
         <Window Type="TaharezLook/Button" Name="MainMenuTraining">
            <Property Name="BackgroundEnabled" Value="False" />
            <Property Name="FrameEnabled" Value="False" />
            </Window>


Is there another way to disable the frame for a button?

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

Postby tgraupmann » Mon Dec 03, 2007 02:45

These two properties don't appear to be in the Property Set. How would I add them to the set so that I can disable the background and frame?

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

Postby tgraupmann » Mon Dec 03, 2007 02:50

I added the following to TaharezLook.looknfeel:

Code: Select all

<Falagard>
    <!--
    ***************************************************
        TaharezLook/Button
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/Button">
        <PropertyDefinition name="FrameEnabled" initialValue="True" redrawOnWrite="true" />
        <PropertyDefinition name="BackgroundEnabled" initialValue="True" redrawOnWrite="true" />


The properties can be get and set.

Still when I set to false, the background and frame are still being displayed.

What else must I do?

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

Postby tgraupmann » Mon Dec 03, 2007 03:11

Ah nevermind, I just switched to using an:
TaharezLook/ImageButton

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 » Mon Dec 03, 2007 11:11

Hi,

glad you found it :) About the PropertyDefinitions not working: that's because BackgroundEnabled and FrameEnabled are 'internal' properties, which the StaticImage renderer (inside cegui) defined/expects at code level. User defined properties are mainly used for additional (not widget specific) customizations such as colour overlays or images inside an Area for example. As you can see here, the StaticImage has these properties defined on widget level (the yellow ones):

http://www.cegui.org.uk/wiki/index.php/ ... taticImage

"Button" hasn't. Adding those properties to Buttons would require a code change.

HTH.
Check out my released snake game using Cegui!

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

Postby CrazyEddie » Mon Dec 03, 2007 11:33

tgraupmann wrote:I added the following to TaharezLook.looknfeel:

Code: Select all

<Falagard>
    <!--
    ***************************************************
        TaharezLook/Button
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/Button">
        <PropertyDefinition name="FrameEnabled" initialValue="True" redrawOnWrite="true" />
        <PropertyDefinition name="BackgroundEnabled" initialValue="True" redrawOnWrite="true" />


The properties can be get and set.

Still when I set to false, the background and frame are still being displayed.

What else must I do?


Although Scriptkid's reply is totally correct, it is possible to largely emulate the behavior within a look and feel xml file (maybe this is how we did it with ImageButton, I can't recall :-?). Basically you define the properties as you did and then use the "controlProperty" attribute in the <Section> elements to link the defined properties to the sections of imagery. When the property is true the section is rendered, and when the property is false the section is not rendered.

HTH

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 35 guests