5 public class DeleteBox : Window
7 background = activeBorder;
10 size = Size { 400, 300 };
11 text = "Delete Confirmation";
20 parent = this, borderStyle = deep, hasVertScroll = true, hasHorzScroll = true;
21 fullRowSelect = false, treeBranches = true, collapseControl = true, rootCollapseButton = true;
23 size = Size { 624, 268 }, anchor = Anchor { left = 248, right = 8, bottom = 8 };
24 text = "Browser", hotKey = Key { e, alt = true };
26 /*hasHeader = true, moveFields = true, resizable = true, sortable = true;*/
27 anchor = Anchor { left = 8, top = 8, right = 8, bottom = 48 };
29 DataField listNameField { header = "Name", dataType = "ExplorerFileBranch", width = 304, userData = this }; // editable = true
33 list.AddField(listNameField);
47 FileTreeBranchArray copies { growingFactor = 2 };
48 FileTreeBranchBSArray branches { };
49 FileTreeBranchArray parents { growingFactor = 4 };
51 source.GetMultiSelection(selection);
53 for(item = selection.first; item; item = item.next)
55 DataRow row = item.data;
56 ExplorerFileBranch branch = (ExplorerFileBranch)row.tag;
60 for(c = 0; c < parents.count; c++)
62 if(branch.IsChildOf(parents._[c]))
65 if(c == parents.count)
74 // what if a child of some parent was added before that parent, should check to remove
75 // or is it imposible to get the backwards order from GetMultiSelection
77 //for(branch = (ExplorerFileBranch)row.tag; branch; branch = branch.parent)
78 // branches.Add(branch);
84 char path[MAX_LOCATION];
85 for(c = 0; c < parents.count; c++)
87 ExplorerFileBranch parent = parents._[c];
88 ExplorerFileBranch root { };
90 root.name = CopyString(path);
91 root.childrenLoaded = true;
92 root.type = parent.type;
93 AddBranch(root, true, false, null, list);
94 parent.DuplicateChildren(true, true, root, list);
100 copies.count = branches.count;
108 for(b = 0; b < branches.count; b++)
110 if(branches._[b].indent == i)
112 ExplorerFileBranch copy;
113 //copy = branches._[b].Copy();
125 char path[MAX_LOCATION];
126 DataRow row = item.data;
127 ExplorerFileBranch branch = (ExplorerFileBranch)row.tag;
128 branch.GetPath(path);
131 if(!FileExists(path))
132 DeleteBranch(branch, source);