summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f287260)
- Also removed bad spaces
"<:ecere>mimeTypes/package.png", /* treeLoader */
"<:ecere>places/startHere.png", /* lineNumbers */
"<:ecere>mimeTypes/package.png", /* treeLoader */
"<:ecere>places/startHere.png", /* lineNumbers */
public enum _FileType
{
none,
public enum _FileType
{
none,
normalFile, ewsFile, epjFile, ecFile, ehFile, cFile, hFile, cppFile, hppFile,
textFile, webFile, pictureFile, soundFile,
archiveFile, packageFile, opticalMediaImageFile, /* these (all previous) are sort equal */
normalFile, ewsFile, epjFile, ecFile, ehFile, cFile, hFile, cppFile, hppFile,
textFile, webFile, pictureFile, soundFile,
archiveFile, packageFile, opticalMediaImageFile, /* these (all previous) are sort equal */
folder, folderOpen, computer,
drive, netDrive, cdrom, removable, floppy, network, server, share, // these are sort equal
folder, folderOpen, computer,
drive, netDrive, cdrom, removable, floppy, network, server, share, // these are sort equal
// utilities
treeLoader,
lineNumbers;
// utilities
treeLoader,
lineNumbers;
virtual bool Window::NotifyNodeOpen(FileSystemBox box, FileSystemBoxSelection selection);
virtual bool Window::NotifyNodeMenu(FileSystemBox box, Menu menu, FileSystemBoxSelection selection);
virtual bool Window::NotifyIteratorInit(FileSystemBox box, FileSystemIterator fileSystemIterator);
virtual bool Window::NotifyNodeOpen(FileSystemBox box, FileSystemBoxSelection selection);
virtual bool Window::NotifyNodeMenu(FileSystemBox box, Menu menu, FileSystemBoxSelection selection);
virtual bool Window::NotifyIteratorInit(FileSystemBox box, FileSystemIterator fileSystemIterator);
property char * path
{
set
property char * path
{
set
};
property bool columnsCompareStyle { set { bits.columnsCompareStyle = value; } get { return bits.columnsCompareStyle; } };
property bool textFileLinesStyle { set { bits.textFileLinesStyle = value; } get { return bits.textFileLinesStyle; } };
};
property bool columnsCompareStyle { set { bits.columnsCompareStyle = value; } get { return bits.columnsCompareStyle; } };
property bool textFileLinesStyle { set { bits.textFileLinesStyle = value; } get { return bits.textFileLinesStyle; } };
property FileSystemNode node
{
get
property FileSystemNode node
{
get
+ char wd[MAX_LOCATION];
+ GetWorkingDir(wd, sizeof(wd));
+ property::path = wd;
+
InitFileIcons();
InitCompIcons(); // todo: these icons should not be initialize, they should be set
// or at least initalized when the comparison listing is requested
InitFileIcons();
InitCompIcons(); // todo: these icons should not be initialize, they should be set
// or at least initalized when the comparison listing is requested
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
popup = PopupMenu
{
master = this, menu = menu,
popup = PopupMenu
{
master = this, menu = menu,
- position = {
- x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
+ position = {
+ x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
- // WHY is this crashing ?
+ // WHY is this crashing ?
/*void OnResize(int width, int height)
{
if(this && nameField)
/*void OnResize(int width, int height)
{
if(this && nameField)
GetLastDirectory(path, name);
else
name[0] = '\0';
GetLastDirectory(path, name);
else
name[0] = '\0';
/*if(!path)
GetWorkingDir(startPath, sizeof(startPath));
else
strcpy(path, startPath);*/
/*if(!path)
GetWorkingDir(startPath, sizeof(startPath));
else
strcpy(path, startPath);*/
delete root;
#ifdef __WIN32__
if(isRoot)
delete root;
#ifdef __WIN32__
if(isRoot)
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
{
_[c].Free();
delete _[c];
{
_[c].Free();
delete _[c];
int hWnd = clientSize.h;
int wList = view.list.size.w + view.split.size.w;
int hWnd = clientSize.h;
int wList = view.list.size.w + view.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);
for(pos = 0; pos < selectedItems.count; pos++)
{
Bitmap bitmap { };
for(pos = 0; pos < selectedItems.count; pos++)
{
Bitmap bitmap { };
- selItem = (ExplorerFileItem)selectedItems._[pos];
+ selItem = (ExplorerFileItem)selectedItems._[pos];
bitmap.Load(selItem.path, null, displaySystem);
//view.bitmaps.Add(bitmap);
bitmap.Load(selItem.path, null, displaySystem);
//view.bitmaps.Add(bitmap);
if(item && item.type == pictureFile)
{
view.bitmap = Bitmap { };
if(item && item.type == pictureFile)
{
view.bitmap = Bitmap { };
location.GetPath(path);
{
FileListing listing { path };
location.GetPath(path);
{
FileListing listing { path };
ExplorerFileItem item;
DataRow row;
ExplorerFileItem item;
DataRow row;
FileSystemNode selection;
virtual bool Window::NotifyNodeSelect(ExplorerTree tree, FileSystemNode node);
FileSystemNode selection;
virtual bool Window::NotifyNodeSelect(ExplorerTree tree, FileSystemNode node);
property FileSystemNode node
{
get
property FileSystemNode node
{
get
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
{
DataRow row = listBox.currentRow;
popup = PopupMenu
{
master = this, menu = menu,
popup = PopupMenu
{
master = this, menu = menu,
- position = {
- x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
+ position = {
+ x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
};
popup.Create();
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
MenuItem itemEditPaste
{
editMenu, "Paste\tCtrl+V", p;
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
bool NotifySelect(MenuItem selection, Modifiers mods)
{
//EditPaste();
- // WHY is this crashing ?
+ // WHY is this crashing ?
/-*void OnResize(int width, int height)
{
if(this && nameField)
/-*void OnResize(int width, int height)
{
if(this && nameField)
#endif
AddTreeNode(root, true, false, false, null, tree);
#endif
AddTreeNode(root, true, false, false, null, tree);
- // How can this make sense for linux?
+ // How can this make sense for linux?
#ifdef __WIN32__
while(listing.Find())
{
int len = strlen(listing.name);
char info[MAX_LOCATION];
char name[MAX_LOCATION];
#ifdef __WIN32__
while(listing.Find())
{
int len = strlen(listing.name);
char info[MAX_LOCATION];
char name[MAX_LOCATION];
- if(listing.stats.attribs.isDrive &&
+ if(listing.stats.attribs.isDrive &&
len > 3 && !strncmp(&listing.name[1], ": [", 3))
{
strncpy(name, listing.name, 2);
len > 3 && !strncmp(&listing.name[1], ": [", 3))
{
strncpy(name, listing.name, 2);
ClipBoard clipBoard { };
if(clipBoard.Allocate(size+1))
{
ClipBoard clipBoard { };
if(clipBoard.Allocate(size+1))
{
- GetSel(clipBoard.memory, true);
+ GetSel(clipBoard.memory, true);
// Save clipboard
clipBoard.Save();
}
// Save clipboard
clipBoard.Save();
}
If hGlobal Then 'if the globalalloc worked
lpGlobal = GlobalLock(hGlobal) 'lock the hGlobal
DF.pFiles = Len(DF) 'set the size of the files
If hGlobal Then 'if the globalalloc worked
lpGlobal = GlobalLock(hGlobal) 'lock the hGlobal
DF.pFiles = Len(DF) 'set the size of the files
Call CopyMem(ByVal lpGlobal, DF, Len(DF)) 'copy df to the lpglobal
Call CopyMem(ByVal (lpGlobal + Len(DF)), ByVal strFiles, Len(strFiles)) 'copy strfiles to lpglobal
Call GlobalUnlock(hGlobal) 'unlock hglobal again
Call CopyMem(ByVal lpGlobal, DF, Len(DF)) 'copy df to the lpglobal
Call CopyMem(ByVal (lpGlobal + Len(DF)), ByVal strFiles, Len(strFiles)) 'copy strfiles to lpglobal
Call GlobalUnlock(hGlobal) 'unlock hglobal again
SetClipboardData CF_HDROP, hGlobal 'put files to the clipboard
End If
*-/
SetClipboardData CF_HDROP, hGlobal 'put files to the clipboard
End If
*-/
}
BSloc Remove(FileSystemNode item)
{
}
BSloc Remove(FileSystemNode item)
{
//float scale = Min((float)clientSize.w / (float)bitmap.width, (float)clientSize.h / (float)bitmap.height);
int w = 16; //(int)(bitmap.width * scale);
int h = 16; //(int)(bitmap.height * scale);
//float scale = Min((float)clientSize.w / (float)bitmap.width, (float)clientSize.h / (float)bitmap.height);
int w = 16; //(int)(bitmap.width * scale);
int h = 16; //(int)(bitmap.height * scale);
Bitmap icon;
icon = control.fileIcons[type].bitmap;
Bitmap icon;
icon = control.fileIcons[type].bitmap;
indentSize = 8;
}
textOffset = indent * indentSize + (icon ? (icon.width + 6) : 0);
indentSize = 8;
}
textOffset = indent * indentSize + (icon ? (icon.width + 6) : 0);
if(info)
sprintf(label, "%s [%s]", name, info);
else
if(info)
sprintf(label, "%s [%s]", name, info);
else
{
//_[c].Free()
delete _[c];
{
//_[c].Free()
delete _[c];
char info[MAX_LOCATION];
char name[MAX_LOCATION];
char extension[MAX_EXTENSION];
char info[MAX_LOCATION];
char name[MAX_LOCATION];
char extension[MAX_EXTENSION];
ExplorerFileItem item { };
//if(stats.attribs.isFile) // -- should work now
ExplorerFileItem item { };
//if(stats.attribs.isFile) // -- should work now
item.type = cdrom;
if(attribs.isRemote)
item.type = netDrive;
item.type = cdrom;
if(attribs.isRemote)
item.type = netDrive;
- if(attribs.isRemovable)
+ if(attribs.isRemovable)
{
if(fileName[0] == 'A' || fileName[0] == 'B')
item.type = floppy;
{
if(fileName[0] == 'A' || fileName[0] == 'B')
item.type = floppy;
GetExtension(fileName, extension);
//strupr(extension);
strlwr(extension);
GetExtension(fileName, extension);
//strupr(extension);
strlwr(extension);
item.type = _FileType::SelectByExtension(extension);
}
item.type = _FileType::SelectByExtension(extension);
}
len > 3 && !strncmp(&fileName[1], ": [", 3))
{
strncpy(name, fileName, 2);
len > 3 && !strncmp(&fileName[1], ": [", 3))
{
strncpy(name, fileName, 2);
Array<int> exists; // would use (see) BoolArrayInt to pack this into an int if could be accessed as an array
void GetPath(String outputPath)
Array<int> exists; // would use (see) BoolArrayInt to pack this into an int if could be accessed as an array
void GetPath(String outputPath)
if(path)
strcpy(outputPath, path);
else if(parent)
if(path)
strcpy(outputPath, path);
else if(parent)
PathCat(temp, outputPath);
strcpy(outputPath, temp);
}
PathCat(temp, outputPath);
strcpy(outputPath, temp);
}
- /*else
- {
- /-*#ifdef __WIN32__
- strcpy(outputPath, "/");
- #else*-/
- //strcpy(outputPath, name);
- strcpy(outputPath, path);
- PathCat(outputPath, name);
- //#endif
- }*/
+ else
+ strcpy(outputPath, name ? name : "");
}
bool IsChildOf(FileSystemNode node)
}
bool IsChildOf(FileSystemNode node)
if(children.first)
{
FileSystemNode child;
if(children.first)
{
FileSystemNode child;
for(child = children.first; child; child = child.next)
{
FileSystemNode copy { };
for(child = children.first; child; child = child.next)
{
FileSystemNode copy { };
void EnsureVisible(bool expand)
{
if(parent)
void EnsureVisible(bool expand)
{
if(parent)
comp = fsb.comparedPaths && fsb.comparedPaths.count > 1;
comp = fsb.comparedPaths && fsb.comparedPaths.count > 1;
icon = fsb.fileIcons[type].bitmap;
alt = bits.isListItem ? path : name;
if(comp && !fsb.bits.columnsCompareStyle && cmpIcon)
icon = fsb.fileIcons[type].bitmap;
alt = bits.isListItem ? path : name;
if(comp && !fsb.bits.columnsCompareStyle && cmpIcon)
strcpy(text, label ? label : alt); //"%d-%d/%s", stats.inode, stats.nlink
//sprintf(text, "%d-%d/%s", stats.inode, stats.nlink, label ? label : alt);
len = strlen(text);
strcpy(text, label ? label : alt); //"%d-%d/%s", stats.inode, stats.nlink
//sprintf(text, "%d-%d/%s", stats.inode, stats.nlink, label ? label : alt);
len = strlen(text);
if(!icon)
{
if(type == folder || type == folderOpen)
if(!icon)
{
if(type == folder || type == folderOpen)
indent = 8;
}
//textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0);
indent = 8;
}
//textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0);
surface.SetForeground(displayFlags.selected ? fsb.selectionText : fsb.foreground);
surface.TextOpacity(false);
surface.TextExtent(text, len, &w, &h);
h = Max(h, 16);
surface.SetForeground(displayFlags.selected ? fsb.selectionText : fsb.foreground);
surface.TextOpacity(false);
surface.TextExtent(text, len, &w, &h);
h = Max(h, 16);
// Draw the current row stipple
if(displayFlags.selected)
//surface.Area(xStart - 1, y, xStart - 1, y + h - 1);
//surface.Area(xStart + w - 1, y, xStart + w + 1, y + h - 1);
surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1);
// Draw the current row stipple
if(displayFlags.selected)
//surface.Area(xStart - 1, y, xStart - 1, y + h - 1);
//surface.Area(xStart + w - 1, y, xStart + w + 1, y + h - 1);
surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1);
//surface.WriteTextDots(alignment, x + textOffset, y + 2, width - textOffset, alt, strlen(alt));
surface.WriteTextDots(alignment, xStart, y + 2, width, text, len);
//surface.WriteTextDots(alignment, x + textOffset, y + 2, width - textOffset, alt, strlen(alt));
surface.WriteTextDots(alignment, xStart, y + 2, width, text, len);
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
- if(stats.attribs.isRemovable)
+ if(stats.attribs.isRemovable)
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
char info[MAX_LOCATION];
char name2[MAX_LOCATION];
char extension[MAX_EXTENSION];
char info[MAX_LOCATION];
char name2[MAX_LOCATION];
char extension[MAX_EXTENSION];
FileSystemNode node { stats = stats };
/*if(!pathAddName)
FileSystemNode node { stats = stats };
/*if(!pathAddName)
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
if(stats.attribs.isShare) node.type = share;
if(stats.attribs.isCDROM) node.type = cdrom;
if(stats.attribs.isRemote) node.type = netDrive;
- if(stats.attribs.isRemovable)
+ if(stats.attribs.isRemovable)
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
{
if(name[0] == 'A' || name[0] == 'B')
node.type = floppy;
{
GetExtension(name, extension);
strlwr(extension);
{
GetExtension(name, extension);
strlwr(extension);
node.type = _FileType::SelectByExtension(extension);
}
node.type = _FileType::SelectByExtension(extension);
}
- if(stats.attribs.isDrive &&
+ if(stats.attribs.isDrive &&
len > 3 && !strncmp(&name[1], ": [", 3))
{
strncpy(name2, name, 2);
len > 3 && !strncmp(&name[1], ": [", 3))
{
strncpy(name2, name, 2);