CEGUI 0.5: How to set an image in a PushButton

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

franckypoune
Just popping in
Just popping in
Posts: 18
Joined: Tue Apr 18, 2006 08:19

CEGUI 0.5: How to set an image in a PushButton

Postby franckypoune » Fri Oct 06, 2006 14:47

Hello,
In 0.41 version, i used method as setNormalImage or setHoverImage to set in the code a new image to draw on a pushbutton.
But these methods disappears in the 0.5 version.
Have i to create a new LookAndFeel object for my push button?

Please help me, I am lost on the new implementation.

Thanks in advance

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Fri Oct 06, 2006 20:54

I think by using the "ImageButton" control, but i just went to the forum to ask for an example of how to use it as i can't find one on the wiki neither in the forum :)

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Oct 09, 2006 13:06

Ok, I found how to create an ImageButton, so for those who are looking on how to do it, here is a little sample:

Code: Select all

<Window Type="TaharezLook/ImageButton" Name="btnGeneral">
   <Property Name="UnifiedPosition" Value="{{0,50},{0,50}}" />
   <Property Name="UnifiedSize"     Value="{{0,77},{0,76}}" />
   <Property Name="NormalImage"     Value="set:myImageSet image:myButtonNormalImage"   />
   <Property Name="HoverImage"      Value="set:myImageSet image:myButtonHoverImage"    />
   <Property Name="PushedImage"     Value="set:myImageSet image:myButtonPushedImage"   />
   <Property Name="DisabledImage"   Value="set:myImageSet image:myButtonDisabledImage" />
</Window>

Hope this will help someone

franckypoune
Just popping in
Just popping in
Posts: 18
Joined: Tue Apr 18, 2006 08:19

Postby franckypoune » Mon Oct 09, 2006 18:28

Thank you for your answer Pompei2!
I looked for the method and property in the source code and not in the looknfeel file! Stupid i am!
:oops:

The "PropertyDefinition" are now set in looknfeel file.
So, i set ImageButton looknfeel in WindowsLook Looknfeel and it is ok!
Futhermode, in the source code, we can set the image with:
myImageButton->setProperty("myImageSetName","myImage");


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests