Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WSH Panel Mod script discussion/help (Read 1385946 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #425
I´m trying to add some fields and edit a little this track info script, thanks Hitchhiker427 and Marc2003 for the code! and I kind a need some help...

I´m using the line "playback = fb.TitleFormat("%playback_time%").EvalWithMetadb(g_metadb);" along with the gr.GdiDrawText one
to display the playback time but it always shows up "?".

Also how can I align the text to the left instead of using the "center of the word/field" so that I can align all the info such as playback time, bitrate, etc in the left like using a tab? Maybe replacing the "DT_CENTER" value?

Is it possible as well, to display the sample rate "in the natural behavior" like %filesize_natural% such that if it´s "48000 Hz" it displays "48 Khz" and what´s the syntax of the volume say in db to display it too? I couldn´t find it in the help files.

Here´s what I´m using:
Code: [Select]
var image_path = fb.FoobarPath + "colores personalizados\\";
var g_img = gdi.Image(image_path + "Fondo Azul.bmp");
var background_width = 220;
var background_height = 300;
var artist = title = album = track = '';
var bgcolor = RGB(238,246,253);
var textcolor1 = RGB(249, 249, 249);
var textcolor2 = RGB(249, 249, 249);
var font1 = gdi.Font("Segoe UI", 14, 1);
var font2 = gdi.Font("Segoe UI", 14, 1);
var font3 = gdi.Font("Segoe UI", 10, 0);


DT_CENTER = 0x00000001;
DT_NOPREFIX = 0x00000800;
DT_END_ELLIPSIS = 0x00008000;
g_metadb = fb.GetFocusItem();
on_item_focus_change();

function RGB(r,g,b) {
return (0xff000000|(r<<16)|(g<<8)|(b));
}

function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, bgcolor);
gr.DrawImage(g_img, 0, 0, ww, wh, 0, 0, background_width, background_height);
if(g_metadb) {
gr.GdiDrawText(title, font1, textcolor1, 0, 0, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
gr.GdiDrawText(artist, font2, textcolor2, 0, 17, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
gr.GdiDrawText(album, font3, textcolor2, 0, 40, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
gr.GdiDrawText(track, font3, textcolor2, 0, 50, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
gr.GdiDrawText(channels, font3, textcolor2, 148, 3, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
gr.GdiDrawText(playback, font3, textcolor2, 144, 16, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
gr.GdiDrawText(bitrate, font3, textcolor2, 155, 29, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
gr.GdiDrawText(samplerate, font3, textcolor2, 155, 42, ww, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
}
}

function on_size() {
ww = window.Width;
wh = window.Height;
}

function on_metadb_changed() {
artist = fb.TitleFormat("$replace([%artist%],_, )$replace($stripprefix($substr([%title%],1,$sub($strstr(%title%,-),2)),-),_, )").EvalWithMetadb(g_metadb);
title = fb.TitleFormat("$replace($stripprefix($substr([%title%],$strstr(%title%,-),1000),-),_, )").EvalWithMetadb(g_metadb);
album = fb.TitleFormat("[%album%] ['('%date%')']").EvalWithMetadb(g_metadb);
track = fb.TitleFormat("[Track # %tracknumber%]").EvalWithMetadb(g_metadb);
playback = fb.TitleFormat("%playback_time%").EvalWithMetadb(g_metadb);
channels = fb.TitleFormat("%channels%").EvalWithMetadb(g_metadb);
bitrate = fb.TitleFormat("%bitrate% Kbps").EvalWithMetadb(g_metadb);
samplerate = fb.TitleFormat("%samplerate% Hz").EvalWithMetadb(g_metadb);
window.Repaint();
}

function on_item_focus_change() {
if (g_metadb) window.UnwatchMetadb();
g_metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (g_metadb) {
on_metadb_changed();
window.WatchMetadb(g_metadb);
}
}

function on_playback_new_track() {
on_item_focus_change();
}
Thanks!

WSH Panel Mod script discussion/help

Reply #426
@Wooops:
For the playback time, try using "playback = fb.TitleFormat("%playback_time%").Eval()". 

For left aligning, try just removing DT_CENTER altogether... I think that will work. 

Next, I'm not sure what to do about the natural sample rate.  I'm almost sure that there's an easy way to do it.  However, here's a brute-force method.  This will get the job done, but hopefully someone can post something more efficient:
Code: [Select]
sample_rate = fb.TitleFormat("%samplerate%").Eval();
if(sample_rate.substring(sample_rate.length - 3, sample_rate.length) == "000") sample_rate = sample_rate.substring(0,sample_rate.length - 3);
else {
    sample_rate = sample_rate.substring(0,sample_rate.length - 3) + "." + sample_rate.substring(sample_rate.length - 3,sample_rate.length);
    if(sample_rate.substring(sample_rate.length - 1, sample_rate.length) == "0") sample_rate = sample_rate.substring(0, sample_rate.length - 1);
    if(sample_rate.substring(sample_rate.length - 1, sample_rate.length) == "0") sample_rate = sample_rate.substring(0, sample_rate.length - 1);
}
sample_rate = sample_rate + " kHz";

Finally, the volume is just "fb.Volume"

----------

Now, I have a question for myself.  I'm trying out Columns UI, and I'm just wondering if there's a way to show/hide panels with WSH Panel Mod.  If so, how would I go about doing that?  I know this is possible with PSS, but I'm unfamiliar with that scripting language, and would prefer to use WSH Panel Mod if at all possible.  Thanks.

WSH Panel Mod script discussion/help

Reply #427
@Hitchhiker427

or just

sample_rate = fb.TitleFormat("%samplerate%").Eval();

gr.GdiDrawText(sample_rate/1000+" kHz", font, textcolor, 155, 42, ww, 24, 0);


----------

Now, I have a question for myself. I'm trying out Columns UI, and I'm just wondering if there's a way to show/hide panels with WSH Panel Mod. If so, how would I go about doing that? I know this is possible with PSS, but I'm unfamiliar with that scripting language, and would prefer to use WSH Panel Mod if at all possible. Thanks.

---------

I don't think that can be done without PSS.






WSH Panel Mod script discussion/help

Reply #428
@Hitchhiker427
uh well I had been playing... The playback and the volume show up, but they don´t get updated  I´ve to manually refresh* the panel each time...
and with the volume I used the code from another sample to limit the decimals "volume = fb.TitleFormat(Math.ceil(fb.volume)+" dB").EvalWithMetadb(g_metadb); though It would be better with two decimals as F2K does.

Also I realized that sometimes the title overlapped the right side info, so I limited it´s width "gr.GdiDrawText(title, font1, textcolor1, 0, 0, 305, 24, D.." but then the title is no longer centered so I created a "DT_CENTER2" for the title, with no luck with the values so far.

Quote
"For left aligning, try just removing DT_CENTER altogether... I think that will work."

Removing it worked perfectly  and both sample rate script works great too.

Thanks for the help.

Edit: In asking there´s no trick so I wonder is it possible to move the title to the bottom (more centered) when there´s no album or track info?

WSH Panel Mod script discussion/help

Reply #429
samples updated:

http://cid-649d3bfeaf541fbb.office.live.co...ide/samples.zip

contains a new script that displays thumbnails of images in a folder.


-no support for scrolling in thumbnail view if you have too many images to fit in the panel (in full view, you can use the mouse wheel to scroll through all images)
-it chokes a bit if you have a folder full of lots of large images


Great!
There is some request.
1. Multiple folder support.
2. Image size fit to panel size.
3. External viewer launch mode.
4. Thumbs centering.(now exist rest on right)
5. Glow effect.
6. Thumbs size editing.

Of course, It is not compulsion.

WSH Panel Mod script discussion/help

Reply #430
1) done, just remember it will be slow if you have too many images. use | to separate folders in custom folder dialog box.
2) there was already an option to fill the panel (with cropping). you can untick the "Fill" context menu item to show the whole image.
3) done
4) already does??
5) not really sure what you mean by this??
6) i haven't added an option for editing as such but i've added some choices for size on the context menu.

http://cid-649d3bfeaf541fbb.office.live.co...ide/samples.zip


WSH Panel Mod script discussion/help

Reply #431
^i just re-uploaded because i totally fudged the multiple folder support. it should work now. 

WSH Panel Mod script discussion/help

Reply #432
1) done, just remember it will be slow if you have too many images. use | to separate folders in custom folder dialog box.
2) there was already an option to fill the panel (with cropping). you can untick the "Fill" context menu item to show the whole image.
3) done
4) already does??
5) not really sure what you mean by this??
6) i haven't added an option for editing as such but i've added some choices for size on the context menu.

