public import "ecere" import "ExplorerTree" public class DeleteBox : Window { background = activeBorder; hasClose = true; tabCycle = true; size = Size { 400, 300 }; text = "Delete Confirmation"; public: ListBox source; private: ListBox list { parent = this, borderStyle = deep, hasVertScroll = true, hasHorzScroll = true; fullRowSelect = false, treeBranches = true, collapseControl = true, rootCollapseButton = true; multiSelect = true; size = Size { 624, 268 }, anchor = Anchor { left = 248, right = 8, bottom = 8 }; text = "Browser", hotKey = Key { e, alt = true }; /*hasHeader = true, moveFields = true, resizable = true, sortable = true;*/ anchor = Anchor { left = 8, top = 8, right = 8, bottom = 48 }; }; DataField listNameField { header = "Name", dataType = "ExplorerFileBranch", width = 304, userData = this }; // editable = true DeleteBox() { list.AddField(listNameField); } ~DeleteBox() { } /* bool OnPostCreate() { if(source) { Link item; OldList selection; FileTreeBranchArray copies { growingFactor = 2 }; FileTreeBranchBSArray branches { }; FileTreeBranchArray parents { growingFactor = 4 }; source.GetMultiSelection(selection); for(item = selection.first; item; item = item.next) { DataRow row = item.data; ExplorerFileBranch branch = (ExplorerFileBranch)row.tag; if(parents.count) { uint c; for(c = 0; c < parents.count; c++) { if(branch.IsChildOf(parents._[c])) break; } if(c == parents.count) { parents.Add(branch); } } else { parents.Add(branch); } // what if a child of some parent was added before that parent, should check to remove // or is it imposible to get the backwards order from GetMultiSelection //for(branch = (ExplorerFileBranch)row.tag; branch; branch = branch.parent) // branches.Add(branch); } selection.Free(null); { uint c; char path[MAX_LOCATION]; for(c = 0; c < parents.count; c++) { ExplorerFileBranch parent = parents._[c]; ExplorerFileBranch root { }; parent.GetPath(path); root.name = CopyString(path); root.childrenLoaded = true; root.type = parent.type; AddBranch(root, true, false, null, list); parent.DuplicateChildren(true, true, root, list); } } */ /* copies.count = branches.count; { bool added = true; uint b; int i = 0; while(added) { for(b = 0; b < branches.count; b++) { if(branches._[b].indent == i) { ExplorerFileBranch copy; //copy = branches._[b].Copy(); added = true; } } i++; } } */ /* */ /* char path[MAX_LOCATION]; DataRow row = item.data; ExplorerFileBranch branch = (ExplorerFileBranch)row.tag; branch.GetPath(path); if(FileExists(path)) DeleteFile(path); if(!FileExists(path)) DeleteBranch(branch, source); */ /* } } */ };