Code: Select all
local F = far.Flags
local Dlg = {
--[[ 1]] {"DI_DOUBLEBOX", 3, 1,72,15, 0, 0, 0, 0, "TEST"},
--[[ 2]] {"DI_LISTBOX", 5, 2,58,12,
{
{ Text="line &1" }, { Text="line &2" }, { Text="line &3" },
{ Text="line &4" }, { Text="line &5" }, { Text="line &6" },
}, 0, 0, "DIF_LISTNOAMPERSAND", "Мой клёвый Листбокс"},
--[[ 3]] {"DI_BUTTON", 60,3, 0, 0, 0, 0, 0, "DIF_BTNNOCLOSE", "&Add"},
--[[ 4]] {"DI_BUTTON", 60,4, 0, 0, 0, 0, 0, "DIF_BTNNOCLOSE", "Add &Str"},
--[[ 5]] {"DI_BUTTON", 60,5, 0, 0, 0, 0, 0, "DIF_BTNNOCLOSE", "&Del.Str"},
--[[ 6]] {"DI_BUTTON", 60,6, 0, 0, 0, 0, 0, "DIF_BTNNOCLOSE", "&Update"},
--[[ 7]] {"DI_TEXT", 5,13, 0, 0, 0, 0, 0, {DIF_BOXCOLOR=1,DIF_SEPARATOR=1}, ""},
--[[ 8]] {"DI_BUTTON", 0,14, 0, 0, 0, 0, 0, {DIF_CENTERGROUP=1, DIF_DEFAULTBUTTON=1}, "Ok"},
--[[ 9]] {"DI_BUTTON", 0,14, 0, 0, 0, 0, 0, "DIF_CENTERGROUP", "Cancel"},
}
local function DlgProc (hDlg, msg, param1, param2)
if msg == F.DN_BTNCLICK then
if param1 == 3 then
far.SendDlgMessage (hDlg, "DM_LISTADD", 2,
{
{ Text="added text 1" },
{ Text="added text 2", Flags="LIF_CHECKED" }
})
elseif param1 == 4 then
far.SendDlgMessage (hDlg, "DM_LISTADDSTR", 2, "Добавленная строка")
elseif param1 == 5 then
far.SendDlgMessage (hDlg, "DM_LISTDELETE", 2, {StartIndex=2, Count=1})
elseif param1 == 6 then
far.SendDlgMessage (hDlg, "DM_SETTEXT", 2, "updated text")
end
elseif msg == F.DN_LISTCHANGE then
--far.Message(param2)
--- return 0
end
end
far.Dialog ("",-1,-1,76,17,"Contents",Dlg, 0, DlgProc)