http://cid-649d3bfeaf541fbb.office.live.co...ide/samples.zip


Oh..., Thank you!!! 

1. How I can Limit number of image each folder?
or..., Is it possible add paging function same as google image search?
And 'slow' mean inside WSH Panel Mod panel? or affect fb2k playback?
2. I see. Thank you.
3. Thank you.
4. Umm, Like iTunes grid view, it is centering total.
5. I'm sorry. misstake. "glass effect" is correct. like cd art display skins.
Also I thinking reflection effect.(like iTunes cover flow.)
6. Thank you.

There is new ideas.
7. If panel area is spacious, Thumbs and big image show same time.
8. Use concurrent Last.fm artist art mode and Custom folder mode.
Now I operate "set 'data_folder + $crc32(%artist%)' to Custom folder->get lastfm image->set custom folder mode".
9. "Open this image" assign to Middle click.
10. Edit Last.fm artist art download folder path.
I want use like this.
C:\Image\Artist\$replace(%artist%,\,-,/,-,:,-,*,-,?,-,",-,<,-,>,-,|,-)\

Well, please develop and maintain this script.

You may not do all.
You need not conform to these.
Of course, you can say "Do it yourself.". 

^i just re-uploaded because i totally fudged the multiple folder support. it should work now. 

OK. Thank you.

WSH Panel Mod script discussion/help

Reply #433
1) it only slows down the panel. you might find clicking on an image to "maximise" it is slow. and also scrolling images if they are too many to fit in the panel can also be slow. i might think about adding pagination support.
5) if you have an overlay image i could use, i could add it....
7) & 8) maybe i'll think about it.
9) done. download again using the link above
10) you can change the path used by last.fm mode by editing the title formatting on line 83.

WSH Panel Mod script discussion/help

Reply #434
I´ve got the playback and volume refreshing adding
Code: [Select]
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;

gr.GdiDrawText(fb.TitleFormat("%playback_time%").Eval(), font3, textcolor2, 310, 16, ww, 24, DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);
gr.GdiDrawText(fb.TitleFormat(Math.ceil(fb.volume)+" dB").Eval(), font3, textcolor2, 307, 29, ww, 24, DT_END_ELLIPSIS | DT_CALCRECT | DT_NOPREFIX);

function on_playback_seek(time){
window.Repaint();
}
function on_playback_pause(state){
}
function on_playback_edited(){
}
function on_playback_dynamic_info(){
}
function on_playback_dynamic_info_track(){
}
function on_volume_change(val) {
window.Repaint();
}
Solved the position of the title too.
About moving the title to the bottom when there´s no album/track. I tried this:
Code: [Select]
g_metamiss = fb.TitleFormat("(%album% MISSING) AND (%tracknumber% MISSING)");
g_metahas = fb.TitleFormat("(%album% PRESENT) OR (%tracknumber% PRESENT)");

function on_paint(gr) {
gr.FillSolidRect(0, 0, ww, wh, bgcolor);
gr.DrawImage(g_img, 0, 0, ww, wh, 0, 0, background_width, background_height);
if(g_metadb) {
if(g_metahas) {
gr.GdiDrawText(title, font1, textcolor1, 0, 0, 305, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
}
if(g_metamiss) {
gr.GdiDrawText(title, font1, textcolor1, 0, 30, 305, 24, DT_CENTER | DT_END_ELLIPSIS | DT_NOPREFIX);
}
It displays two titles and not sure what to do/try next. Help is appreciated. btw if the questions are too silly just point me to the documentation/samples. Thanks


WSH Panel Mod script discussion/help

Reply #436
1) it only slows down the panel. you might find clicking on an image to "maximise" it is slow. and also scrolling images if they are too many to fit in the panel can also be slow. i might think about adding pagination support.
5) if you have an overlay image i could use, i could add it....
7) & 8) maybe i'll think about it.
9) done. download again using the link above
10) you can change the path used by last.fm mode by editing the title formatting on line 83.


Thank you very much.

1) I see. another idea: Like autopagerize.(userscript on modern browser. auto addition page when scroll.)
5) I have some overlay image. but these are small on maximized image. umm.
I do not think glass effect are necessary.
But now this script gui appearance is very simplicity.(Yes, I know this is sample script.)
I may want little decorate.
9) Thank you.
10) OK. but I hope this script get function that use custom folder and lastfm artist image simultaneous.

Thank you.

WSH Panel Mod script discussion/help

Reply #437
Hello everybody,

I would like to understand more how works WSH Panel Mod and I'm trying to understand some scripts. I would like to do a button that fade on and out, between normal and hover state. I would like to know if someone has a "little" script in order to do that ? I found some ideas in Br3tt skin, but a little help would be welcome !

Thanks !

WSH Panel Mod script discussion/help

Reply #438
Take a look to my Duifoon button scritpts, you may get some ideas. I have there image and text button script with fading effect.

WSH Panel Mod script discussion/help

Reply #439
Thank you, I will take a look !

WSH Panel Mod script discussion/help

Reply #440
Would like to know if it is possible to do something like this : Create buttons in PSS and I would like to make a border that will fade around that button with WSH.

I have found how to draw my button in front of the WSH panel. Here is my code for the WSH panel

Code: [Select]
var g_foc = 0;

function on_paint(gr){
    
    if(g_foc){
        gr.FillSolidRect(0,0,window.Width,window.Height,RGB(0,0,0));
    }
    else {  
        gr.FillSolidRect(0,0,window.Width,window.Height,RGB(100,100,100));      
    }
}
    
function on_mouse_move(x,y){
    g_foc = 1;
        window.Repaint();
}

function on_mouse_leave(x,y){
   if(g_foc){
        g_foc = 0;
        window.Repaint();
        }
    }


I wanted just for a test make the WSH panel become black when the mouse pass on and grey when it is not focused.

Here is what I have first:

When the mouse is on the WSH panel (it works fine)

But when the mouse focused the button in PSS, the WSH panel seems to not be still focused.

So my question, is it possible that the WSH panel is still focused (so black) when the button is pointing ?

WSH Panel Mod script discussion/help

Reply #441
Hey guys,
This is my work in progress, right now it is currently 3 WSH panels,  I will eventually merge them into 1 hopefully soon.

One question, I put both Similar Artist & Rating codes together, and I can't figure out how to isolate the RATING button click to just the stars area.
Whenever I click in the panel, the star rating will correspond with the X axis position, so clicking on the similar artists doesn't go to their last.fm website.



The code is a little messy, let me know if you need more details, since I hope to release this DUI eventually.

Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_path%scripts\simple_buttons.js"
// @import "%fb2k_path%scripts\utils.js"
// @import "%fb2k_path%scripts\marc2003\v2\common.js"
// ==/PREPROCESSOR==

function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
var bw = 13;
var bh = 13;
var left_margin = 48;
var top_margin = 89;
var Buttons;
var g_metadb;
var section = "SIMILARPANEL";
var rating;
var nrating;
var lrating;
var img;
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);
var g_drag = 0;
var g_tfo = fb.TitleFormat("%rating%");
var artist = ""
var album = ""
var title = ""
var codec = ""
var bitrate = ""
var played = ""
var codecprofile = ""
var played = ""
var genre = ""
var lastartist = ""
var lastplay = ""
var rating = ""
var last1 = ""
var last2 = ""
var last3 = ""
var last4 = ""
var playing = "0"
var playcount = "0";
var year = 0;
var date = 0;
var difyear = 0;
var date2 = 0;
var avgdate = 0;
var difdate = 0;
var today = 0;
var ar_days = 0;
var ar_years = 0;
var ar_days2 = 0;
var ar_years2 = 0;
var ar_days3 = 0;
var ar_years3 = 0;
var ar_days4 = 0;
var ar_years4 = 0;
var bitrate = 0;
var days = 0;
var hours = 0;
var minutes = 0;
var seconds = 0;
var on_playback_new_track2 = 0;
var playcount = "0";
var playcount2 = 0;
var playcount3 = 0;
var playcount4 = 0;
var avgplaycount = 0;
var minplaycount = 0;
var maxplaycount = 0;
var ranplaycount = 0;
var devplaycount = 0;
var test = 0;
var test2 = 0;
var dui = window.InstanceType;

