Hi, i am using wsh panel like slidebar of the volume control.
All work, but the steps of the slidebar are linear, in this way when i move the bar i do not feel null until the 3/4 and after the volume it is raised of blow.
I don't know nothing of javascript and i not have the minimal idea how to modify the script which control this behavior.
This is the code:
function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
var g_font = gdi.Font(-12, 400, 1, 0, "MeiryoKe_PGothic");
var g_drag = 0;
function on_paint(gr){
var ww = window.Width;
var wh = window.Height;
var volume = fb.Volume;
var pos = window.Width * ((50+volume)/100);
var txt = (Math.ceil(volume)) + "dB";
gr.FillGradRect( 0, 0, pos, wh, 90, RGB(0,0,0), RGB(255,167,47));
gr.FillGradRect(pos, 0, ww-pos, wh, 90, RGB(0,0,0), RGB(0,0,0));
gr.DrawString(txt, g_font, RGB(0,255,0), 0, 0, ww, wh, 0x11005000);
gr.DrawRect(0,0, ww-1, wh-1, 1.0, RGB(255,167,47));
}
function on_mouse_lbtn_down(x,y){
g_drag = 1;
}
function on_mouse_lbtn_up(x,y){
on_mouse_move(x,y);
g_drag = 0;
}
function on_mouse_move(x,y){
if(g_drag){
var v = x / window.Width;
v = (v<0) ? 0 : (v<1) ? v : 1;
v = -100 * (1-v);
if(fb.Volume != v)
fb.Volume = v;
}
}
function on_mouse_wheel(delta){
if(delta>0)
fb.VolumeUp();
else
fb.VolumeDown();
}
function on_volume_change(val){
window.Repaint();
}
//EOF
someone can help me?