Page 1 of 1

CEGUI 0.5: How to set an image in a PushButton

Posted: Fri Oct 06, 2006 14:47
by franckypoune
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

Posted: Fri Oct 06, 2006 20:54
by Pompei2
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 :)

Posted: Mon Oct 09, 2006 13:06
by Pompei2
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

Posted: Mon Oct 09, 2006 18:28
by franckypoune
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");