var g_font = dui == 1 ? window.GetFontDUI(0) : window.GetFontCUI(0);
//var color = RGB(200,0,0);
var color = dui == 1 ? window.GetColorDUI(2) : RGB(200,0,0);
//var color2 = RGB(0,0,0);
var color2 = dui == 1 ? window.GetColorDUI(0) : window.GetColorCUI(0);
var color3 = RGB(255,99,71);

//global Variables for text field
var DT_TOP = 0x00000000;
var DT_LEFT = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_RIGHT = 0x00000002;
var DT_VCENTER = 0x00000004;
var DT_BOTTOM = 0x00000008;
var DT_WORDBREAK = 0x00000010;
var DT_SINGLELINE = 0x00000020;
var DT_EXPANDTABS = 0x00000040;
var DT_TABSTOP = 0x00000080;
var DT_NOCLIP = 0x00000100;
var DT_EXTERNALLEADING = 0x00000200;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var DT_INTERNAL = 0x00001000;
var DT_EDITCONTROL = 0x00002000;
var DT_PATH_ELLIPSIS = 0x00004000;
var DT_END_ELLIPSIS = 0x00008000;
var DT_MODIFYSTRING = 0x00010000;
var DT_RTLREADING = 0x00020000;
var DT_WORD_ELLIPSIS = 0x00040000;
var DT_NOFULLWIDTHCHARBREAK = 0x00080000;
var DT_HIDEPREFIX = 0x00100000;
var DT_PREFIXONLY = 0x00200000;
var defaultartistimage = "";
var lastfmdatapath = "";
var g_tooltip = window.CreateTooltip();
var g_down = false;
var timer = null;
var btn_down = null;
var cur_btn = null;
var ww = window.Width;
var wh = window.Height;
window.GetProperty("currentArtists", "");
window.GetProperty("bio_played", "");


function reloadConf(inipath)
{
skinpath = translatePath(utils.ReadINI(inipath, "SKIN", "imgpath", ""),true);
window.GetProperty("buttons.show", utils.ReadINI(inipath, section, "showbuttons", "0"));
window.GetProperty("buttons.list", utils.ReadINI(inipath, section, "buttons", ""));
window.GetProperty("font.name", utils.ReadINI(inipath, section, "fontname", "Segoe UI"));
window.GetProperty("font.size", utils.ReadINI(inipath, section, "fontsize", "10"));
window.GetProperty("buttons.width", utils.ReadINI(inipath, section, "buttonswidth", "110"));
window.GetProperty("buttons.height", utils.ReadINI(inipath, section, "buttonsheight", "38"));
lastfmdatapath = translatePath(utils.ReadINI(inipath, "LASTFM", "datapath"),true);
updateButtons();

}

reloadConf(inipath);


function on_script_unload()
{
utils.WriteINI(inipath, section, "showbuttons", window.GetProperty("buttons.show"));
utils.WriteINI(inipath, section, "buttons", window.GetProperty("buttons.list"));
utils.WriteINI(inipath, section, "fontname", window.GetProperty("font.name"));
utils.WriteINI(inipath, section, "fontsize", window.GetProperty("font.size"));
utils.WriteINI(inipath, section, "buttonswidth", window.GetProperty("buttons.width"));
utils.WriteINI(inipath, section, "buttonsheight", window.GetProperty("buttons.height"));
}

function ArtistButton(x, y, w, h, img, func, tiptext, url)  {
this.left = x;
this.top = y;
this.w = w;
this.h = h;
this.right = x + w;
this.bottom = y + h;
this.func = func;
this.tiptext = tiptext;
this.url = url;
this.font = gdi.Font(window.GetProperty("font.name"), window.GetProperty("font.size"), 0);
this.color = RGB(255,255,255);
this.state = ButtonStates.normal;
this.img= img;

this.lastfmcommand = url;

this.alterImage = function(img_src) {
this.img= img_src ? gdi.Image(img_src) : null;

this.changeState(this.state);
}

this.traceMouse = function (x, y) {
var b = (this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom);
if (b)
g_down ? this.changeState(ButtonStates.down) : this.changeState(ButtonStates.hover);
else
this.changeState(ButtonStates.normal);
return b;
}


this.changeState = function (newstate) {
if (newstate != this.state)
window.RepaintRect(this.left, this.top, this.w, this.h);
this.state = newstate;
switch (this.state)
{
case ButtonStates.normal:
this.font = gdi.Font(window.GetProperty("font.name"), window.GetProperty("font.size"), 0);
this.color = RGB(255,255,255);
break;

case ButtonStates.hover:
case ButtonStates.down:
this.font = gdi.Font(window.GetProperty("font.name"), window.GetProperty("font.size"), 4);
this.color = RGB(0,92,185);
break;

default:
this.img = null;
}
}



this.draw = function (gr) {

gr.DrawRect(this.left, this.top, this.h,  this.h, 1.0, RGB(170,170,170));

this.img && gr.DrawImage(this.img, this.left + 2, this.top + 2, this.h -3, this.h -3, 0, 0, Math.min(this.img.Width,  this.img.Height), Math.min(this.img.Width,  this.img.Height));
gr.GdiDrawText(this.tiptext, this.font, this.color,  this.left + this.h + 3, this.top + 3, this.w - this.h - 3 , this.h -3, DT_VCENTER | DT_NOPREFIX | DT_WORDBREAK|DT_END_ELLIPSIS);
}

this.onClick = function () {
this.func && this.func(x,y);
}

  this.onRightClick = function (x,y)
{
var _menu = window.CreatePopupMenu();
var idx;
var buttontocreate = window.GetProperty("buttons.list").split(";");
var numbersearchengines = 0;
  if (buttontocreate != null)
  {
for (var i in buttontocreate)
{
var text = getWebServiceName(buttontocreate[i], this.tiptext);
if (text != "")
{
_menu.AppendMenuItem(MF_STRING, numbersearchengines +1, text);
numbersearchengines += 1;
}
}
numbersearchengines += 1;
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
}
_menu.AppendMenuItem(MF_STRING,  numbersearchengines + 1, "Update LastFM data");
_menu.AppendMenuItem(MF_SEPARATOR,  numbersearchengines + 2, 0);
_menu.AppendMenuItem(MF_STRING, numbersearchengines + 3,  getWebServiceName("lastfmsimilarradio", this.tiptext));
_menu.AppendMenuItem(MF_SEPARATOR, numbersearchengines + 4, 0);
_menu.AppendMenuItem(MF_STRING,  numbersearchengines +5, "Properties");
//_menu.AppendMenuItem(MF_STRING, 7, "Configure...");
idx = _menu.TrackPopupMenu(x, y);
if (idx <= numbersearchengines)
{
launchWebService(buttontocreate[idx - 1], this.tiptext);
}
else if (idx == numbersearchengines + 1)
{
window.NotifyOthers("ask_lastfm_data", "");
}
else if (idx ==  numbersearchengines + 3)
{
launchWebService("lastfmsimilarradio", this.tiptext);
}
else
{
window.ShowProperties();
}
_menu.Dispose();
}

this.onMouseIn = function() {
g_tooltip.Text = this.tiptext;
g_tooltip.Activate();
}

this.onMouseOut = function() {
g_tooltip.Deactivate();
}
}

function buttonsDraw(gr) {
for (i in Buttons) {
Buttons[i].draw(gr);
}
}

function buttonsTraceMouse(x, y) {
var btn = null;
for (i in Buttons) {
if (Buttons[i].traceMouse(x, y) && !btn)
btn = Buttons[i];
}

return btn;
}

function on_timer(id) {
if (timer && id==timer.ID) {
updateButtons();
timer && window.KillTimer(timer);
timer = null;
CollectGarbage(); // Release memory.
}
}

