#ifdef __WIN32__
static char * rootName = "Entire Computer";
-static char * msNetwork = "Microsoft Windows Network";
+static const char * msNetwork = "Microsoft Windows Network";
#else
-static char * rootName = "File System";
+static const char * rootName = "File System";
#endif
private:
define guiApp = (GuiApplication)((__thisModule).application);
define selectionColor = guiApp.currentSkin.selectionColor; //Color { 10, 36, 106 };
-void MessageBoxTodo(char * message)
+void MessageBoxTodo(const char * message)
{
PrintLn("MessageBoxTodo(char * message) -- ", message);
MessageBox { type = ok, text = "MessageBoxTodo(char * message)", contents = message }.Modal();
}
-static char * fileIconNames[] =
+static const char * fileIconNames[] =
{
"<:ecere>mimeTypes/file.png", /* none */
};
define countOfCompIconNames = 6;
-static char * compIconNames[] =
+static const char * compIconNames[] =
{
/*
"<:ede>a.png",
virtual bool Window::NotifyNodeMenu(FileSystemBox box, Menu menu, FileSystemBoxSelection selection);
virtual bool Window::NotifyIteratorInit(FileSystemBox box, FileSystemIterator fileSystemIterator);
- property char * path
+ property const char * path
{
set
{
{
set
{
- delete comparedPaths;
+ if(comparedPaths)
+ {
+ comparedPaths.Free();
+ delete comparedPaths;
+ }
if(value && value.count)
comparedPaths = value;
if(locationBox)
split.leftPane = value ? list : null;
split.visible = value;
show.visible = value;
+ if(!value)
+ {
+ list.parent = this;
+ list.anchor = Anchor { left = 0, top = 0, right = 0, bottom = 0 };
+ }
}
get { return bits.preview; }
};
delete map;
}
- FileSystemNode SelectLocation(char * location)
+ FileSystemNode SelectLocation(const char * location)
{
int c;
char * temp;
for(c = steps.count - 1; c >= 0; c--)
{
- char * t = steps[c];
+ //char * t = steps[c];
node = Find(steps[c], node);
if(!node)
break;
bool MenuOpen(MenuItem selection, Modifiers mods)
{
OpenNode();
+ return true;
}
bool MenuReplaceListItemByContainingDir(MenuItem selection, Modifiers mods)
~FileSystemBox()
{
+ if(comparedPaths)
+ {
+ comparedPaths.Free();
+ delete comparedPaths;
+ }
delete extensions;
delete path;
}
{
if(row)
{
- FileSystemNode node = (FileSystemNode)row.tag;
+ //FileSystemNode node = (FileSystemNode)row.tag;
}
return true;
}
{
if(row)
{
- FileSystemNode node = (FileSystemNode)row.tag;
+ //FileSystemNode node = (FileSystemNode)row.tag;
}
return true;
}
{
if(row)
{
- FileSystemNode node = (FileSystemNode)row.tag;
+ //FileSystemNode node = (FileSystemNode)row.tag;
}
return true;
}
bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
{
- bool result;
+ //bool result = false;
if((SmartKey)key == enter)
- result = OpenNode();
+ /*result = */OpenNode();
#if 0
else if((SmartKey)key == f2)
- result = RenameNode();
+ /*result = */RenameNode();
#endif
else if((SmartKey)key == f2)
{
FileSystemNode node = selection.node;
node.row.Edit(nameField);
}
- else
- result = true;
+ //else
+ //result = true;
return true;
}
};
int wWnd = fsb.show.clientSize.w;
int hWnd = fsb.show.clientSize.h;
- int wList = 0;//fsb.list.size.w + fsb.split.size.w;
+ //int wList = 0;//fsb.list.size.w + fsb.split.size.w;
- float scale = Min((float)(wWnd - 10) / wBmp, (float)(hWnd - 10) / hBmp);
+ //float scale = Min((float)(wWnd - 10) / wBmp, (float)(hWnd - 10) / hBmp);
- int wDraw = (int)(wBmp * scale);
- int hDraw = (int)(hBmp * scale);
+ //int wDraw = (int)(wBmp * scale);
+ //int hDraw = (int)(hBmp * scale);
#ifndef __linux__
surface.Filter(fsb.bitmap, (wWnd - wDraw) / 2, (hWnd - hDraw) / 2, 0, 0, wDraw, hDraw, wBmp, hBmp);
surface.Area(0, 0, fsb.clientSize.w - 1, fsb.clientSize.h - 1);
}
}
- }
+ };
bool OpenNode()
{
{
bool isRoot = !strcmp(path, "/");
char name[MAX_LOCATION];
- FileSystemNode parent;
- FileSystemNode node;
- FileListing listing { path, extensions = extensions };
+ //FileSystemNode parent;
+ //FileSystemNode node;
+ //FileListing listing { path, extensions = extensions };
if(!isRoot)
GetLastDirectory(path, name);
}
}
- bool ListIterator_OnObject(char * name, char * path, FileStats stats, bool isRootObject)
+ bool ListIterator_OnObject(const char * name, const char * path, FileStats stats, bool isRootObject)
{
ProcessListItem(name, path, stats, false);
return false;
//void ListIterator_OnLeavingDirectory(char * path) { }
- void ProcessListItem(char * name, char * path, FileStats stats, bool isListItem)
+ void ProcessListItem(const char * name, const char * path, FileStats stats, bool isListItem)
{
if((!bits.foldersOnly && !bits.filesOnly) || (bits.foldersOnly && stats.attribs.isDirectory) || (bits.filesOnly && stats.attribs.isFile))
{
FileListing listing { path, extensions = extensions };
while(listing.Find())
{
- char * test;
+ //char * test;
FileSystemNode child = null;
if((!bits.foldersOnly && !bits.filesOnly) ||
(bits.foldersOnly && listing.stats.attribs.isDirectory) ||
(bits.filesOnly && listing.stats.attribs.isFile))
child = MakeAndAddToTreeFileSystemNodeFromFileListing(listing, parent);
if(child)
+ {
added = true;
- test = child.name;
- if(!test)
- PrintLn("error");
+ /*
+ test = child.name;
+ if(!test)
+ PrintLn("error");
+ */
+ }
}
if(!added)
added = true;
void LoadComparedList()
{
- int c, cmp/*, smallest*/, icon;//, equalCount;
+ int c/*, cmp*/ /*, smallest*/, icon;//, equalCount;
int count = comparedPaths ? comparedPaths.count : 0;
//bool allDone = false;
bool not;
void AddNode(FileSystemNode node)
{
DataRow row = list.AddRow();
- row.tag = (int)node;
+ row.tag = (intptr)node;
node.row = row;
incref node;
row.SetData(nameField, node);
(bits.filesOnly && listing.stats.attribs.isFile)))*/
{
bool textFileLinesStyle = false;
- char * test = listing.name;
+ const char * test = listing.name;
if(!test)
PrintLn("error");
result = MakeFileSystemNode(listing.stats, listing.name, listing.path, false, bits.previewPictures, false, displaySystem);
node.indent = addTo.indent + 1;
addTo.children.Add(node);
}
- row.tag = (int)node;
+ row.tag = (intptr)node;
node.row = row;
row.SetData(null, node);
if(bits.pathColumn)
}
public:
- /*//LinkElement<FileSystemNode> link;
+ /* LinkElement<FileSystemNode> link;
FileSystemNode parent;
FileSystemNodeType type;
property bool isListItem { set { bits.isListItem = value; } get { return bits.isListItem; } };
- property char * path
+ property const char * path
{
set { delete path; if(value && value[0]) path = CopyString(value); }
get { return path; } isset { return path && path[0]; }
}
- property char * name
+ property const char * name
{
set { delete name; if(value && value[0]) name = CopyString(value); }
get { return name; } isset { return name && name[0]; }
set { delete extension; if(value && value[0]) extension = CopyString(value); }
get { return extension; } isset { return extension && extension[0]; }
}
- property char * label
+ property const char * label
{
set { delete label; if(value && value[0]) label = CopyString(value); }
get { return label; } isset { return label && label[0]; }
}
- property char * info
+ property const char * info
{
set { delete info; if(value && value[0]) info = CopyString(value); }
get { return info; } isset { return info && info[0]; }
void OnDisplay(Surface surface, int x, int y, int width, FileSystemBox fsb, Alignment alignment, DataDisplayFlags displayFlags)
{
//int indentSize = (displayFlags.dropBox) ? 0 : 10;
- int indent = 16;
+ //int indent = 16;
int xStart;
int len;
int w, h;
//}
#endif
- bool OnGetDataFromString(char * string)
+ bool OnGetDataFromString(const char * string)
{
#if 0
if(string && *string)
return false;
}
- char * OnGetString(char * tempString, FileSystemToolWindow fileSysToolWnd, bool * needClass)
+ const char * OnGetString(char * tempString, void * unused /*FileSystemToolWindow fileSysToolWnd*/, bool * needClass)
{
return name ? name : "";
}
const bool pathAddName,
const bool previewPicture,
const bool isListItem,
- const DisplaySystem displaySystem)
+ /*const */DisplaySystem displaySystem)
{
int len = strlen(name);
char info[MAX_LOCATION];
if(pathAddName)
{
- bool isFile = stats.attribs.isFile;
- bool isFolder = stats.attribs.isDirectory;
+ //bool isFile = stats.attribs.isFile;
+ //bool isFolder = stats.attribs.isDirectory;
char full[MAX_LOCATION];
strcpy(full, path);
PathCat(full, name);
const bool previewPicture,
const int cmpIcon,
const bool cmpNot,
- const Array<int> exists,
- const DisplaySystem displaySystem)
+ /*const */Array<int> exists,
+ /*const */DisplaySystem displaySystem)
{
FileSystemNode node = MakeFileSystemNode(stats, name, path, pathAddName, previewPicture, false, displaySystem);
if(node)