// ==PREPROCESSOR==
// @name "Menu Button vertical"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// @import "%fb2k_component_path%samples\js\panel.js"
// ==/PREPROCESSOR==
// FontAwesome
var chars = {
up : '\uF077',
down : '\uF078',
left : '\uF060',
right : '\uF061',
close : '\uF00D',
rating_on : '\uF005',
rating_off : '\uF006',
heart_on : '\uF004',
heart_off : '\uF08A',
prev : '\uF049',
next : '\uF050',
play : '\uF04B',
pause : '\uF04C',
stop : '\uF04D',
preferences : '\uF013',
search : '\uF002',
console : '\uF120',
info : '\uF05A',
audioscrobbler : '\uF202',
minus : '\uF068',
music : '\uF001',
menu : '\uF0C9',
hourglass : '\uF254',
lock : '\uF023',
list : '\uF0C9',
etx : String.fromCharCode(3),
bel : String.fromCharCode(7),
tab : '\t',
edit : '\uF040',
};
var colours = {
//buttons : RGB(224, 222, 244),
buttons: RGB(144, 140, 170),
buttonsH: RGB(156, 207, 216),
//background : RGB(22, 55, 69)
bacground : RGB(31, 29, 46),
};
var panel = new _panel();
var buttons = new _buttons();
var bt=30;
window.MinWidth=2*bt+2;
window.MaxWidth=2*bt+2;
var xpos=(window.Width-2-bt)/2;
var xpos=(window.Width-2-bt)/2;
buttons.buttons.menu = new _button(xpos, 0, bt, bt, { char : chars.menu, colour : colours.buttons }, { char : chars.menu, colour : colours.buttonsH }, function () { _menu(0, bt); }, 'Menü');
buttons.buttons.DeleteFile = new _button(xpos,bt, bt, bt, { char : chars.close, colour : colours.buttons }, { char : chars.close, colour : colours.buttonsH }, function () {
var handles = plman.GetPlaylistSelectedItems(plman.ActivePlaylist); var cmd = 'File Operations/Delete file';
if (handles.Count > 1) cmd += 's';handles.RunContextCommand(cmd); }, 'Delete File(s)');
buttons.buttons.console = new _button(xpos, 2*bt, bt, bt, { char : chars.console, colour : colours.buttons }, { char : chars.console, colour : colours.buttonsH }, function () { fb.ShowConsole(); }, 'Console');
buttons.buttons.preverences = new _button(xpos, 3*bt, bt, bt, { char : chars.preferences, colour:colours.buttons}, { char : chars.preferences, colour : colours.buttonsH }, function () { fb.ShowPreferences(); }, 'Preferences');
buttons.buttons.search = new _button(xpos, 4*bt, bt, bt, { char : chars.search, colour : colours.buttons }, { char : chars.search, colour : colours.buttonsH }, function () { fb.RunMainMenuCommand('Library/Search'); }, 'Library Search');
buttons.buttons.CUEEdit = new _button(0, 5*bt, 2*bt, bt, { char : chars.edit +"CUE", colour : colours.buttons }, { char : chars.edit +"CUE", colour : colours.buttonsH }, function () {
var handle_list = plman.GetPlaylistSelectedItems(plman.ActivePlaylist); handle_list.RunContextCommand('Utilities/Edit Cuesheet'); }, 'CUE Edit');
function on_mouse_lbtn_up(x, y, mask) {
buttons.lbtn_up(x, y, mask);
}
function on_mouse_leave() {
buttons.leave();
}
function on_mouse_move(x, y) {
buttons.move(x, y);
}
function on_mouse_rbtn_up(x, y) {
if (buttons.buttons.menu.containsXY(x, y)) {
_help(0, bt);
return true;}
else {
return panel.rbtn_up(x, y);
}
}
function on_paint(gr) {
gr.FillRectangle(0, 0, panel.w, panel.h, colours.background);
buttons.paint(gr);
}
function on_size() {
panel.size();
}