I ran into a weird focus problem after messing around with your track info + seekbar + buttons script, marc. See here.
Was testing to see if I could place things like volume and ratings in there instead of seekbar. Volume went smoothly and works as expected. Ratings not so much. Is there something I missed here? It's messy right now because I haven't finalized what I wanted to accomplish.
// ==PREPROCESSOR==
// @name "panel"
// @author "marc2003"
// @import "%fb2k_profile_path%wsh_marc2003\js\lodash.min.js"
// @import "%fb2k_profile_path%wsh_marc2003\js\helpers.js"
// @import "%fb2k_profile_path%wsh_marc2003\js\panel.js"
// @import "%fb2k_profile_path%wsh_marc2003\js\rating.js"
// @import "%fb2k_profile_path%wsh_marc2003\js\volume.js"
// ==/PREPROCESSOR==
var panel = new _.panel("track info + buttons + seekbar", "Volume", "Rating", ["metadb", "custom_background"]);
var volume = new _.volume(0, 0, 0, 11);
volume.c1 = _.RGB(50, 50, 50);
volume.c2 = _.RGBA(128, 164, 164, 250);
var rating = new _.rating(0, 0, 16, _.RGBA(10, 10, 10, 220), _.RGBA(200, 200, 64, 250));
var buttons = new _.buttons();
var img = null;
panel.item_focus_change();
on_playback_new_track();
buttons.update = function () {
this.buttons.stop = new _.button((panel.w /2) - 90, (panel.h - 30) / 2, 30, 30, {normal : "ui_images\\1h.png"}, function () { fb.Stop(); }, "");
this.buttons.previous = new _.button((panel.w / 2) - 54, (panel.h - 30) / 2, 30, 30, {normal : "ui_images\\2h.png"}, function () { fb.Prev(); }, "");
this.buttons.play = new _.button((panel.w / 2) - 18, (panel.h - 36) / 2, 36, 36, {normal : !fb.IsPlaying || fb.IsPaused ? "ui_images\\3h.png" :
"ui_images\\4h.png"}, function () { fb.PlayOrPause(); }, !fb.IsPlaying || fb.IsPaused ? "" : "");
this.buttons.next = new _.button((panel.w / 2) + 24, (panel.h - 30) / 2, 30, 30, {normal : "ui_images\\5h.png"}, function () { fb.Next(); }, "");
//this.buttons.preferences = new _.button(panel.w - 50, (panel.h - 36) / 2, 36, 36, {normal : "mono\\appbar.settings.png"}, function () { fb.ShowPreferences(); }, "");
}
function on_size() {
panel.size();
buttons.update();
volume.x = (panel.w + 210)/2;
volume.w = 80;
volume.y = (panel.h - 11)/2;
rating.x = (panel.w - 380)/2;
rating.w = 80;
rating.y = (panel.h - 16)/2;
}
function on_paint(gr) {
gr.FillSolidRect(0, 0, panel.w, panel.h, _.RGB(128, 164, 164));
var pos = volume.pos();
gr.FillSolidRect(volume.x, volume.y, volume.w, volume.h, _.RGB(100, 100, 100))
gr.FillSolidRect(volume.x+1, volume.y+1, volume.w-2, volume.h-2, volume.c1);
gr.FillSolidRect(volume.x+1, volume.y+1, volume.pos(), volume.h-2, volume.c2);
rating.paint(gr);
buttons.paint(gr);
if (fb.IsPlaying) {
img && _.drawImage(gr, img, 2, 2, panel.h-4, panel.h-4, image.centre);
gr.GdiDrawText(_.tfe("%title%"), panel.fonts.title, _.RGB(255, 255, 255), panel.h + 10, 0, 270, panel.h * 0.6, LEFT);
gr.GdiDrawText(_.tfe("%artist%"), panel.fonts.normal, _.RGB(255, 255, 255), panel.h + 10, panel.h * 0.3, 270, panel.h * 0.7, LEFT);
gr.SetSmoothingMode(4);
//if (fb.PlaybackLength > 0) {
//var pos = seekbar.pos();
//gr.FillSolidRect(seekbar.x, seekbar.y + 7, seekbar.w + 16, 6, _.RGB(160, 165, 165))
//gr.FillRoundRect(seekbar.x + pos, seekbar.y + 2, 16, 16, 8, 8, _.RGB(255, 255,255));
//gr.FillRoundRect(seekbar.x + pos + 3, seekbar.y + 5, 10, 10, 5, 5, _.RGB(196, 30, 35));
//gr.FillSolidRect(seekbar.x, seekbar.y + 7, pos, 6, _.RGB(255, 255, 255));
//gr.GdiDrawText(_.tfe("%playback_time% "), panel.fonts.normal, _.RGB(255, 255, 255), seekbar.x - 60, 0, 60, panel.h, RIGHT);
//gr.GdiDrawText(_.tfe(" %length%"), panel.fonts.normal, _.RGB(255, 255, 255), seekbar.x + seekbar.w + 16, 0, 60, panel.h, LEFT);
//}
}
}
function on_metadb_changed() {
rating.metadb_changed();
}
function on_playback_new_track() {
var metadb = fb.GetNowPlaying();
if (!metadb)
return;
img && img.Dispose();
img = utils.GetAlbumArtV2(metadb, 0);
window.Repaint();
}
function on_volume_change() {
volume.volume_change();
}
function on_playback_stop() {
buttons.update();
window.Repaint();
}
function on_playback_pause() {
buttons.update();
}
function on_playback_starting() {
buttons.update();
}
function on_mouse_wheel(s) {
volume.wheel(s);
}
function on_mouse_move(x, y) {
rating.move(x, y);
volume.move(x, y);
if (buttons.move(x, y))
return;
}
function on_mouse_leave() {
rating.leave();
buttons.leave();
}
function on_mouse_lbtn_down(x, y) {
volume.lbtn_down(x, y);
}
function on_mouse_lbtn_up(x, y) {
volume.lbtn_up(x, y);
rating.lbtn_up(x, y);
if (buttons.lbtn_up(x, y))
return;
fb.RunMainMenuCommand("View/Show now playing in playlist");
}
function on_mouse_rbtn_up(x, y) {
return panel.rbtn_up(x, y);
}
EDIT: I altered playback buttons (used enter) to keep codebox here in the forums from running wide.