function on_mouse_move(x, y) {
var btn = buttonsTraceMouse(x, y);

if (btn != cur_btn) {
cur_btn && cur_btn.onMouseOut();
btn && btn.onMouseIn();
}

cur_btn = btn;
}

function on_mouse_lbtn_down(x, y) {
if (g_metadb) {
g_drag = 1;
nrating = Math.ceil((x - left_margin) / bw);
if (nrating > 5) nrating = 5;
if (nrating != lrating) {
lrating = nrating;
window.Repaint();
}
}


g_down = true;
btn_down = cur_btn;
if (cur_btn) {
cur_btn.changeState(ButtonStates.down);
}
}

function on_mouse_lbtn_up(x, y, mask) {
if (mask & MK_SHIFT)
{
window.ShowConfigure();
}
else
{
if (cur_btn) {
cur_btn.changeState(ButtonStates.hover);
if( btn_down == cur_btn )
cur_btn.onClick(x, y);
}
g_down = false;
}
}

function on_mouse_lbtn_up(x,y){
if (lrating !=rating && g_metadb) bool = fb.RunContextCommandWithMetadb("Rating/"+((lrating==0) ? "<not set>" : lrating),g_metadb);
}

function on_mouse_leave() {
on_metadb_changed()
if (cur_btn) {
cur_btn.changeState(ButtonStates.normal);
}
}

function on_mouse_rbtn_up(x, y) {
buttons_menu(x,y);
return true;
}

function on_size() {
ww = window.Width;
wh = window.Height;
updateButtons();
}

function on_metadb_changed() {
g_drag = 0;
rating = g_tfo.EvalWithMetadb(g_metadb);
if (rating == "?") rating = 0;
lrating = rating;
window.Repaint();
}

