if button's width=100
1st=0
2nd=100(width)
3rd=200(width*2)
....
Yeah... and I got (bw*0) (bw*1) (bw*2) (bw*3) (bw*4) (bw*5) to work quite well by tweaking the code for myspace and lastfm a bit.
There were several little problems with the variable and button code Bryter had posted for querying discogs that I managed to work out. Here's the complete code for what I finally got to work after I included wikipedia, rateyourmusic and discogs to the myspace, lastfm and youtube URLs in marc2003's basic 'web links' script:
// ==PREPROCESSOR==
// @import "%fb2k_profile_path%marc2003\common.js"
// @import "%fb2k_profile_path%marc2003\tooltip_buttons.js"
// @name "Web Links"
// @author "marc2003"
// ==/PREPROCESSOR==
var bw = 32;
var bh = 32;
var top_margin = 0;
var left_margin = 0;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var panel_id = window.GetProperty("panel_id", window.id);
var custom_background_file = settings_path + panel_id + "buttons_background";
var custom_background = read(custom_background_file);
on_item_focus_change();
function on_size() {
ww = window.Width;
wh = window.Height;
}
function on_metadb_changed() {
if(!g_metadb) return;
var myspace = fb.TitleFormat("http://www.myspace.com/$replace(%artist%, ,)").EvalWithMetadb(g_metadb);
var lastfm = fb.TitleFormat("http://www.last.fm/music/$replace(%artist%, ,+,/,'%'252F,?,'%'3F)/_/$replace(%title%, ,+,/,'%'252F,?,'%'3F)").EvalWithMetadb(g_metadb);
var youtube = fb.TitleFormat("http://www.youtube.com/results?search_query=$replace(%artist%+%title%, ,+,'(',,')',,/,+,&,and)").EvalWithMetadb(g_metadb);
var wikipedia = fb.TitleFormat("http://en.wikipedia.org/wiki/$replace(%artist%, ,_)").EvalWithMetadb(g_metadb);
var rateyourmusic = fb.TitleFormat("http://rateyourmusic.com/artist/$lower($replace(%artist%, ,_))").EvalWithMetadb(g_metadb);
var discogs = fb.Titleformat("http://www.discogs.com/artist/$replace(%artist%, ,+)").EvalWithMetadb(g_metadb);
Buttons = {
but1: new Button(left_margin + (bw*0),top_margin,bw,bh, {normal: images_path + "myspace.png", hover: images_path + "myspace_h.png"}, function(){WshShell.run(myspace);}, myspace),
but2: new Button(left_margin + (bw*1),top_margin,bw,bh, {normal: images_path + "lastfm.png", hover: images_path + "lastfm_h.png"}, function(){WshShell.run(lastfm);}, lastfm),
but3: new Button(left_margin + (bw*2),top_margin,bw,bh, {normal: images_path + "youtube.png", hover: images_path + "youtube_h.png"}, function(){WshShell.run(youtube);}, youtube),
but4: new Button(left_margin + (bw*3),top_margin,bw,bh, {normal: images_path + "wikipedia.png", hover: images_path + "wikipedia_h.png"}, function(){WshShell.run(wikipedia);}, wikipedia),
but5: new Button(left_margin + (bw*4),top_margin,bw,bh, {normal: images_path + "rateyourmusic.png", hover: images_path + "rateyourmusic_h.png"}, function(){WshShell.run(rateyourmusic);}, rateyourmusic),
but6: new Button(left_margin + (bw*5),top_margin,bw,bh, {normal: images_path + "discogs.png", hover: images_path + "discogs_h.png"}, function(){WshShell.run(discogs);}, discogs)
}
window.Repaint();
}
function on_playback_new_track() {
on_item_focus_change();
}
function on_mouse_rbtn_up(x, y) {
buttons_menu(x,y);
return true;
}
function on_paint(gr) {
buttons_background(gr);
buttonsDraw(gr);
}
I also googled and found png icons for those 3 websites and photoshopped them down to 32x32 dpi main and highlighted buttons that work with the whole setup.
Haven't been able to figure out if it's possible to center all 6 icons in the WSH panel tho', instead of all being left justified.
TS