3.2.0

Change the image of the buttons

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
October 18,
http://activewidgets.com/javascript.forum.1469.1/replacing-record-number-column-with.html
October 18,
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 {background: url(icons.png)  -40px 0px;}
.aw-image-favorites {background: url(icons.png)  -80px 0px;}
.aw-image-search {background: url(icons.png) -120px 0px;}
.aw-image-fontsize {background: url(icons.png) -160px 0px;}

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

.aw-image-myImageName {background:url(myImage.gif) 0px 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
October 18,
Thank you!!!!!
Jose
October 20,
more simple method:

var obj = new AW.UI.Button;
obj.setControlText("<img src=save.gif height=14></img> Click me");
Kostya Volkov
November 5,
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
April 19,

This topic is archived.

See also:


Back to support forum