function on_paint(gr) {
// Background
gr.FillSolidRect(0, 0, ww, wh, RGB(0,0,0));

buttons_background(gr);
if (g_metadb) {
for (i = 1; i < 6; i++) {
img = gdi.image(images_path + ((i > (g_drag ? lrating : rating)) ? "off.png" : "on.png"));
gr.DrawImage(img, left_margin + bw * (i-1), top_margin, bw, bh, 0, 0, img.Width, img.Height);
}
}
buttonsDraw(gr);

gr.GdiDrawText("Artist: " + artist, g_font, color, 5, 5, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
gr.GdiDrawText("Title: " + title, g_font, color, 5, 25, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
if (playing === 1){
gr.GdiDrawText("Album: " + album +" "  + "("+ date + ")", g_font, color, 5, 45, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
gr.GdiDrawText("Album:", g_font, color, 5, 45, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
gr.GdiDrawText("Genre: " + genre, g_font, color2, 5, 65, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
gr.GdiDrawText("Rating: ", g_font, color2, 5, 85, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
if (playing === 1){
  if (playcount === 0){
gr.GdiDrawText("Played: never", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
  if (playcount === 1){
gr.GdiDrawText("Played: " + playcount + " time", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
gr.GdiDrawText("Played: " + playcount + " times", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}}}
  else{
gr.GdiDrawText("Played:", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  if (playing === 1){
gr.GdiDrawText("Codec: " + codec +"-"+ codecprofile + " -- " + bitrate+" "+"Kbit/s", g_font, color2, 5, 125, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
gr.GdiDrawText("Codec:", g_font, color2, 5, 125, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  if (playing === 1) {
  if (Math.floor(ar_years) === 0) {
gr.GdiDrawText("Added: " + ar_days, g_font, color2, 5, 145, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
gr.GdiDrawText("Added: " + ar_days + " (" + Math.floor(ar_years) + " years)", g_font, color2, 5, 145, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
}
  else{
gr.GdiDrawText("Added:", g_font, color2, 5, 145, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  if (playing === 1){
  if (playcount === 0) {
gr.GdiDrawText("First Played: never", g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
gr.GdiDrawText("Last Played: never", g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
if (Math.floor(ar_years2) === 0) {
gr.GdiDrawText("First Played: " + ar_days2, g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
gr.GdiDrawText("First Played: " + ar_days2 + " (" + Math.floor(ar_years2) + " years) ", g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
if (Math.floor(ar_years3) === 0) {
gr.GdiDrawText("Last Played: "+ ar_days3, g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
gr.GdiDrawText("Last Played: "+ ar_days3 + " (" + Math.floor(ar_years3) + " years) ", g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
}}
  else{
gr.GdiDrawText("First Played:", g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
gr.GdiDrawText("Last Played:", g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
// gr.GdiDrawText("Artist Playcount: " + last1, g_font, color2, 5, 205, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
gr.GdiDrawText("Artist Listeners: " + last2, g_font, color2, 5, 235, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
gr.GdiDrawText("Album Playcount: " + last3, g_font, color2, 5, 255, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
  if (playing === 1){
gr.GdiDrawText("Artist Played: " + window.GetProperty("bio_played")+ " times", g_font, color2, 5, 205, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
  else{
gr.GdiDrawText("Artist Played:", g_font, color2, 5, 205, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
gr.GdiDrawText("Similiar Artists:", g_font, color2, 5, 285, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}



function on_notify_data(name, info)
{
switch (name)
{
case "lastfm_similarArtists":
window.SetProperty("currentArtists", info);
updateButtons();
break;
  case "config_updated":
  reloadConf(info);
break;
case "lastfm_bio":
var res = info.split("%separator%");

window.SetProperty("bio_played", res[2]);
if ( window.GetProperty("bio_played") == "")
{
window.SetProperty("bio_played","0");
}
window.Repaint();
default:
break;



}


}

function updateButtons() {
delete Buttons;
Buttons = null;
CollectGarbage(); // Release memory.

if(window.GetProperty("currentArtists") != "")
{
var x = 10;
var y = 310;
varartistsArray = window.GetProperty("currentArtists").split(";");
Buttons = new Array (varartistsArray.length);
var currentartist = "";
for (var i in varartistsArray)
{
switch (i % 2)
{
case 0:
currentartist = varartistsArray[i];
break;
case 1:
//skinpath
var currentartisturl =  varartistsArray[i];
if (currentartist != "")
{
var img =  gdi.Image(lastfmdatapath + ansi(currentartist) + "_small.jpg");

if(img == null)
{
img = gdi.Image(lastfmdatapath + ansi(currentartist) + "_small.png");
if(img == null)
{
img=  gdi.Image(lastfmdatapath + ansi(currentartist) + "_small.gif");
if(img == null)
{
img=  gdi.Image(skinpath + "Last.fm.small.png");
}
}
}
Buttons[i] = new ArtistButton(x, y, parseInt(window.GetProperty("buttons.width")), parseInt(window.GetProperty("buttons.height")), img, function(){WshShell.run(this.lastfmcommand);}, currentartist, currentartisturl);
if  (x + 2*window.GetProperty("buttons.width") + 5 > ww)
{
y = y + parseInt(window.GetProperty("buttons.height")) + 5;
x = 10;
}
else
{
x = x + parseInt(window.GetProperty("buttons.width")) + 5;
}
}
break;
}
}
}
window.Repaint();
}




function on_playback_new_track() {
on_playback_new_track2++;

artist = fb.Titleformat("%artist%").Eval();
album = fb.TitleFormat("%album%").Eval();
title = fb.TitleFormat("%title%").Eval();
genre = fb.Titleformat("%genre%").Eval();
codec = fb.Titleformat("%codec%").Eval();
bitrate = fb.Titleformat("%bitrate%").EvalWithMetadb(g_metadb); 
codecprofile = fb.Titleformat("%codec_profile%").Eval();
rating = fb.TitleFormat("$if(%rating%,$repeat($char(9733),%rating%),)").Eval();
last1 = fb.Titleformat("%lastfm_artist_playcount%").EvalWithMetadb(g_metadb);
last2 = fb.Titleformat("%lastfm_artist_listeners%").EvalWithMetadb(g_metadb); 
last3 = fb.Titleformat("%lastfm_album_playcount%").EvalWithMetadb(g_metadb); 
last4 = fb.Titleformat("%lastfm_album_listeners%").EvalWithMetadb(g_metadb); 
playing = 1;
playcount = fb.TitleFormat("%play_count%");
playcount = playcount.Eval();
playcount = parseInt(playcount);
playcount2 += playcount;
playcount4 += playcount;
playcount3 += (playcount * playcount);
if (on_playback_new_track2 === 1) {
minplaycount = playcount;
maxplaycount = playcount;
}

window.GetProperty("bio_played")

last1 = addCommas(last1)
last2 = addCommas(last2)
last3 = addCommas(last3)
last4 = addCommas(last4)

date = fb.TitleFormat("%date%");
date = date.Eval();
date = parseInt(date);
dt = new Date();
year = dt.getFullYear();
difyear = year - date;
date2 = date2 + date;
if (on_playback_new_track2 >= 2) {
avgdate = date2 / on_playback_new_track2;
avgdate = Math.round(avgdate);
difdate = year - avgdate;
}

today = new Date();
var fpy = fb.TitleFormat("$year(%added%)").Eval();
var fpm = fb.TitleFormat("$sub($month(%added%),1)").Eval();
var fpd = fb.TitleFormat("$day_of_month(%added%)").Eval();
var fday = new Date(fpy, fpm, fpd);
var one_day = 1000 * 60 * 60 * 24;
if (fday > 0) {
ar_days = Math.floor((today.getTime() - fday.getTime()) / one_day);
ar_years = ar_days / 365;
}
fpy = fb.TitleFormat("$year(%first_played%)").Eval();
fpm = fb.TitleFormat("$sub($month(%first_played%),1)").Eval();
fpd = fb.TitleFormat("$day_of_month(%first_played%)").Eval();
fday = new Date(fpy, fpm, fpd);
one_day = 1000 * 60 * 60 * 24;
if (fday > 0) {
ar_days2 = Math.floor((today.getTime() - fday.getTime()) / one_day);
ar_years2 = ar_days2 / 365;
} else {
ar_days2 = 0;
}

fpy = fb.TitleFormat("$year(%last_played%)").Eval();
fpm = fb.TitleFormat("$sub($month(%last_played%),1)").Eval();
fpd = fb.TitleFormat("$day_of_month(%last_played%)").Eval();
fday = new Date(fpy, fpm, fpd);
one_day = 1000 * 60 * 60 * 24;
if (fday > 0) {
ar_days3 = Math.floor((today.getTime() - fday.getTime()) / one_day);
ar_years3 = ar_days3 / 365;
} else {
ar_days3 = 0;
}

fpy = fb.TitleFormat("$year(%last_modified%)").Eval();
fpm = fb.TitleFormat("$sub($month(%last_modified%),1)").Eval();
fpd = fb.TitleFormat("$day_of_month(%last_modified%)").Eval();
fday = new Date(fpy, fpm, fpd);
one_day = 1000 * 60 * 60 * 24;
if (fday > 0) {
ar_days4 = Math.floor((today.getTime() - fday.getTime()) / one_day);
ar_years4 = ar_days4 / 365;
} else {
ar_days4 = 0;
}

if (ar_days === 0) {
ar_days = "today"
}
if (ar_days === 1) {
ar_days = "yesterday"
}
if (ar_days >>> 1) {
ar_days = ar_days + " days ago"
}

if (ar_days2 === 0) {
ar_days2 = "today"
}
if (ar_days2 === 1) {
ar_days2 = "yesterday"
}
if (ar_days2 >>> 1) {
ar_days2 = ar_days2 + " days ago"
}


if (ar_days3 === 0) {
ar_days3 = "today"
}
if (ar_days3 === 1) {
ar_days3 = "yesterday"
}
if (ar_days3 >>> 1) {
ar_days3 = ar_days3 + " days ago"
}

window.Repaint();
}




function on_playback_stop() {
artist = ""
album = ""
title = "" 
genre = ""
ar_days = 0;
ar_days2 = 0;
ar_days3 = 0;
ar_days4 = 0;
ar_years = 0;
ar_years2 = 0;
ar_years3 = 0;
ar_years4 = 0;
date = 0;
difyear = 0;
playcount = "";
last1 = "";
last2 = "";
last3 = "";
last4 = "";
rating = "";
bitrate = 0;
playing = 0;
window.Repaint();
}


function on_item_played() {
playcount++;
playcount4++;

if (on_playback_new_track2 === 1) {
minplaycount = playcount;
maxplaycount = playcount;
}
var test = window.GetProperty("bio_played")
var test = parseInt(test)
var test2 = test + 1
window.SetProperty("bio_played",test2);

ar_years3 = 0;

if (ar_days2 === 0) {
ar_days2 = "today"
}
if (ar_days2 === 1) {
ar_days2 = "yesterday"
}
if (ar_days2 >>> 1) {
ar_days2 = ar_days2 + " days ago"
}
ar_days3 = 0;
if (ar_days3 === 0) {
ar_days3 = "today"
}


window.Repaint();
}


function on_playlist_switch() {
window.Repaint();
}

function on_colors_changed() {
color = dui ==1 ? window.GetColorDUI(2) : RGB(200,0,0);
color2 = dui ==1 ? window.GetColorDUI(0) : window.GetColorCUI(0);
window.Repaint();
}

function on_font_changed() {
g_font = dui == 1 ? window.GetFontDUI(0) : window.GetFontCUI(0);
window.Repaint();
}





Any help would definitely be appreciated, thanks so much!!!

WSH Panel Mod script discussion/help

Reply #442
Version without the rating problem ( just strictly text )
I also cleaned it up a bit
Clicking through playlists seems much smoother without the rating stars problem

Code: [Select]
// ==PREPROCESSOR==
// @import "%fb2k_path%scripts\utils.js"
// @import "%fb2k_path%scripts\marc2003\v2\common.js"
// ==/PREPROCESSOR==


var bw = 13;
var bh = 13;
var left_margin = 48;
var top_margin = 89;
var Buttons;
var g_metadb;
var section = "SIMILARPANEL";
var rating;
var nrating;
var lrating;
var img;
var g_drag = 0;
var g_tfo = fb.TitleFormat("%rating%");
var artist = ""
var album = ""
var title = ""
var codec = ""
var bitrate = ""
var played = ""
var codecprofile = ""
var played = ""
var genre = ""
var lastartist = ""
var lastplay = ""
var rating = ""
var last1 = ""
var last2 = ""
var last3 = ""
var last4 = ""
var playing = "0"
var playcount = "0";
var year = 0;
var date = 0;
var difyear = 0;
var date2 = 0;
var avgdate = 0;
var difdate = 0;
var today = 0;
var ar_days = 0;
var ar_years = 0;
var ar_days2 = 0;
var ar_years2 = 0;
var ar_days3 = 0;
var ar_years3 = 0;
var ar_days4 = 0;
var ar_years4 = 0;
var bitrate = 0;
var days = 0;
var hours = 0;
var minutes = 0;
var seconds = 0;
var on_playback_new_track2 = 0;
var playcount = "0";
var playcount2 = 0;
var playcount3 = 0;
var playcount4 = 0;
var avgplaycount = 0;
var minplaycount = 0;
var maxplaycount = 0;
var ranplaycount = 0;
var devplaycount = 0;
var test = 0;
var test2 = 0;
var dui = window.InstanceType;

var g_font = dui == 1 ? window.GetFontDUI(0) : window.GetFontCUI(0);
//var color = RGB(200,0,0);
var color = dui == 1 ? window.GetColorDUI(2) : RGB(200,0,0);
//var color2 = RGB(0,0,0);
var color2 = dui == 1 ? window.GetColorDUI(0) : window.GetColorCUI(0);
var color3 = RGB(255,99,71);

//global Variables for text field
var DT_TOP = 0x00000000;
var DT_LEFT = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_RIGHT = 0x00000002;
var DT_VCENTER = 0x00000004;
var DT_BOTTOM = 0x00000008;
var DT_WORDBREAK = 0x00000010;
var DT_SINGLELINE = 0x00000020;
var DT_EXPANDTABS = 0x00000040;
var DT_TABSTOP = 0x00000080;
var DT_NOCLIP = 0x00000100;
var DT_EXTERNALLEADING = 0x00000200;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var DT_INTERNAL = 0x00001000;
var DT_EDITCONTROL = 0x00002000;
var DT_PATH_ELLIPSIS = 0x00004000;
var DT_END_ELLIPSIS = 0x00008000;
var DT_MODIFYSTRING = 0x00010000;
var DT_RTLREADING = 0x00020000;
var DT_WORD_ELLIPSIS = 0x00040000;
var DT_NOFULLWIDTHCHARBREAK = 0x00080000;
var DT_HIDEPREFIX = 0x00100000;
var DT_PREFIXONLY = 0x00200000;
var defaultartistimage = "";
var lastfmdatapath = "";
var g_tooltip = window.CreateTooltip();
var g_down = false;
var timer = null;
var btn_down = null;
var cur_btn = null;
var ww = window.Width;
var wh = window.Height;
window.GetProperty("currentArtists", "");
window.GetProperty("bio_played", "");


function reloadConf(inipath)
{
    skinpath = translatePath(utils.ReadINI(inipath, "SKIN", "imgpath", ""),true);
    window.GetProperty("buttons.show", utils.ReadINI(inipath, section, "showbuttons", "0"));
    window.GetProperty("buttons.list", utils.ReadINI(inipath, section, "buttons", ""));
    window.GetProperty("font.name", utils.ReadINI(inipath, section, "fontname", "Segoe UI"));
    window.GetProperty("font.size", utils.ReadINI(inipath, section, "fontsize", "10"));
    window.GetProperty("buttons.width", utils.ReadINI(inipath, section, "buttonswidth", "110"));
    window.GetProperty("buttons.height", utils.ReadINI(inipath, section, "buttonsheight", "38"));
    lastfmdatapath = translatePath(utils.ReadINI(inipath, "LASTFM", "datapath"),true);
    updateButtons() ;

}

reloadConf(inipath);


function on_script_unload()
{
        utils.WriteINI(inipath, section, "showbuttons", window.GetProperty("buttons.show"));
        utils.WriteINI(inipath, section, "buttons", window.GetProperty("buttons.list"));
        utils.WriteINI(inipath, section, "fontname", window.GetProperty("font.name"));
        utils.WriteINI(inipath, section, "fontsize", window.GetProperty("font.size"));
        utils.WriteINI(inipath, section, "buttonswidth", window.GetProperty("buttons.width"));
        utils.WriteINI(inipath, section, "buttonsheight", window.GetProperty("buttons.height"));
}

function ArtistButton(x, y, w, h, img, func, tiptext, url)  {
this.left = x;
this.top = y;
this.w = w;
this.h = h;
this.right = x + w;
this.bottom = y + h;
this.func = func;
this.tiptext = tiptext;
this.url = url;
    this.font = gdi.Font(window.GetProperty("font.name"), window.GetProperty("font.size"), 0);
    this.color = RGB(255,255,255);
this.state = ButtonStates.normal;
this.img= img;
   
    this.lastfmcommand = url;

this.alterImage = function(img_src) {
    this.img= img_src ? gdi.Image(img_src) : null;

this.changeState(this.state);
}

this.traceMouse = function (x, y) {
var b = (this.left < x) && (x < this.right) && (this.top < y) && (y < this.bottom);
if (b)
g_down ? this.changeState(ButtonStates.down) : this.changeState(ButtonStates.hover);
else
this.changeState(ButtonStates.normal);
return b;
}


this.changeState = function (newstate) {
if (newstate != this.state)
window.RepaintRect(this.left, this.top, this.w, this.h);
this.state = newstate;
        switch (this.state)
{
case ButtonStates.normal:
this.font = gdi.Font(window.GetProperty("font.name"), window.GetProperty("font.size"), 0);
            this.color = RGB(255,255,255);
break;

case ButtonStates.hover:
case ButtonStates.down:
this.font = gdi.Font(window.GetProperty("font.name"), window.GetProperty("font.size"), 4);
            this.color = RGB(0,92,185);
break;

default:
this.img = null;
}
}

   
   
this.draw = function (gr) {
       
gr.DrawRect(this.left, this.top, this.h,  this.h, 1.0, RGB(170,170,170));
       
this.img && gr.DrawImage(this.img, this.left + 2, this.top + 2, this.h -3, this.h -3, 0, 0, Math.min(this.img.Width,  this.img.Height), Math.min(this.img.Width,  this.img.Height));
gr.GdiDrawText(this.tiptext, this.font, this.color,  this.left + this.h + 3, this.top + 3, this.w - this.h - 3 , this.h -3, DT_VCENTER | DT_NOPREFIX | DT_WORDBREAK|DT_END_ELLIPSIS);
}

this.onClick = function () {
this.func && this.func(x,y);
}
   
this.onRightClick = function (x,y)
    {
        var _menu = window.CreatePopupMenu();
        var idx;
        var buttontocreate = window.GetProperty("buttons.list").split(";");
        var numbersearchengines = 0;
      if (buttontocreate != null)
      {
            for (var i in buttontocreate)
            {
                var text = getWebServiceName(buttontocreate[i], this.tiptext);
                if (text != "")
                {
                    _menu.AppendMenuItem(MF_STRING, numbersearchengines +1, text);
                        numbersearchengines += 1 ;
                }
            }
            numbersearchengines += 1 ;
            _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
        }
        _menu.AppendMenuItem(MF_STRING,  numbersearchengines + 1, "Update LastFM data");
        _menu.AppendMenuItem(MF_SEPARATOR,  numbersearchengines + 2, 0);
        _menu.AppendMenuItem(MF_STRING, numbersearchengines + 3,  getWebServiceName("lastfmsimilarradio", this.tiptext));
        _menu.AppendMenuItem(MF_SEPARATOR, numbersearchengines + 4, 0);
        _menu.AppendMenuItem(MF_STRING,  numbersearchengines +5, "Properties");
        //_menu.AppendMenuItem(MF_STRING, 7, "Configure...");
        idx = _menu.TrackPopupMenu(x, y);
        if (idx <= numbersearchengines)
        {
            launchWebService(buttontocreate[idx - 1], this.tiptext);
        }
        else if (idx == numbersearchengines + 1)
        {
            window.NotifyOthers("ask_lastfm_data", "");           
        }
        else if (idx ==  numbersearchengines + 3)
        {
            launchWebService("lastfmsimilarradio", this.tiptext);
        }
        else
        {
            window.ShowProperties();
        }
        _menu.Dispose();
    }

this.onMouseIn = function() {
g_tooltip.Text = this.tiptext;
g_tooltip.Activate();
}

this.onMouseOut = function() {
g_tooltip.Deactivate();
}
}


function buttonsDraw(gr) {
for (i in Buttons) {
Buttons[i].draw(gr);
}
}

function buttonsTraceMouse(x, y) {
var btn = null;
for (i in Buttons) {
if (Buttons[i].traceMouse(x, y) && !btn)
btn = Buttons[i];
}

return btn;
}

function on_timer(id) {
if (timer && id==timer.ID) {
updateButtons() ;
timer && window.KillTimer(timer);
timer = null;
CollectGarbage(); // Release memory.
}
}

function on_mouse_move(x, y) {
var btn = buttonsTraceMouse(x, y);
if (btn != cur_btn) {
cur_btn && cur_btn.onMouseOut();
btn && btn.onMouseIn();
}

cur_btn = btn;
   
}

function on_mouse_lbtn_down(x, y) {
   
    g_down = true;
btn_down = cur_btn;
if (cur_btn) {
cur_btn.changeState(ButtonStates.down);
}
}

function on_mouse_lbtn_up(x, y, mask) {
    if (mask & MK_SHIFT)
    {
        window.ShowConfigure();
    }
    else
    {
        if (cur_btn) {
            cur_btn.changeState(ButtonStates.hover);
            if( btn_down == cur_btn )
                cur_btn.onClick(x, y);
        }
        g_down = false;
    }
}

 //function on_mouse_lbtn_up(x,y){
// if (lrating !=rating && g_metadb) bool = fb.RunContextCommandWithMetadb("Rating/"+((lrating==0) ? "<not set>" : lrating),g_metadb);
//  }

// function on_mouse_move(x, y) {
// if (g_metadb) {
// g_drag = 1;
// nrating = Math.ceil((x - left_margin) / bw);
// if (nrating > 5) nrating = 5;
// if (nrating != lrating) {
// lrating = nrating;
// window.Repaint();
// }
// }
// }

function on_mouse_leave() {
 //  on_metadb_changed()
if (cur_btn) {
cur_btn.changeState(ButtonStates.normal);
}
}

function on_mouse_rbtn_down(x, y)
{
    on_mouse_move(x, y);   
    if (cur_btn)
    {
        cur_btn.changeState(ButtonStates.hover);
        cur_btn.onRightClick(x, y);
    }
    else
    {
        var _menu = window.CreatePopupMenu();
        var idx;
        _menu.AppendMenuItem(MF_STRING, 1, "Refresh");
        _menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
        _menu.AppendMenuItem(MF_STRING, 2, "Properties");
        _menu.AppendMenuItem(MF_STRING, 3, "Configure...");
        idx = _menu.TrackPopupMenu(x, y);
        switch(idx) {
        case 1:
        updateButtons() ;
        break;
        case 2:
        window.ShowProperties();
        break;
        case 3:
        window.ShowConfigure();
        break;
        }
        _menu.Dispose();
    }

    return true;
   
}

function on_size() {
ww = window.Width;
wh = window.Height;
    updateButtons();
}

 //function on_metadb_changed() {
// g_drag = 0;
// rating = g_tfo.EvalWithMetadb(g_metadb);
// if (rating == "?") rating = 0;
// lrating = rating;
// window.Repaint();
//}

function on_paint(gr) {
    // Background
gr.FillSolidRect(0, 0, ww, wh, RGB(0,0,0));
   
//buttons_background(gr);
//if (g_metadb) {
// for (i = 1; i < 6; i++) {
// img = gdi.image(images_path + ((i > (g_drag ? lrating : rating)) ? "off.png" : "on.png"));
// gr.DrawImage(img, left_margin + bw * (i-1), top_margin, bw, bh, 0, 0, img.Width, img.Height);
// }
// }
    buttonsDraw(gr);

gr.GdiDrawText("Artist: " + artist, g_font, color, 5, 5, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        gr.GdiDrawText("Title: " + title, g_font, color, 5, 25, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        if (playing === 1){
        gr.GdiDrawText("Album: " + album +" "  + "("+ date + ")", g_font, color, 5, 45, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
        gr.GdiDrawText("Album:", g_font, color, 5, 45, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
        gr.GdiDrawText("Genre: " + genre, g_font, color2, 5, 65, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        gr.GdiDrawText("Rating: "+ rating , g_font, color2, 5, 85, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        if (playing === 1){
          if (playcount === 0){
        gr.GdiDrawText("Played: never", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
          if (playcount === 1){
        gr.GdiDrawText("Played: " + playcount + " time", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
        gr.GdiDrawText("Played: " + playcount + " times", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }}}
          else{
        gr.GdiDrawText("Played:", g_font, color2, 5, 105, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          if (playing === 1){
        gr.GdiDrawText("Codec: " + codec +"-"+ codecprofile + " -- " + bitrate+" "+"Kbit/s", g_font, color2, 5, 125, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
          else{
        gr.GdiDrawText("Codec:", g_font, color2, 5, 125, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          if (playing === 1) {
          if (Math.floor(ar_years) === 0) {
        gr.GdiDrawText("Added: " + ar_days, g_font, color2, 5, 145, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
        gr.GdiDrawText("Added: " + ar_days + " (" + Math.floor(ar_years) + " years)", g_font, color2, 5, 145, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
        }
          else{
        gr.GdiDrawText("Added:", g_font, color2, 5, 145, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          if (playing === 1){
          if (playcount === 0) {
        gr.GdiDrawText("First Played: never", g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        gr.GdiDrawText("Last Played: never", g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
            if (Math.floor(ar_years2) === 0) {
        gr.GdiDrawText("First Played: " + ar_days2, g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
        gr.GdiDrawText("First Played: " + ar_days2 + " (" + Math.floor(ar_years2) + " years) ", g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
            if (Math.floor(ar_years3) === 0) {
        gr.GdiDrawText("Last Played: "+ ar_days3, g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
        gr.GdiDrawText("Last Played: "+ ar_days3 + " (" + Math.floor(ar_years3) + " years) ", g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
        }}
          else{
        gr.GdiDrawText("First Played:", g_font, color2, 5, 165, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        gr.GdiDrawText("Last Played:", g_font, color2, 5, 185, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
    // gr.GdiDrawText("Artist Playcount: " + last1, g_font, color2, 5, 205, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        gr.GdiDrawText("Artist Listeners: " + last2, g_font, color2, 5, 235, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        gr.GdiDrawText("Album Playcount: " + last3, g_font, color2, 5, 255, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
          if (playing === 1){
        gr.GdiDrawText("Artist Played: " + window.GetProperty("bio_played")+ " times", g_font, color2, 5, 205, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
          else{
        gr.GdiDrawText("Artist Played:", g_font, color2, 5, 205, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }
        gr.GdiDrawText("Similiar Artists:", g_font, color2, 5, 285, window.Width - 10, window.Height, DT_TOP | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
        }



function on_notify_data(name, info)
{
switch (name)
{
case "lastfm_similarArtists":
        window.SetProperty("currentArtists", info);
        updateButtons();
break;
      case "config_updated":
      reloadConf(info);
    break;
        case "lastfm_bio":
            var res = info.split("%separator%");
           
            window.SetProperty("bio_played", res[2]);
            if ( window.GetProperty("bio_played") == "")
            {
                window.SetProperty("bio_played","0");
            }
            window.Repaint();
default:
break;
       
       
       
}
   

}

function updateButtons() {
    delete Buttons;
    Buttons = null;
    CollectGarbage(); // Release memory.
   
    if(window.GetProperty("currentArtists") != "")
    {
var x = 10;
    var y = 310;
        varartistsArray = window.GetProperty("currentArtists").split(";");
        Buttons = new Array (varartistsArray.length);
        var currentartist = "";
        for (var i in varartistsArray)
        {
            switch (i % 2)
            {
                case 0:
                currentartist = varartistsArray[i];
            break;
                case 1:
            //skinpath
            var currentartisturl =  varartistsArray[i];
        if (currentartist != "")
        {
                var img =  gdi.Image(lastfmdatapath + ansi(currentartist) + "_small.jpg");
               
                if(img == null)
                {
                    img = gdi.Image(lastfmdatapath + ansi(currentartist) + "_small.png");
                    if(img == null)
                    {
                        img=  gdi.Image(lastfmdatapath + ansi(currentartist) + "_small.gif");
                        if(img == null)
                        {
                            img=  gdi.Image(skinpath + "Last.fm.small.png");
                        }
                    }
                }
                Buttons[i] = new ArtistButton(x, y, parseInt(window.GetProperty("buttons.width")), parseInt(window.GetProperty("buttons.height")), img, function(){WshShell.run(this.lastfmcommand);}, currentartist, currentartisturl) ;
                if  (x + 2*window.GetProperty("buttons.width") + 5 > ww)
                {
                    y = y + parseInt(window.GetProperty("buttons.height")) + 5;
                    x = 10 ;
                }
                else
                {
                    x = x + parseInt(window.GetProperty("buttons.width")) + 5;
                }
        }
            break;
        }
        }
    }
    window.Repaint();
}




function on_playback_new_track() {
    on_playback_new_track2++;

    artist = fb.Titleformat("%artist%").Eval();
    album = fb.TitleFormat("%album%").Eval();
    title = fb.TitleFormat("%title%").Eval();
    genre = fb.Titleformat("%genre%").Eval();
    codec = fb.Titleformat("%codec%").Eval();
    bitrate = fb.Titleformat("%bitrate%").EvalWithMetadb(g_metadb); 
    codecprofile = fb.Titleformat("%codec_profile%").Eval();
    rating = fb.TitleFormat("$if(%rating%,$repeat($char(9733),%rating%),)").Eval();
    last1 = fb.Titleformat("%lastfm_artist_playcount%").EvalWithMetadb(g_metadb);
    last2 = fb.Titleformat("%lastfm_artist_listeners%").EvalWithMetadb(g_metadb); 
    last3 = fb.Titleformat("%lastfm_album_playcount%").EvalWithMetadb(g_metadb); 
    last4 = fb.Titleformat("%lastfm_album_listeners%").EvalWithMetadb(g_metadb); 
    playing = 1;
    playcount = fb.TitleFormat("%play_count%");
    playcount = playcount.Eval();
    playcount = parseInt(playcount);
    playcount2 += playcount;
playcount4 += playcount;
    playcount3 += (playcount * playcount);
if (on_playback_new_track2 === 1) {
minplaycount = playcount;
maxplaycount = playcount;
}

    window.GetProperty("bio_played")

    last1 = addCommas(last1)
    last2 = addCommas(last2)
    last3 = addCommas(last3)
    last4 = addCommas(last4)

    date = fb.TitleFormat("%date%");
    date = date.Eval();
    date = parseInt(date);
    dt = new Date();
    year = dt.getFullYear();
    difyear = year - date;
    date2 = date2 + date;
    if (on_playback_new_track2 >= 2) {
        avgdate = date2 / on_playback_new_track2;
        avgdate = Math.round(avgdate);
        difdate = year - avgdate;
    }

    today = new Date();
    var fpy = fb.TitleFormat("$year(%added%)").Eval();
    var fpm = fb.TitleFormat("$sub($month(%added%),1)").Eval();
    var fpd = fb.TitleFormat("$day_of_month(%added%)").Eval();
    var fday = new Date(fpy, fpm, fpd);
    var one_day = 1000 * 60 * 60 * 24;
    if (fday > 0) {
        ar_days = Math.floor((today.getTime() - fday.getTime()) / one_day);
        ar_years = ar_days / 365;
    }
    fpy = fb.TitleFormat("$year(%first_played%)").Eval();
    fpm = fb.TitleFormat("$sub($month(%first_played%),1)").Eval();
    fpd = fb.TitleFormat("$day_of_month(%first_played%)").Eval();
    fday = new Date(fpy, fpm, fpd);
    one_day = 1000 * 60 * 60 * 24;
    if (fday > 0) {
        ar_days2 = Math.floor((today.getTime() - fday.getTime()) / one_day);
        ar_years2 = ar_days2 / 365;
    } else {
        ar_days2 = 0;
    }

    fpy = fb.TitleFormat("$year(%last_played%)").Eval();
    fpm = fb.TitleFormat("$sub($month(%last_played%),1)").Eval();
    fpd = fb.TitleFormat("$day_of_month(%last_played%)").Eval();
    fday = new Date(fpy, fpm, fpd);
    one_day = 1000 * 60 * 60 * 24;
    if (fday > 0) {
        ar_days3 = Math.floor((today.getTime() - fday.getTime()) / one_day);
        ar_years3 = ar_days3 / 365;
    } else {
        ar_days3 = 0;
    }

    fpy = fb.TitleFormat("$year(%last_modified%)").Eval();
    fpm = fb.TitleFormat("$sub($month(%last_modified%),1)").Eval();
    fpd = fb.TitleFormat("$day_of_month(%last_modified%)").Eval();
    fday = new Date(fpy, fpm, fpd);
    one_day = 1000 * 60 * 60 * 24;
    if (fday > 0) {
        ar_days4 = Math.floor((today.getTime() - fday.getTime()) / one_day);
        ar_years4 = ar_days4 / 365;
    } else {
        ar_days4 = 0;
    }

    if (ar_days === 0) {
    ar_days = "today"
    }
    if (ar_days === 1) {
    ar_days = "yesterday"
    }
    if (ar_days >>> 1) {
    ar_days = ar_days + " days ago"
    }

    if (ar_days2 === 0) {
    ar_days2 = "today"
    }
    if (ar_days2 === 1) {
    ar_days2 = "yesterday"
    }
    if (ar_days2 >>> 1) {
    ar_days2 = ar_days2 + " days ago"
    }


    if (ar_days3 === 0) {
    ar_days3 = "today"
    }
    if (ar_days3 === 1) {
    ar_days3 = "yesterday"
    }
    if (ar_days3 >>> 1) {
    ar_days3 = ar_days3 + " days ago"
    }

    window.Repaint();
}




function on_playback_stop() {
    artist = ""
    album = ""
    title = "" 
    genre = ""
    ar_days = 0;
    ar_days2 = 0;
    ar_days3 = 0;
    ar_days4 = 0;
    ar_years = 0;
    ar_years2 = 0;
    ar_years3 = 0;
    ar_years4 = 0;
    date = 0;
    difyear = 0;
    playcount = "";
    last1 = "";
    last2 = "";
    last3 = "";
    last4 = "";
    rating = "";
    bitrate = 0;
    playing = 0;
    window.Repaint();
}


function on_item_played() {
    playcount++;
    playcount4++;

    if (on_playback_new_track2 === 1) {
minplaycount = playcount;
maxplaycount = playcount;
    }
var test = window.GetProperty("bio_played")
        var test = parseInt(test)
        var test2 = test + 1
        window.SetProperty("bio_played",test2);
       
    ar_years3 = 0;
   
    if (ar_days2 === 0) {
    ar_days2 = "today"
    }
    if (ar_days2 === 1) {
    ar_days2 = "yesterday"
    }
    if (ar_days2 >>> 1) {
    ar_days2 = ar_days2 + " days ago"
    }
    ar_days3 = 0;
    if (ar_days3 === 0) {
    ar_days3 = "today"
    }


    window.Repaint();
}


function on_playlist_switch() {
    window.Repaint();   
}



WSH Panel Mod script discussion/help

Reply #443
scripts updated: http://cid-649d3bfeaf541fbb.office.live.co...ide/samples.zip

contains a new script called "thumbs2.txt"



-support for downloading last.fm artist art like all my other scripts
-multiple custom folder support
-hover mouse over thumbnails and use mouse wheel to scroll through all images
-single click thumbnail to show larger version
-single click large image to open in external viewer
-right click large image and you can delete it using the context menu
-check the context menu for all other options

WSH Panel Mod script discussion/help

Reply #444
marc2003, if I was a woman, i would run to you, jump at your neck and give you a kiss that would made your wife jealous! 

thx a lot for this update! thumbnails below the cover, that what i was expecting from your script.

Now I can play a bit with it to:
  -center the thumbnails under cover when (cover width) is bigger than (thumbs widtht x number of thumbs)
  -reduce a bit thumbs size and draw a nice border around

edit:typo

WSH Panel Mod script discussion/help

Reply #445
-center the thumbnails under cover when (cover width) is bigger than (thumbs widtht x number of thumbs)


although it's possible, i think it's easier to lock the panel width. otherwise you have to take into account the margins when tracking the mouse pointer for selecting/opening images. i guess it shouldn't be that hard - i'm just lazy.

Quote
-reduce a bit thumbs size and draw a nice border around


hold shift while right clicking and that will show "properties" on the context menu. you can change the "thumb_size" variable there. if you want to draw a better border, you'll need to edit scripts\marc2003\v2\common.js and find the "scale" function.

WSH Panel Mod script discussion/help

Reply #446
hold shift while right clicking and that will show "properties" on the context menu. you can change the "thumb_size" variable there. if you want to draw a better border, you'll need to edit scripts\marc2003\v2\common.js and find the "scale" function.
I was a bit confuse that changing size in "configure..." windows returns no effect. Thx again.



WSH Panel Mod script discussion/help

Reply #449
Marc, about Thumbs script...I would like to make a suggestion, not for design this time.
I've not entered yet to your script to see if it would be difficult or not.

As you know, the bigger image does not keep focus on the selected thumbs.
The focus change, and go back to the first image contained in the folder, when playback changes, or even when selection changes.
I dont know what was your plan when you began to script this panel. And surely maybe? my suggestion will not go in your way.

mainly: Is it possible to keep cover focused on the selected thumb and no reset to first image?


[!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--]What i have in mind, is more a combination between artreader/thumb script 1/thumb script 2.
When you click on a thumb, it show bigger one; if you (double) click on the bigger image, it acts like thumbs1/artreader: thumbnails disappear to extend bigger image, with a kind of diaporama.
Next, clicking on the extended big image, that will switch to the combined display (Thumbs+Big cover). If you middle click on thumbs, it could extend thumbs (big cover disappear, for browsing thumbs)... and if needed, another action to open it in external viewer.
I'm not asking anything, just sharing what, with a maximum effort, i'll try to achieve starting with your scripts.
[/size]