|
|
| Название | DeleteButtons |
| Имя файла (*.txt) | DeleteButtons.txt |
| Описание | Удаляет кнопки с панели по умлочанию (default.bar) |
| Автор | Вахмурка |
| Параметры | - |
| Вызываемые плагины | file, ini, dialog, win |
| Иконка |
|
| Версия | 1.0 |
| Дата обновления | 23.06.2017 |
local hwnd = win.handle("c=TTOTAL_CMD")
local Path = file.folder(win.exepath(hwnd))
static Config = Path ++ "\DEFAULT.BAR"
static BB = "Buttonbar"
static BC = "Buttoncount"
static Buttons = ini.get(Config, BB, BC)
dialog.error_dialog_on()
local hDlg = dialog.define("0!", "0!", "163!", "44!", "DeleteButtons Script", "thickframe sysmenu centre", "" , "", "", "", "plugins\dialog.dll", 1)
if(not hDlg)
quit
local iCnt = 1
local EN_CHANGE = 0x0300
hDlg.define_control("16 6 12 10", "editbox", "ebCnt", iCnt, "3d border", "", "", EN_CHANGE)
hDlg.define_control("6 6 12 10", "spinner", "spCnt", "", "setbuddyint")
hDlg.define_control("32 6 128 10", "static", "text", "Number of buttons to delete (from right)")
hDlg.define_control("6 22 74 16", "button", "", "Ok", "", cbx("@onOk"), "", "", "", "", "ok")
hDlg.define_control("86 22 74 16", "button", "btQuit", "&Cancel", "", cbx("@onQuit"), "", "", "", "", "cancel")
hDlg.create(0)
local hWnd = hDlg.get("ebCnt", "hwnd")
hDlg.send_message("spCnt", "setbuddy", hWnd, 0, 0)
hDlg.run("foreground")
hDlg.set_range("spCnt", 1, Buttons)
quit
;===================================================
Function onOk(sUserArg, dlgHan)
local Num = dlgHan.get_value("spCnt")
dlgHan.destroy()
local i, j, Counter, Real
local w = vec.createfromwords("button cmd param path menu iconic")
if(w <= 0) do
messagebox("ok error", "Failure creating vector", "VEC plugin Error #2")
quit
endif
local Keys = w.length
for(i = Buttons; i > 0; i--)
flag set 1
if(ini.check_exists(Config, BB, w[0] ++ i) == 3 && not ini.get(Config, BB, w[0] ++ i)) do
flag clear 1
Real++
endif
for(j = 0; j < Keys; j++)
if(ini.check_exists(Config, BB, w[j] ++ i) == 3)
ini.delete_key(Config, BB, w[j] ++ i)
endfor
if(pproflag(1))
Counter++
if(Counter >= Num)
break
endfor
ini.set(Config, BB, BC, Buttons - Counter - Real)
local Hand = win.handle("c=TTOTAL_CMD")
win.postmessage(Hand, 0x400+51, 2901, 0)
win.postmessage(Hand, 0x400+51, 2901, 0)
quit
;===================================================
Function onQuit(sUserArg, dlgHan)
dlgHan.show("hide")
dlgHan.destroy()
Для определенной работы я обычно помещаю на главную панель (default.bar) одну или несколько кнопок. После выполнения работы они оказываются бесполезными и только занимают место.
Скрипт позволяет в несколько щелчков крысы удалить лишние кнопки. Отсчет ведется справа.
|
На главную |
|
Все о Total Commander |
|
PowerPro |
|
PowerPro & Total Commander |