i'm not sure if there is a function to get the system colours but this script draws the windows 7 selected item colour....
function RGB(r,g,b) {
return (0xff000000|(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("Segoe UI", 12, 0);
var g_drag = 0;
var g_drag_seek = 0;
function on_paint(gr){
gr.SetTextRenderingHint(5);
var ww = window.Width;
var wh = window.Height;
var pos = 0;
var time = fb.PlaybackTime;
var length = fb.PlaybackLength;
var txt;
if(length > 0){
if(g_drag){
pos = ww * g_drag_seek;
txt = TimeFmt(length * g_drag_seek) + " / " + TimeFmt(length);
} else {
pos = ww * (time / length);
txt = TimeFmt(time) + " / " + TimeFmt(length);
}
}
gr.FillGradRect( 0, 0, pos, wh, 90, RGB(217,233,251), RGB(188,214,247));
gr.DrawString(txt, g_font, RGB(0,0,0), 0, 0, ww-10, wh,553668608);
gr.DrawRect(0,0, ww-1, wh-1, 1.0, RGB(170,170,170));
}
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_time(time) {
if(fb.PlaybackLength>0) window.Repaint();
}
function on_playback_seek(time){
window.Repaint();
}
infact i have a question of my own... at the moment this script updates once a second but can look a bit rubbish on short tracks. i've seen some samples posted earlier in the thread on how how to get it to draw more often than once a second. but the sample TomBarlow posted looks overly complicated plus tedgo says it causes memory usage problems. i also tried a snippet that durch posted but that stops working randomly?? not sure why that is? has anybody got any simple code for this?