Бывалый писикарщик
Регистрация: 14.06.2013
Регион: Украина
Машина: Nissan Qashqai+2
Сообщений: 3,424
|
VadimKHL
Протестируй такой вариант удаления (замени скрипт кнопок, что у тебя на фото по ПКМ) :
PHP код:
// ==PREPROCESSOR== // @name "BUTTON PANEL" // ==/PREPROCESSOR==
//================================ Buttons Panel function RGBA(r, g, b, a) { return a << 24 | r << 16 | g << 8 | b; } function RGB(r,g,b){ return (0xff000000|(r<<16)|(g<<8)|(b)); }
DT_TOP = 0x00000000; DT_LEFT = 0x00000000; DT_CENTER = 0x00000001; DT_RIGHT = 0x00000002; DT_VCENTER = 0x00000004; DT_BOTTOM = 0x00000008; DT_WORDBREAK = 0x00000010; DT_SINGLELINE = 0x00000020; DT_EXPANDTABS = 0x00000040; DT_TABSTOP = 0x00000080; DT_NOCLIP = 0x00000100; DT_EXTERNALLEADING = 0x00000200; DT_CALCRECT = 0x00000400; // [1.2.1] Handles well DT_NOPREFIX = 0x00000800; // NOTE: Please use this flag, or a '&' character will become a underline '_' DT_INTERNAL = 0x00001000; DT_EDITCONTROL = 0x00002000; DT_PATH_ELLIPSIS = 0x00004000; DT_END_ELLIPSIS = 0x00008000; DT_RTLREADING = 0x00020000; DT_WORD_ELLIPSIS = 0x00040000; DT_NOFULLWIDTHCHARBREAK = 0x00080000; DT_HIDEPREFIX = 0x00100000; DT_PREFIXONLY = 0x00200000;
//======================================================= Variables var VK_CONTROL = 0x11; var WshShell = new ActiveXObject("WScript.Shell"); var fso = new ActiveXObject("Scripting.FileSystemObject");
var set_path = fb.ProfilePath + "\\settings\\"; var imgPath = fb.FoobarPath + "Themes\\4Icar\\Images\\";
var font_name_prop = window.GetProperty("Font Name","Segoe MDL2 Assets"); var font_size_prop = window.GetProperty("Font Size",15);
var background_color = RGB(15,15,15);
var lbtn_down = false; var ww = wh = 0; var height = wh;
var g_font = gdi.Font(font_name_prop, font_size_prop,0);
var on_mouse = false; try{ var btn_type = utils.ReadINI( set_path + 'settings.ini', 'Button Folder', 'Button Folder'); var m_t = utils.ReadINI(set_path + 'settings.ini', 'Mouse_touch', 'set'); }catch(e){ var btn_type = "btn_set_1"; var m_t = "1"; };
//=================================================================// var B = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\BUTTON.png"); var ANIM_BUT_L = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\ANIM_BUT.png"); var se = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\clear.png"); var dn_p = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\dn_p.png"); var up_p = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\up_p.png"); var ctrl = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\ctrl.png"); var del_tracks = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\del_tr.png"); var se = gdi.Image(imgPath + "Buttons\\" + btn_type + "\\clear.png");
var ctrl_timeout = utils.ReadINI(set_path + 'settings.ini', 'ctrl_timer', 'TimeWait','')/1000; var ctrl_status = window.GetProperty("Ctrl Status", true); var trace_on = window.GetProperty("Trace ON Status", true);
if(ctrl_status == true){ window.SetProperty("Ctrl Status", false); }; //var text_width; var hbtn; var dbtn;
//function Button(x, x2, y, w, h, img, img2, onclick, tiptext) { function Button(x, y, w, h, img, img2, onclick) { this.x = x; //this.x2 = x2; this.y = y; this.w = w; this.h = h; this.img = img; this.img2 = img2; this.onclick = onclick; this.state = 0; //this.opacity = 0; this.refresh = 0; //this.tiptext = tiptext;
this.xy = function (x, y) {
return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
}
//=================================== this.changeState = function (state) { //if (!button_timer) button_timer = window.CreateTimerInterval(60); window.RepaintRect(this.x-2, this.y-2, this.w+4, this.h+4); this.state = state; this.refresh = 1;
switch (state) { case 0: //if(window.GetProperty("TipText")==true){ //tooltip.Deactivate();} //window.SetCursor(32512); break; case 1: //if(window.GetProperty("TipText")==true){ //tooltip.Text = this.tiptext; //tooltip.Activate();} //window.SetCursor(32512); break; case 2: } } //------------------> Draw Buttons this.draw = function (gr) { var state = this.state; var op = this.opacity; on_draw(gr, x, y, w, h, img, img2, op, state);
} // =================================== /* this.Opacity = function () { if(this.state == 1 && this.opacity < 255) this.opacity = Math.min(this.opacity + 10, 255); if(this.state == 0 && this.opacity > 0) this.opacity = Math.max(0,this.opacity - 10); if (this.opacity == 0){ this.refresh = 0; button_timeout = window.CreateTimerTimeout(3000); } //window.RepaintRect(ww/2-H.width/2, wh-H.height+1, H.width, H.height); }; */ // =================================== this.onClick = function () { this.onclick && this.onclick(); } } //================================================================// // ========================================================================== // buttons_on_mouse_move = function(x, y){
xy = false;
for (var i = 0; i < $buttons.length; i++)
if ($buttons[i].xy(x, y)) {
xy = true;
if (hbtn != $buttons[i]) { if (hbtn) hbtn.changeState(0); hbtn = $buttons[i]; hbtn.changeState(m_t); }; } if (xy == false) { if (hbtn) { hbtn.changeState(0); hbtn = undefined; }; } } // ========================================================================== // buttons_on_mouse_lbtn_down = function (x, y) {
if (hbtn) { dbtn = hbtn; dbtn.changeState(2);
} } // ========================================================================== // buttons_on_mouse_lbtn_up = function (x, y) {
if (dbtn) { dbtn.changeState(1); dbtn.onClick(); dbtn = undefined; }
} // ========================================================================== // buttons_on_mouse_leave = function () {
if (hbtn) { hbtn.changeState(0); hbtn = undefined; } } // ========================================================================== //
// ========================================================================== // buttons_on_timer = function(id){
if (button_timeout && id == button_timeout.ID) { if (button_timer) window.KillTimer(button_timer); button_timer = false;
}
for (var i = 0; i < $buttons.length; i++) { if ($buttons[2].refresh) { $buttons[2].Opacity(); } } } //======================================================= recalc function recalc_dimensions(){ ww = window.Width; wh = window.Height;
bw = B.width; bh = B.height;
try{ var btn_type = utils.ReadINI( set_path + 'settings.ini', 'Button Folder', 'Button Folder'); } catch(e){ var btn_type = "btn_set_1"; }; ctrl_timeout = utils.ReadINI(set_path + 'settings.ini', 'ctrl_timer', 'TimeWait','')/1000; //var bd = 20; //bx = ww/2-PLAY.width/2 ; //glass == 0 ? by = wh-PLAY.height/3-4 : by = wh-PLAY.height/3-1; $buttons = [ // 1 new Button(0,0 , B.width, B.height, ANIM_BUT_L, ctrl, function () { ctrl_status = window.GetProperty("Ctrl Status"); ctrl_status ? ctrl_keyb_sw(1) : ctrl_keyb_sw(0) ; ctrl_status = !ctrl_status; window.SetProperty("Ctrl Status", ctrl_status);// 1
}), // 2
new Button(0, bh, B.width, B.height, ANIM_BUT_L, del_tracks, function () { try { window.SetProperty("Ctrl Status", false); window.ClearInterval(t_); utils.WriteINI(set_path + 'settings.ini', 'lib_panel', 'lib_panel', 0); WshShell.SendKeys("^"); window.SetProperty("Ctrl Status", false); window.ClearInterval(t_); ////////////////////window.NotifyOthers("library", "send_to_pl"); //WshShell.Run("taskkill /f /im ctrl.exe",0); //WshShell.Run(set_path + butt_type); var autoit_obj = new ActiveXObject("AutoItX3.Control"); //autoit_obj.Send("{CTRLUP}") autoit_obj.ControlSend("[CLASS:{E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}]", "", "JScript Panel Class6", "{Numpad8}") deley(); autoit_obj = undefined; } catch(e) {}; recalc_dimensions(); window.Repaint(); }),
// 3 new Button(0, bh*2, B.width, B.height, ANIM_BUT_L, up_p, function () { if (utils.IsKeyPressed(VK_CONTROL)) { var autoit_obj = new ActiveXObject("AutoItX3.Control"); autoit_obj.Send("{CTRLUP}") window.NotifyOthers("pl", "pgup"); autoit_obj.Send("{CTRLDOWN}") autoit_obj = undefined; ctrl_keyb_sw(0) window.SetProperty("Ctrl Status", true) }
}), // 4 new Button(0, bh*3, B.width, B.height, ANIM_BUT_L, dn_p, function () { if (utils.IsKeyPressed(VK_CONTROL)) { // WshShell.Run(set_path + butt_type2); var autoit_obj = new ActiveXObject("AutoItX3.Control"); autoit_obj.Send("{CTRLUP}") window.NotifyOthers("pl", "pgdn"); autoit_obj.Send("{CTRLDOWN}") autoit_obj = undefined; ctrl_keyb_sw(0) window.SetProperty("Ctrl Status", true) // WshShell.Run(set_path + butt_type5); } }) ] } //------------------------------------------------------------------------// recalc_dimensions(); // ================================================== //
function on_draw(gr, x, y, w, h, img, img2, op, state) {
gr.DrawImage(img, Math.ceil(x), Math.ceil(y), Math.ceil(w), Math.ceil(h), 0, state*h, Math.ceil(w), Math.ceil(h), 0, 255); //gr.DrawImage(H, Math.ceil(ww/2-H.width/2), Math.ceil(wh-H.height+1), Math.ceil(H.width), Math.ceil(H.height), 0, 0, Math.ceil(H.width), Math.ceil(H.height), 0, op); //gr.DrawImage(img2, Math.ceil(x2), Math.ceil(y), Math.ceil(w), Math.ceil(h), 0, 0, Math.ceil(w), Math.ceil(h), 0, 250); gr.DrawImage(img2,Math.ceil(x), Math.ceil(y), Math.ceil(w), Math.ceil(h),0,state *h,Math.ceil(w), Math.ceil(h), 0, 255); } // ================================================== // function on_paint (gr) { ctrl_status = window.GetProperty("Ctrl Status"); gr.FillSolidRect(0,0,ww,wh,background_color) for (var i = 0; i < 4; i++) { $buttons[i].draw(gr); }
//if(window.IsVisible){ //var ctrl_timeout = utils.ReadINI(set_path + 'settings.ini', 'ctrl_timer', 'TimeWait','')/1000; try{ var text_width = gr.CalcTextWidth(ctrl_timeout, g_font); //gr.GdiDrawText(ctrl_timeout, g_font, RGB(200,200,210), bw/2-text_width/2-10, bh+bh/2-8, text_width, font_size_prop+10,DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS); // dsp text gr.GdiDrawText("", g_font,ctrl_status == false ? RGBA(235,235,210,255):((j & 1) == 0? RGBA(0,255,0,255):RGBA(0,0,0,40)), bw/2-text_width/2-9, 0+bh/2-11, text_width+5, font_size_prop+10,DT_CENTER | DT_VCENTER | DT_WORD_ELLIPSIS); // dsp text } catch(e){} //}
}
// ================================================== //
function on_size() { if (!window.Width || !window.Height) { return; } ww = window.Width; wh = window.Height; //default_layout();
bw = B.width; bh = B.height;
recalc_dimensions();
if (ww <= 0 || wh <= 0) return;
//var bd = 20; //bx = ww/2-PLAY.width/2 ; //glass == 0 ? by = wh-PLAY.height/3-4 : by = wh-PLAY.height/3-1; } // ================================================== // function on_mouse_move(x, y) { buttons_on_mouse_move(x, y); } //==================================================// function on_mouse_lbtn_down(x, y) { recalc_dimensions(); on_mouse_move(x, y);
buttons_on_mouse_lbtn_down(x, y);
} // ================================================== // function on_mouse_lbtn_up(x, y) {
lbtn_down = false;
if(utils.ReadINI( set_path + 'settings.ini', 'del', 'del_off', 0 )){ utils.WriteINI( set_path + 'settings.ini', 'del', 'del_off', 1 ); } ctrl_status = window.GetProperty("Ctrl Status");
ctrl_sts_chg(); window.Repaint(); buttons_on_mouse_lbtn_up(x, y); }
// ================================================== // function on_mouse_leave() { buttons_on_mouse_leave(); } // ================================================== // function on_timer(id) { buttons_on_timer(); } // ================================================== // function on_mouse_lbtn_dblclk(x, y) {
} // ================================================== //
function on_mouse_rbtn_down(x, y) { }
function on_playback_new_track() { //recalc_dimensions(); CollectGarbage(); } // ================================================== // function on_notify_data(name, info) { if(name == "lib_btns" && info == "send_to_pl_ok") { window.SetProperty("Ctrl Status", false); recalc_dimensions(); window.Repaint(); }; }; var t_ = false; var j = 0; function ctrl_sts_chg(){
ctrl_timeout = utils.ReadINI(set_path + 'settings.ini', 'ctrl_timer', 'TimeWait','')/1000; j = 0; window.ClearInterval(t_); t_ = window.SetInterval(function(){ if (lib_panel = utils.ReadINI(set_path + 'settings.ini', 'lib_panel', 'lib_panel')== 16){ ctrl_keyb_sw(1) } j = j + 1; if(ctrl_status = window.GetProperty("Ctrl Status") == false){ window.ClearInterval(t_); j = 0; recalc_dimensions(); //window.Repaint(); }; if(j >= ctrl_timeout ){ window.ClearInterval(t_); j = 0; window.SetProperty("Ctrl Status", false); recalc_dimensions(); // utils.WriteINI(set_path + 'settings.ini', 'lib_panel', 'lib_panel', 0); //window.Repaint(); }; //if(trace_on)fb.trace("ctrl_timeout::: "+j); window.Repaint(); //var text_width = gr.CalcTextWidth(ctrl_timeout, g_font); //window.RepaintRect(bw/2-text_width/2-10, bh+bh/2-8, text_width, font_size_prop+10); },1000); //window.SetProperty("Ctrl Status", false); //recalc_dimensions(); //window.Repaint(); }; var s; function ctrl_keyb_sw(s){ switch(s){ case 0: var autoit_obj = new ActiveXObject("AutoItX3.Control"); autoit_obj.Send("{CTRLUP}") autoit_obj.Send("{CTRLDOWN}") autoit_obj = undefined; // WshShell.Run(set_path + butt_type2); utils.WriteINI(set_path + 'settings.ini', 'lib_panel', 'lib_panel', 1); break; case 1: // WshShell.Run("taskkill /f /im ctrl.exe",0); utils.WriteINI(set_path + 'settings.ini', 'lib_panel', 'lib_panel', 0); WshShell.SendKeys("^"); window.SetProperty("Ctrl Status", false); window.ClearInterval(t_); break; }; }; function deley(){ t_1 = window.SetInterval(function(){ var autoit_obj = new ActiveXObject("AutoItX3.Control"); autoit_obj.ControlClick("Confirm File Removal", "", "[CLASS:Button; INSTANCE:1]", "Left", 1) window.ClearInterval(t_1); },15); }
как это выглядит в сборке:
Последний раз редактировалось seriousstas; 17.08.2019 в 23:58.
|