static hwnd = win.handle("c=TTOTAL_CMD") local ActivePanel = win.sendmessage(hwnd, 0x400+50, 1000, 0) static Counter = win.sendmessage(hwnd, 0x400+50, 1004 + ActivePanel, 0) local Current = win.sendmessage(hwnd, 0x400+50, 1006 + ActivePanel, 0) static Updir = win.sendmessage(hwnd, 0x400+50, 1008 + ActivePanel, 0) static Slash = "\" static ENCF = "ERROR: no comment file" static CurPath = file.folder(win.gettext(win.sendmessage(hwnd, 0x400+50, 8 + ActivePanel, 0))) ++ Slash if(!Current && Updir) do local DirComment = .Subs\Sub_Descript_ion(CurPath, "..", 0, "g") if(DirComment == ENCF) DirComment = "" flag clear 1 else if(Counter < 2) do win.postmessage(hwnd, 0x400+51, 2700, 0) quit endif flag set 1 clip.save clip.clear win.sendmessage(hwnd, 0x400+51, 2018, 0) wait.for(clip.get) static List = clip.get clip.clear wait.for(!clip.get) clip.load endif local RadioButtons = 3 static Active = 3 static Quote = ?+"+ static EFCS = "'EditFileComments' script" static R = cl.Create("Radio", 1) local Width = 150 static Off = "e:\Storage\Graphics\Icons\Visual Basic\MISC13.ICO" static On = "e:\Storage\Graphics\Icons\Visual Basic\MISC14.ICO" local CS = "@ChangeState" static T = "Text" static EndComment = esc(?+\x04+, ?+\+) ++ esc(?+\xC2+, ?+\+) local i R.Insert(0) R.SetLabel(0, ?+*control button center "Close"+) R.AddLeft(0, "*bar close Radio") R.Insert(0) R.SetLabel(0, ?+*control button center "OK"+) R.AddLeft(0, cb("@OK")) R.Insert(0) R.SetLabel(0, ?+*control button autocheckbox "\ is a newline char"+) R.SetId(0, "Newline") R.SetHeight(0, 30) R.Insert(0) R.SetLabel(0, "Instead") R.AddLeft(0, cb(CS, 3)) R.Insert(0) R.SetLabel(0, "After") R.AddLeft(0, cb(CS, 2)) R.Insert(0) R.SetLabel(0, "Before") R.AddLeft(0, cb(CS, 1)) R.SetId(0, "Radio1") R.Insert(0) R.SetLabel(0, "*control edit left autohscroll clientedge") R.SetId(0, T) if(pproflag(1)) do R.Insert(0) local Text = "List " ++ Counter ++ " files..." R.SetLabel(0, "*control button " ++ Quote ++ Text ++ Quote) R.AddLeft(0, cb("@FileList")) endif R.SetWidth(0, Width) static Radio1 = R.GetIdIndex("Radio1") R.SetProperties("Format=barsize samesize flat vertical border iconsize: 16 topmost 3DFrame No3DColor") for(i = Radio1; i <= Radio1 + RadioButtons; i++) R.SetIcon(i, Off) R.SetEnabled(i, 0) endfor R.SetIcon(Radio1 + RadioButtons - 1, On) R.show win.setfocus(R.GetCtrlHandle(R.GetIdIndex(T))) if(DirComment) R.SetCtrlValue(T, DirComment) quit //================================================= Function ChangeState(Num) R.SetIcon(Active + Radio1 - 1, Off) R.SetIcon(Num + Radio1 - 1, On) Active = Num R.show quit //================================================= Function OK local Result, Item, Path, Name local Str = R.GetCtrlValue(T) local NewLine = R.GetCtrlValue("NewLine") local v = vec.createfromwords("b a s") R.close if(not Str) do Item = "" *Exec Prompt 2 Comment string is empty. Delete old comments? if(pproflag(2)) do R.show else quit endif endif if(find(Str, Slash) != -1 && NewLine) Str = replacechars(Str, Slash, "\n") ++ EndComment local Par = ifelse(Result == 6, "d", v[Active - 1]) if(pproflag(1)) do for each line Item in List Result = file.isfolder(Item) Path = file.folder(remove(Item, -1*Result)) ++ Slash Name = file.nametype(remove(Item, -1*Result)) .Subs\Sub_Descript_ion(Path, Name, Str, Par) endfor else .Subs\Sub_Descript_ion(CurPath, "..", Str, Par) endif wait.for(50) win.setfocus(hwnd) win.sendmessage(hwnd, 0x400+51, 540, 0) quit //================================================= Function FileList local Item, Text, Mess, i, FiF static TabChar = esc(?+\t+, ?+\+) static CR = esc(?+\r+, ?+\+) for(i = 1; i <= Counter; i++) Item = line(List, i) FiF = file.isfolder(Item) Path = file.folder(remove(Item, -1*FiF)) ++ Slash Name = file.nametype(remove(Item, -1*FiF)) Text = .Subs\Sub_Descript_ion(Path, Name, 0, "g") Mess ++= i ++ ": " ++ TabChar ++ Item if(Text && Text != ENCF) Mess ++= CR ++ TabChar ++ "Comment: " ++ TabChar ++ Text Mess ++= CR endfor Mess = replacechars(Mess, EndComment, "") Mess = replacechars(Mess, "\n", CR ++ repeat(TabChar, 3)) Mess = remove(Mess, -1) messagebox("ok information", Mess, EFCS) quit