:: Forum >> Version 2 >>

Change the image of the buttons

More information on this topic is available in the documentation section: /active.howto/.

Hi everyone,

I'm trying to change the image of the controls (buttons) and I don't understand exactly how it works. Ok, I found a png file where seems to be all the icons, but how I can define my own? Now only home, favorites, find... are available.
Thx in advance
Jose
Tuesday, October 18, 2005
http://activewidgets.com/javascript.forum.1469.1/replacing-record-number-column-with.html
Tuesday, October 18, 2005
Yes, for each icon you have to add css rule which maps image name to either separate file or region in 'image library':

.aw-image-home {backgroundurl(icons.png)  -40px 0px;}
.
aw-image-favorites {backgroundurl(icons.png)  -80px 0px;}
.
aw-image-search {backgroundurl(icons.png) -120px 0px;}
.
aw-image-fontsize {backgroundurl(icons.png) -160px 0px;}

 
Alex (ActiveWidgets)
Tuesday, October 18, 2005
If you want to add your own images, you can do so like this:

.aw-image-myImageName {background:url(myImage.gif0px 0px;}  You can add as many of these as you like in your CSS file. Naturally, myImage.gif can be any name of a gif or png (I have not tried a JPG, but I don't see why it won't work although it might look funny if the background of the image doesn't mathc the background of the object you are using it on)
Jim Hunter
Tuesday, October 18, 2005
Thank you!!!!!
Jose
Thursday, October 20, 2005
more simple method:

var obj = new AW.UI.Button;
obj.setControlText("<img src=save.gif height=14></img> Click me");
Kostya Volkov
Sunday, November 5, 2006
I am trying to use the above, it works, But, what is the best way to adjust
the image size to the control size , for example what if the image is 72px by 72px
Chris Mindrum
Thursday, April 19, 2007



This topic is archived.

Back to /active.howto/

Documentation:

Forum search