Okay I got it working
I use the 1.1.4 version of the plugin.
If you create a WSH Panel with the following code:
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;
function RGB(r,g,b){
return (0xff000000|(r<<16)|(g<<8)|(b));
}
function RGBA(r,g,b,a){
return ((a<<24)|(r<<16)|(g<<8)|(b));
}
function TimeFmt(t){
var zpad = function(n){
var str = n.toString();
return (str.length<2) ? "0"+str : str;
}
var h = Math.floor(t/3600); t-=h*3600;
var m = Math.floor(t/60); t-=m*60;
var s = Math.floor(t);
if(h>0) return h.toString()+":"+zpad(m)+":"+zpad(s);
return m.toString()+":"+zpad(s);
}
var g_font = gdi.Font("Arial",12,0);
var g_fileinfo = null;
var g_drag = 0;
var g_drag_seek = 0;
// --- APPLICATION START
function on_paint(gr){
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var length = fb.PlaybackLength;
var txt;
if(length > 0){
if(g_drag){
pos = window.Width * g_drag_seek;
txt = "Seek " + TimeFmt(g_drag_seek * length) + " / " + TimeFmt(length);
}
else{
pos = window.Width * (fb.PlaybackTime / length);
var percentage = 100*fb.PlaybackTime/fb.PlaybackLength;
txt = percentage.toString().substr(0,4) + "%";
}
}
gr.FillGradRect( 0, 0, pos, wh/2, 270, RGB(64,192,192), RGB(0,64,64));
gr.FillGradRect( 0,wh/2, pos, wh/2+1, 90, RGB(64,192,192), RGB(0,64,64));
gr.FillGradRect(pos, 0, ww-pos, wh/2, 270, RGB(96,96,96), RGB(16,16,16));
gr.FillGradRect(pos, wh/2, ww-pos, wh/2+1, 90, RGB(96,96,96), RGB(16,16,16));
gr.DrawRect(0,0, ww, wh, 4.0, RGB(0,0,0));
gr.GdiDrawText(txt, g_font, RGB(255,255,255), 0, 0, ww, wh, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
if(g_drag){
g_drag = 0;
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
fb.PlaybackTime = fb.PlaybackLength * g_drag_seek;
}
}
function on_mouse_move(x,y){
if(g_drag){
g_drag_seek = x / window.Width;
g_drag_seek = (g_drag_seek<0) ? 0 : (g_drag_seek<1) ? g_drag_seek : 1;
window.Repaint();
}
}
function on_playback_new_track(info){
window.Repaint();
}
function on_playback_stop(){
window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
function on_playback_time(time){
window.Repaint();
}
// --- APPLICATION END
Everything is as I want it to be.
But if I use the following code in a WSH Panel a black line appears and disappears where in the middle:
gr.FillGradRect(this.left, this.top, pos, this.h/2, 270, RGBA(64,192,192, 255), RGBA(31, 50, 63, 255));
gr.FillGradRect(this.left, this.top+5, pos, this.h/2+1, 90, RGBA(64,192,192, 255), RGBA(31, 50, 63, 255));
gr.DrawRect(this.left, this.top, this.w, this.h, 2.0, RGBA(0, 0, 0, 255));
The seekbars height is 12.