3 static char * fileIconNames[] =
5 "<:ecere>mimeTypes/file.png", /* none */
7 "<:ecere>mimeTypes/file.png", /* normalFile */
8 "<:ecere>mimeTypes/textEcereWorkspace.png", /* ewsFile */
9 "<:ecere>mimeTypes/textEcereProject.png", /* epjFile */
10 "<:ecere>mimeTypes/textEcereSource.png", /* ecFile */
11 "<:ecere>mimeTypes/textEcereHeader.png", /* ehFile */
12 "<:ecere>mimeTypes/textCSource.png", /* cFile */
13 "<:ecere>mimeTypes/textCHeader.png", /* hFile */
14 "<:ecere>mimeTypes/textC++Source.png", /* cppFile */
15 "<:ecere>mimeTypes/textC++Header.png", /* hppFile */
16 "<:ecere>mimeTypes/text.png", /* textFile */
17 "<:ecere>mimeTypes/textHyperTextMarkup.png", /* webFile */
18 "<:ecere>mimeTypes/image.png", /* pictureFile */
19 "<:ecere>status/audioVolumeHigh.png", /* soundFile */
20 "<:ecere>mimeTypes/package.png", /* archiveFile */
21 "<:ecere>mimeTypes/packageSoftware.png", /* packageFile */
22 "<:ecere>mimeTypes/packageOpticalDisc.png", /* opticalMediaImageFile */
24 "<:ecere>places/folder.png", /* folder */
25 "<:ecere>status/folderOpen.png", /* folderOpen */
26 "<:ecere>devices/computer.png", /* computer */
27 "<:ecere>devices/driveHardDisk.png", /* drive */
28 "<:ecere>places/driveRemote.png", /* netDrive */
29 "<:ecere>devices/mediaOptical.png", /* cdrom */
30 "<:ecere>devices/driveRemovableMedia.png", /* removable */
31 "<:ecere>devices/mediaFloppy.png", /* floppy */
32 "<:ecere>places/networkWorkgroup.png", /* network */
33 "<:ecere>places/networkServer.png", /* server */
34 "<:ecere>places/folderRemote.png", /* share */
36 "<:ecere>mimeTypes/package.png", /* treeLoader */
37 "<:ecere>places/startHere.png", /* lineNumbers */
42 //define guiApp = ((GuiApplication)__thisModule);
43 //define selectionColor = guiApp.currentSkin.selectionColor; //Color { 10, 36, 106 };
45 public enum __FileType
49 normalFile, ewsFile, epjFile, ecFile, ehFile, cFile, hFile, cppFile, hppFile,
50 textFile, webFile, pictureFile, soundFile,
51 archiveFile, packageFile, opticalMediaImageFile, /* these (all previous) are sort equal */
53 folder, folderOpen, computer,
54 drive, netDrive, cdrom, removable, floppy, network, server, share, // these are sort equal
64 this = SelectByExtension(value);
68 public property bool isFolder
70 get { return this >= folder && this <= share; }
73 public property bool isFile
75 get { return this >= normalFile && this <= opticalMediaImageFile; }
78 __FileType ::SelectByExtension(char * extension)
80 if(!strcmpi(extension, "ews"))
82 else if(!strcmpi(extension, "epj"))
84 else if(!strcmpi(extension, "ec"))
86 else if(!strcmpi(extension, "eh"))
88 else if(!strcmpi(extension, "cpp") ||
89 !strcmpi(extension, "cc") || !strcmpi(extension, "cxx"))
91 else if(!strcmpi(extension, "hpp") ||
92 !strcmpi(extension, "hh") || !strcmpi(extension, "hxx"))
94 else if(!strcmpi(extension, "c"))
96 else if(!strcmpi(extension, "h"))
98 else if(!strcmpi(extension, "txt") || !strcmpi(extension, "text") ||
99 !strcmpi(extension, "nfo") || !strcmpi(extension, "info"))
101 else if(!strcmpi(extension, "htm") || !strcmpi(extension, "html") ||
102 !strcmpi(extension, "css") || !strcmpi(extension, "php") ||
103 !strcmpi(extension, "js"))
105 else if(!strcmpi(extension, "bmp") || !strcmpi(extension, "pcx") ||
106 !strcmpi(extension, "jpg") || !strcmpi(extension, "jpeg") ||
107 !strcmpi(extension, "gif") || !strcmpi(extension, "png") ||
108 !strcmpi(extension, "ico"))
110 else if(!strcmpi(extension, "wav") || !strcmpi(extension, "mp3") ||
111 !strcmpi(extension, "ogg") || !strcmpi(extension, "snd"))
113 else if(!strcmpi(extension, "ear") || !strcmpi(extension, "7z") ||
114 !strcmpi(extension, "rar") || !strcmpi(extension, "zip") ||
115 !strcmpi(extension, "gz") || !strcmpi(extension, "bz2") ||
116 !strcmpi(extension, "tar") || !strcmpi(extension, "arj") ||
117 !strcmpi(extension, "lza") || !strcmpi(extension, "lzh") ||
118 !strcmpi(extension, "cpio") || !strcmpi(extension, "z"))
120 else if(!strcmpi(extension, "cab") || !strcmpi(extension, "deb") ||
121 !strcmpi(extension, "rpm"))
123 else if(!strcmpi(extension, "iso") || !strcmpi(extension, "mds") ||
124 !strcmpi(extension, "cue") || !strcmpi(extension, "bin") ||
125 !strcmpi(extension, "ccd") || !strcmpi(extension, "bwt") ||
126 !strcmpi(extension, "cdi") || !strcmpi(extension, "nrg"))
127 return opticalMediaImageFile;
132 //public enum FileSystemNodeType { file, folder, system };
134 define guiApp = ((GuiApplication)__thisModule); // how to do this in a dll?
135 define selectionColor = guiApp.currentSkin.selectionColor; //Color { 10, 36, 106 };
137 public class FileSystemNode : struct // : struct
140 /*//LinkElement<FileSystemNode> link;
141 FileSystemNode parent;
143 FileSystemNodeType type;
147 FileSystemNode prev, next;
149 bool loaded, childrenLoaded;
158 FileSystemNode parent;
164 void GetPath(String outputPath)
169 strcpy(outputPath, name);
170 for(up = parent; up; up = up.parent)
172 char temp[MAX_LOCATION];
173 strcpy(temp, up.name);
174 PathCat(temp, outputPath);
175 strcpy(outputPath, temp);
180 strcpy(outputPath, "/");
182 strcpy(outputPath, name);
187 bool IsChildOf(FileSystemNode node)
190 for(test = parent; test; test = test.parent)
196 void DuplicateChildren(bool recursive, bool forceExpanded, FileSystemNode addTo, FileSystemBox fsb)
200 FileSystemNode child;
202 for(child = children.first; child; child = child.next)
204 FileSystemNode copy { };
205 copy.name = CopyString(child.name);
206 copy.type = child.type;
207 fsb.AddTreeNode(copy, child.loaded, false, addTo);
209 copy.row.collapsed = false;
211 child.DuplicateChildren(recursive, forceExpanded, copy, fsb);
216 void EnsureVisible(bool expand)
219 parent.EnsureVisible(true);
221 row.collapsed = false;
222 // TODO: row.EnsureVisible(); // making the row visible by scrolling
232 FileSystemNode child;
233 for(; (child = children.first); )
236 children.Delete(child);
247 parent.children.Delete(this);
250 void OnDisplay(Surface surface, int x, int y, int width, FileSystemBox fsb, Alignment alignment, DataDisplayFlags displayFlags)
252 //int indentSize = (displayFlags.dropBox) ? 0 : 10;
258 char label[MAX_FILENAME];
265 icon = fsb.fileIcons[type].bitmap;
266 /*if(type == normalFile)
268 //xStart = indent * indent + x + (icon ? (icon.width + 5) : 0);
269 xStart = x + (icon ? (icon.width + 5) : 0);
275 sprintf(label, "%s [%s]", name, info);
282 if(type == folder || type == folderOpen)
283 surface.SetForeground(yellow);
287 //textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0);
289 surface.TextOpacity(false);
290 surface.TextExtent(label, len, &w, &h);
293 // Draw the current row stipple
294 if(displayFlags.selected)
295 //surface.Area(xStart - 1, y, xStart - 1, y + h - 1);
296 //surface.Area(xStart + w - 1, y, xStart + w + 1, y + h - 1);
297 surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1);
299 //surface.WriteTextDots(alignment, x + textOffset, y + 2, width - textOffset, name, strlen(name));
300 surface.WriteTextDots(alignment, xStart, y + 2, width, label, len);
302 //if(!guiApp.textMode) -- how to do this in a dll?
304 if(displayFlags.current)
306 if(displayFlags.active)
308 surface.LineStipple(0x5555);
309 if(displayFlags.selected)
310 surface.SetForeground(0xFFFFFF80);
312 surface.SetForeground(black);
316 surface.SetForeground(selectionColor);
318 surface.Rectangle(xStart - 3, y, xStart + w + 1, y + h - 1);
319 surface.LineStipple(0);
327 if(type == pictureFile && fsb.previewPictures && bitmap)
329 surface.SetForeground(white);
330 surface.blend = true;
332 //surface.Filter(bitmap, (clientSize.w - w) / 2,(clientSize.h - h) / 2, 0,0, w, h, bitmap.width, bitmap.height);
333 //surface.Filter(bitmap, x + indent/* * indentSize*/ + 2, y, 0, 0, w, h, bitmap.width, bitmap.height);
334 surface.Filter(bitmap, x,y,0,0, w, h, bitmap.width, bitmap.height);
336 // Until Filter / Stretch works with X
337 //surface.Blit(bitmap, (clientSize.w - bitmap.width) / 2,(clientSize.h - bitmap.height) / 2, 0,0, bitmap.width, bitmap.height);
338 // surface.blend = true;
339 //surface.Blit(bitmap, x + indent/* * indentSize*/ + 2, y,0,0, w, h);
340 //surface.Blit(bitmap, x,y,0,0, bitmap.width, bitmap.height);
347 //surface.blend = true;
348 //surface.alphaWrite = blend;
349 surface.SetForeground(white);
350 //surface.Blit(icon, x + indent * indentSize, y,0,0, icon.width, icon.height);
351 surface.Blit(icon, x,y,0,0, icon.width, icon.height);
356 int OnCompare(FileSystemNode b)
359 FileSystemNode a = this;
360 if(a.type == b.type || (a.type < folder && b.type < folder) || (a.type >= drive))
361 result = strcmpi(a.name, b.name);
364 if(a.type == folder && b.type < folder) result = -1;
365 else if(a.type < folder && b.type == folder) result = 1;
371 /*int OnCompare(FileSystemNode b)
374 FileSystemNode a = this;
375 if(a.parent < b.parent) result = -1;
376 else if(a.parent > b.parent) result = 1;
378 result = fstrcmp(a.name, b.name);
382 char * OnGetString(char * tempString, FileSystemToolWindow fileSysToolWnd, bool * needClass)
384 return name ? name : "";
388 /*FileSystemNode MakeFileSystemNode(const FileStats stats, const char * name)
390 FileSystemNode node { stats = stats };
391 node.name = CopyString(name);
394 if(stats.attribs.isDirectory)
396 node.type = (stats.attribs.isDrive) ? drive : folder;
397 if(stats.attribs.isServer) node.type = server;
398 if(stats.attribs.isShare) node.type = share;
399 if(stats.attribs.isCDROM) node.type = cdrom;
400 if(stats.attribs.isRemote) node.type = netDrive;
401 if(stats.attribs.isRemovable)
403 if(name[0] == 'A' || name[0] == 'B')
406 node.type = removable;
411 char extension[MAX_EXTENSION];
412 GetExtension(node.name, extension);
413 node.type = __FileType::SelectByExtension(extension);
417 static FileSystemNode MakeFileSystemNode(const FileStats stats,
418 const char * fileName, const char * filePath,
419 const bool previewPicture, const DisplaySystem displaySystem)
421 int len = strlen(fileName);
422 char info[MAX_LOCATION];
423 char name[MAX_LOCATION];
424 char extension[MAX_EXTENSION];
426 FileSystemNode node { stats = stats };
428 //if(stats.attribs.isFile) // -- should work now
429 if(stats.attribs.isDirectory)
433 node.type = (stats.attribs.isDrive) ? drive : folder;
434 if(stats.attribs.isServer) node.type = server;
435 if(stats.attribs.isShare) node.type = share;
436 if(stats.attribs.isCDROM) node.type = cdrom;
437 if(stats.attribs.isRemote) node.type = netDrive;
438 if(stats.attribs.isRemovable)
440 if(fileName[0] == 'A' || fileName[0] == 'B')
443 node.type = removable;
448 GetExtension(fileName, extension);
451 node.type = __FileType::SelectByExtension(extension);
454 if(stats.attribs.isDrive &&
455 len > 3 && !strncmp(&fileName[1], ": [", 3))
457 strncpy(name, fileName, 2);
459 strncpy(info, &fileName[4], len - 5);
464 strcpy(name, fileName);
468 node.path = CopyString(filePath);
469 node.name = CopyString(name);
471 node.info = CopyString(info);
472 node.extension = CopyString(extension);
474 if(node.type == pictureFile && previewPicture)
476 node.bitmap = Bitmap { alphaBlend = true };
477 node.bitmap.Load(filePath, null, displaySystem);
483 class FileSystemBoxBits
485 bool foldersOnly:1, filesOnly:1, details:1, treeBranches:1, previewPictures:1, navigateFolders:1;
486 //bool header:1, freeSelect:1, fullRowSelect:1, multiSelect:1, autoScroll:1, alwaysHL : 1, moveRows:1, resizable:1;
487 //bool moveFields:1, clearHeader:1, alwaysEdit:1, collapse:1, treeBranch:1, rootCollapse:1, heightSet:1;
488 //bool sortable:1, noDragging:1, fillLastField:1, expandOnAdd:1;
491 public class FileSystemBox : Window // should we not derive from ListBox instead?
493 this stuff from the listbox would be nicely exposed...
494 fullRowSelect = false;
496 collapseControl = true;
497 rootCollapseButton = true;
502 hasHorzScroll = false;
503 hasVertScroll = false;
509 FileSystemNode selection;
511 virtual bool Window::NotifyNodeSelect(FileSystemBox box, FileSystemNode node);
512 virtual bool Window::NotifyNodeOpen(FileSystemBox box, FileSystemNode node);
519 if(value && value[0])
520 path = CopyString(value);
522 locationBox.path = value;
528 //isset { return path && path[0]; }
531 property bool foldersOnly { set { bits.foldersOnly = value; bits.filesOnly = !value; } get { return bits.foldersOnly; } };
532 property bool filesOnly { set { bits.filesOnly = value; bits.foldersOnly = !value; } get { return bits.filesOnly; } };
533 property bool previewPictures { set { bits.previewPictures = value; } get { return bits.previewPictures; } };
534 property char * extensions { set { delete extensions; if(value && value[0]) extensions = CopyString(value); } get { return extensions; } }
535 property bool details { set { bits.details = value; } get { return bits.details; } };
536 property bool treeBranches
540 bits.treeBranches = value;
541 list.treeBranches = value;
542 list.collapseControl = value;
543 list.rootCollapseButton = value;
545 get { return bits.treeBranches; }
547 property bool navigateFolders { set { bits.navigateFolders = value; bits.foldersOnly = !value; } get { return bits.navigateFolders; } };
549 property FileSystemNode node
557 if(!list.currentRow.tag)
559 return (FileSystemNode)list.currentRow.tag;
565 void Select(FileSystemNode node)
569 node.EnsureVisible(false);
570 list.SelectRow(node.row);
574 FileSystemNode Find(const char * name, FileSystemNode parent)
577 FileSystemNode start = parent ? parent : root;
578 if(!start.loaded || !start.childrenLoaded)
580 for(node = start.children.first; node; node = node.next)
581 if(node.name && !strcmpi(node.name, name))
592 FileSystemBoxBits bits;
597 BitmapResource fileIcons[__FileType];
601 char wd[MAX_LOCATION];
602 GetWorkingDir(wd, sizeof(wd));
606 list.AddField(nameField);
616 for(c = 0; c < __FileType::enumSize; c++)
618 fileIcons[c] = BitmapResource { fileIconNames[c], alphaBlend = true };
619 AddResource(fileIcons[c]);
623 DataField nameField { dataType = "FileSystemNode", width = 240, userData = this, freeData = false };
624 DataField typeField { header = "Type", dataType = /*"String"*/ "char *", width = 40, freeData = false };
625 DataField sizeField { header = "Size", dataType = "FileSize", width = 96, alignment = right, freeData = false };
638 hasHorzScroll = true;
639 hasVertScroll = true;
640 fullRowSelect = false;
643 anchor = Anchor { left = 0, top = 0, right = 0, bottom = 0 };
645 // WHY is this not working ?
646 /*void OnResize(int width, int height)
648 if(vertScroll.visible)
649 nameField.width = width - vertScroll.size.w;
651 nameField.width = width;
654 bool NotifyCollapse(ListBox listBox, DataRow row, bool collapsed)
658 FileSystemNode node = (FileSystemNode)row.tag;
659 FileSystemNode child;
663 for(child = node.children.last; child; child = node.children.last)
665 listBox.DeleteRow(child.row);
669 node.childrenLoaded = false;
674 if(!node.loaded || !node.childrenLoaded)
677 //list.Sort(nameField, 1);
680 for(child = node.children.first; child && child.next; child = child.next);
682 child.EnsureVisible(false);
688 bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
690 DataRow row = listBox.currentRow;
693 FileSystemNode node = (FileSystemNode)row.tag;
699 MenuItem { menu, "Cut\tCtrl+X", t, NotifySelect = null, disabled = false };
700 MenuItem { menu, "Copy\tCtrl+C", c, NotifySelect = null, disabled = false };
701 MenuItem { menu, "Paste\tCtrl+V", p, NotifySelect = null, disabled = false /*!clipboard*/ };
702 MenuItem { menu, "Delete\tDel", d, NotifySelect = null, disabled = false };
703 //MenuDivider { menu };
707 master = this, menu = menu,
709 x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
710 y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
718 bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
722 FileSystemNode node = (FileSystemNode)row.tag;
723 NotifyNodeSelect(listBox.parent.master, this, node);
729 bool NotifyEditing(ListBox listBox, DataRow row)
733 FileSystemNode node = (FileSystemNode)row.tag;
738 bool NotifyEdited(ListBox listBox, DataRow row)
742 FileSystemNode node = (FileSystemNode)row.tag;
747 bool NotifyEditDone(ListBox listBox, DataRow row)
751 FileSystemNode node = (FileSystemNode)row.tag;
756 bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
761 bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
764 if((SmartKey)key == enter)
775 if(selection && selection.type.isFolder && bits.navigateFolders)
777 property::path = selection.path;
781 result = NotifyNodeOpen(this.master, this, selection);
786 Menu editMenu { menu, "Edit", e };
789 editMenu, "Cut\tCtrl+X", t, disabled = true;
791 bool NotifySelect(MenuItem selection, Modifiers mods)
797 MenuItem itemEditCopy
799 editMenu, "Copy\tCtrl+C", c, disabled = true;
801 bool NotifySelect(MenuItem selection, Modifiers mods)
807 MenuItem itemEditPaste
809 editMenu, "Paste\tCtrl+V", p;
811 bool NotifySelect(MenuItem selection, Modifiers mods)
817 MenuItem itemEditDelete
819 editMenu, "Delete\tDel", d, disabled = true;
821 bool NotifySelect(MenuItem selection, Modifiers mods)
828 // WHY is this crashing ?
829 /*void OnResize(int width, int height)
831 if(this && nameField)
832 nameField.width = width - 80;
838 // this is crashing in for designer when details = true // can't save the file, always yields a crash
839 /*if(list && created)
842 list.AddField(nameField);
845 list.AddField(typeField);
846 list.AddField(sizeField);
849 if(bits.treeBranches)
857 FileListing listing { path, extensions = extensions };
860 while(listing.Find())
862 if((!bits.foldersOnly && !bits.filesOnly) ||
863 (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
864 (bits.filesOnly && listing.stats.attribs.isFile))
866 FileSystemNode node = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
867 DataRow row = list.AddRow();
869 row.SetData(nameField, node);
872 row.SetData(typeField, node.extension);
873 row.SetData(sizeField, (void *)node.stats.size);
877 list.Sort(nameField, 1);
882 //char startPath[MAX_LOCATION];
883 FileSystemNode parent;
885 FileListing listing { path, extensions = extensions };
888 GetWorkingDir(startPath, sizeof(startPath));
890 strcpy(path, startPath);*/
895 //root = FileSystemNode { type = computer, loaded = true, childrenLoaded = true };
896 root = MakeFileSystemNode(FileStats { attribs = FileExists(path)}, path, path, bits.previewPictures, displaySystem);
898 //root.name = rootName;
899 AddTreeNode(root, true, false, null);//, list);
903 AddTreeNode(root, false, true, null);
905 // How can this make sense for linux?
907 while(listing.Find())
909 int len = strlen(listing.name);
910 char info[MAX_LOCATION];
911 char name[MAX_LOCATION];
912 if(listing.stats.attribs.isDrive &&
913 len > 3 && !strncmp(&listing.name[1], ": [", 3))
915 strncpy(name, listing.name, 2);
917 strncpy(info, &listing.name[4], len - 5);
922 strcpy(name, listing.name);
926 parent = MakeFileSystemNode(listing.stats, name);
928 parent.info = CopyString(info);
929 parent.loaded = true;
930 AddTreeNode(parent, !listing.stats.attribs.isDirectory, listing.stats.attribs.isDirectory, root, this);
931 if(!listing.stats.attribs.isDirectory)
932 parent.childrenLoaded = true;
935 node = FileSystemNode { name = msNetwork, type = network };
936 AddTreeNode(node, false, true, null, this);
937 node.row.collapsed = true;
942 list.Sort(nameField, 1);
945 void LoadTreeNode(FileSystemNode node)
949 char path[MAX_LOCATION];
952 FileListing listing { path, extensions = extensions };
953 if(node.children.count == 1)
954 DeleteNode(node.children.first);
956 while(listing.Find())
958 if(!listing.stats.attribs.isRemovable && ((!bits.foldersOnly && !bits.filesOnly) ||
959 (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
960 (bits.filesOnly && listing.stats.attribs.isFile)))
962 FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
963 AddTreeNode(child, true, false, node);
964 NodeChildLoad(child, node);
968 node.childrenLoaded = true;
970 node.row.SortSubRows(false);
972 else if(!node.childrenLoaded)
974 FileSystemNode child;
975 if(node.children.first)
977 for(child = node.children.first; child; child = child.next)
981 else if(!child.childrenLoaded)
982 NodeChildLoad(child, node);
984 node.childrenLoaded = true;
985 node.row.SortSubRows(false);
990 void NodeChildLoad(FileSystemNode parent, FileSystemNode node)
992 char path[MAX_LOCATION];
993 parent.GetPath(path);
996 FileListing listing { path, extensions = extensions };
997 while(listing.Find())
999 if((!bits.foldersOnly && !bits.filesOnly) ||
1000 (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
1001 (bits.filesOnly && listing.stats.attribs.isFile))
1003 FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
1004 AddTreeNode(child, true, false, parent);
1011 //parent.childrenLoaded = true;
1014 void AddTreeNode(FileSystemNode node, bool loaded, bool addLoader, FileSystemNode addTo)
1016 DataRow row = (addTo && addTo.row) ? addTo.row.AddRow() : list.AddRow();
1019 node.parent = addTo;
1020 node.indent = addTo.indent + 1;
1021 addTo.children.Add(node);
1023 row.tag = (int)node;
1025 row.SetData(null, node);
1027 node.loaded = loaded;
1029 //AddTreeNode(FileSystemNode { }, false, false, node); // why would this create a compile error?
1030 AddTreeNode(FileSystemNode { type = none }, false, false, node);
1033 row.collapsed = true;
1034 else if(node.type == folder)
1035 node.type = folderOpen;
1038 void DeleteNode(FileSystemNode node)
1040 FileSystemNode child;
1041 for(; (child = node.children.first); )
1043 list.DeleteRow(node.row);
1047 public class ClipBoardFiles
1061 int size = SelSize();
1064 // Try to allocate memory
1065 ClipBoard clipBoard { };
1066 if(clipBoard.Allocate(size+1))
1068 GetSel(clipBoard.memory, true);
1081 ClipBoard clipBoard { };
1082 if(clipBoard.Load())
1083 PutS(clipBoard.memory);
1094 SetViewToCursor(true);
1099 Private Type DROPFILES
1105 For iCounter = 0 To filelist.ListCount - 1
1106 If filelist.Selected(iCounter) = True Then
1107 strFiles = strFiles & FixPath(filelist.Path) & filelist.List(iCounter) & vbNullChar
1110 'all selected items are now put in strFiles
1112 hGlobal = GlobalAlloc(GHND, Len(DF) + Len(strFiles)) 'put all files to a exclusive number
1113 If hGlobal Then 'if the globalalloc worked
1114 lpGlobal = GlobalLock(hGlobal) 'lock the hGlobal
1115 DF.pFiles = Len(DF) 'set the size of the files
1117 Call CopyMem(ByVal lpGlobal, DF, Len(DF)) 'copy df to the lpglobal
1118 Call CopyMem(ByVal (lpGlobal + Len(DF)), ByVal strFiles, Len(strFiles)) 'copy strfiles to lpglobal
1119 Call GlobalUnlock(hGlobal) 'unlock hglobal again
1121 SetClipboardData CF_HDROP, hGlobal 'put files to the clipboard
1124 bool SaveFile(const char * filePath)