X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?p=ede;a=blobdiff_plain;f=explorer%2Fsrc%2FExplorerWindow.ec;h=2a61c011cae0654092eabdcb746cbd45e3bedbe9;hp=bdfe37323f59ec8dfd33c9f3a680ba0f8d0dbece;hb=68cb87f18dbd817ecf944d0b912c56da10640a74;hpb=36c3b8012682a36987d0cbeb2399fe003cf7622f diff --git a/explorer/src/ExplorerWindow.ec b/explorer/src/ExplorerWindow.ec index bdfe373..2a61c01 100644 --- a/explorer/src/ExplorerWindow.ec +++ b/explorer/src/ExplorerWindow.ec @@ -10,19 +10,23 @@ enum ExplorerToolId panelTree, panelSearch, addressBar, refresh, - viewList, viewDetails, viewIcons, viewCards, viewShowcase, viewCustom, + viewList, viewDetails, viewIcons, viewCards, viewShowcase, viewTree, viewCustom, previewPictures }; class ExplorerWindow : Window { +#ifdef _DEBUG + text = "Ecere Explorer (Debug)"; +#else text = "Ecere Explorer"; +#endif background = activeBorder; borderStyle = sizable; hasMaximize = true; hasMinimize = true; hasClose = true; - //hasMenuBar = true; + hasMenuBar = true; //tabCycle = true; size = { 840, 480 }; minClientSize = { 600, 300 }; @@ -36,12 +40,13 @@ class ExplorerWindow : Window int searchSplit; ExplorerToolId lastViewId; +*/ menu = Menu { }; Menu fileMenu { menu, "File", f }; Menu windowMenu { menu, "Window", w }; - MenuItem newWindow + MenuItem itemNewWindow { windowMenu, "New Window", n; @@ -51,7 +56,6 @@ class ExplorerWindow : Window return true; } }; -*/ IconBag iconBag { @@ -82,6 +86,7 @@ class ExplorerWindow : Window ":view-icons.png", /* viewIcons */ ":view-cards.png", /* viewCards */ ":view-showcase-right.png", /* viewShowcase */ + ":panel-tree.png", /* viewTree */ ":view-custom.png", /* viewCustom */ "<:ecere>mimeTypes/image.png" /* previewPictures */ @@ -125,6 +130,11 @@ class ExplorerWindow : Window char * path = view.path; char * newPath = new char[strlen(path)]; StripLastDirectory(path, newPath); + if(!newPath[0]) + { + newPath[0] = '/'; + newPath[1] = 0; + } view.path = newPath; delete newPath; break; @@ -156,6 +166,12 @@ class ExplorerWindow : Window case viewCards: case viewShowcase: //SwitchViews(toolId); + view.treeBranches = false; + view.Refresh(); + break; + case viewTree: + view.treeBranches = button.checked; + view.Refresh(); break; } } @@ -207,6 +223,7 @@ class ExplorerWindow : Window OptionToolButton viewIcons { toolBar, this, id = ExplorerToolId::viewIcons, selected = &selectedView }; OptionToolButton viewTiles { toolBar, this, id = ExplorerToolId::viewCards, selected = &selectedView }; OptionToolButton viewShowcase { toolBar, this, id = ExplorerToolId::viewShowcase, selected = &selectedView }; + OptionToolButton viewTree { toolBar, this, id = ExplorerToolId::viewTree, selected = &selectedView }; selectedView = viewList; Window s9 { toolBar, size = { w = 8 } }; ToggleToolButton previewPictures { toolBar, this, id = ExplorerToolId::previewPictures }; @@ -252,8 +269,8 @@ class ExplorerWindow : Window panels, this; };*/ - /*Tree*/FileSystemBox tree - { + /*Tree*/FileSystemBox tree; + /*{ panels, this; size = { w = 240 }; anchor.top = 0; @@ -263,7 +280,7 @@ class ExplorerWindow : Window foldersOnly = true; borderStyle = none; visible = false; - }; + };*/ FileSystemBox view { @@ -274,6 +291,20 @@ class ExplorerWindow : Window locationBox = addressBar; navigateFolders = true; borderStyle = none; + + multiSelect = true; + + bool NotifyNodeOpen(FileSystemBox box, FileSystemNode node) + { + if(node.type.isFile) + { + char command[MAX_LOCATION]; + char * t = node.path; + sprintf(command, "ide %s", node.path); + ShellOpen(command); + } + return true; + } }; /*ExplorerSearch search