8 newWindow, goBack, goForward, goUp, goHome,
10 panelTree, panelSearch,
13 viewList, viewDetails, viewIcons, viewCards, viewShowcase, viewTree, viewCustom,
17 class ExplorerWindow : Window
20 text = "Ecere Explorer (Debug)";
22 text = "Ecere Explorer";
24 background = activeBorder;
25 borderStyle = sizable;
32 minClientSize = { 600, 300 };
33 nativeDecorations = true;
42 ExplorerToolId lastViewId;
47 Menu fileMenu { menu, "File", f };
48 Menu windowMenu { menu, "Window", w };
49 MenuItem itemNewWindow
51 windowMenu, "New Window", n;
53 bool NotifySelect(MenuItem selection, Modifiers mods)
55 ExplorerWindow { }.Create();
60 IconBag<ExplorerToolId> iconBag
62 //window = guiApp.desktop;
67 "<:ecere>emblems/unreadable.png", /* none */
69 "<:ecere>actions/windowNew.png", /* newWindow */
70 "<:ecere>actions/goPrevious.png", /* goBack */
71 "<:ecere>actions/goNext.png", /* goForward */
72 "<:ecere>actions/goUp.png", /* goUp */
73 "<:ecere>actions/goHome.png", /* goHome */
75 ":browse.png", /* browse */
77 ":panel-tree.png", /* panelTree */
78 "<:ecere>actions/editFind.png", /* panelSearch */
80 "<:ecere>emblems/unreadable.png", /* addressBar */
82 "<:ecere>actions/viewRefresh.png", /* refresh */
84 ":view-list.png", /* viewList */
85 ":view-details.png", /* viewDetails */
86 ":view-icons.png", /* viewIcons */
87 ":view-cards.png", /* viewCards */
88 ":view-showcase-right.png", /* viewShowcase */
89 ":panel-tree.png", /* viewTree */
90 ":view-custom.png", /* viewCustom */
92 "<:ecere>mimeTypes/image.png" /* previewPictures */
100 direction = vertical;
101 background = activeBorder;
104 anchor = { left = 0, top = 0, right = 0, bottom = 0 };
108 ToolBar/*<ExplorerToolId>*/ toolBar
115 void NotifyToolClick(ToolButton button)
117 ExplorerToolId id = (ExplorerToolId)button.id;
123 ExplorerWindow { }.Create();
130 char * home = getenv("HOME");
131 if(home && home[0] && FileExists(home).isDirectory)
137 char * path = view.path;
138 char * newPath = new char[strlen(path)];
139 StripLastDirectory(path, newPath);
150 // TODO TOFIX : need to fix Stacker for this to work
151 tree.visible = button.checked;
152 //search.visible = !button.checked;
153 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
156 // TODO TOFIX : need to fix Stacker for this to work
157 //search.visible = button.checked;
158 tree.visible = !button.checked;
159 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
166 case previewPictures:
167 view.previewPictures = button.checked;
175 //SwitchViews(toolId);
176 view.treeBranches = false;
180 view.treeBranches = button.checked;
187 Window s1 { toolBar, size = { w = 8 } };
188 ToolButton goBack { toolBar, this, id = ExplorerToolId::goBack };
189 Window s2 { toolBar, size = { w = 2 } };
190 ToolButton goForward { toolBar, this, id = ExplorerToolId::goForward };
191 Window s3 { toolBar, size = { w = 2 } };
192 ToolButton refresh { toolBar, this, id = ExplorerToolId::refresh };
193 Window s4 { toolBar, size = { w = 2 } };
194 ToolButton goHome { toolBar, this, id = ExplorerToolId::goHome };
195 Window s5 { toolBar, size = { w = 8 } };
199 size = { 300, 23 }, id = ExplorerToolId::addressBar;
200 typeExpected = directory;
202 bool OnKeyDown(Key key, unichar ch)
204 if((SmartKey)key == enter)
206 // how to make enter effect a modification
207 // how to implement in PathBox
212 bool NotifyModified(PathBox pathBox)
214 view.path = pathBox.path;
218 FlipStacker { toolBar, spring = previous };
219 Window s6 { toolBar, size = { w = 8 } };
220 ToolButton goUp { toolBar, this, id = ExplorerToolId::goUp };
221 Window s7 { toolBar, size = { w = 8 } };
222 GroupToggleToolButton selectedPanel;
223 GroupToggleToolButton panelTree { toolBar, this, id = ExplorerToolId::panelTree, selected = &selectedPanel, checked = true };
224 GroupToggleToolButton panelSearch { toolBar, this, id = ExplorerToolId::panelSearch, selected = &selectedPanel };
225 selectedPanel = panelTree;
226 Window s8 { toolBar, size = { w = 8 } };
227 OptionToolButton selectedView;
228 OptionToolButton viewList { toolBar, this, id = ExplorerToolId::viewList, selected = &selectedView, checked = true };
229 OptionToolButton viewDetails { toolBar, this, id = ExplorerToolId::viewDetails, selected = &selectedView };
230 OptionToolButton viewIcons { toolBar, this, id = ExplorerToolId::viewIcons, selected = &selectedView };
231 OptionToolButton viewTiles { toolBar, this, id = ExplorerToolId::viewCards, selected = &selectedView };
232 OptionToolButton viewShowcase { toolBar, this, id = ExplorerToolId::viewShowcase, selected = &selectedView };
233 OptionToolButton viewTree { toolBar, this, id = ExplorerToolId::viewTree, selected = &selectedView };
234 selectedView = viewList;
235 Window s9 { toolBar, size = { w = 8 } };
236 ToggleToolButton previewPictures { toolBar, this, id = ExplorerToolId::previewPictures };
238 Window s10 { toolBar, size = { w = 8 } };
239 ToolButton newWindow { toolBar, this, id = ExplorerToolId::newWindow };
240 Window s11 { toolBar, size = { w = 8 } };
244 iconBag.window = null;
248 bool OnLoadGraphics()
254 void OnUnloadGraphics()
263 direction = horizontal;
264 background = yellow;//activeBorder;
272 //FlipStacker flipStack { stack, spring = previous };
274 /*SearchPanel searchPanel
279 /*Tree*/FileSystemBox tree;
285 navigateFolders = true;
298 locationBox = addressBar;
299 navigateFolders = true;
304 bool NotifyNodeOpen(FileSystemBox box, FileSystemNode node)
309 char command[MAX_LOCATION];
310 /*_FileType t = node.type;
311 if(t == ewsFile || t == epjFile ||
312 t == ecFile || t == ehFile ||
313 t == cppFile || t == hppFile ||
314 t == cFile || t == hFile ||
315 t == textFile || t == webFile)*/
316 sprintf(command, "ide %s", node.path);
318 sprintf(command, "%s", node.path);*/
321 ShellOpen(node.path);
328 /*ExplorerSearch search
333 size = Size { 624, 268 };
334 anchor = Anchor { left = 0, top = 0, bottom = 0 };
337 ExplorerViewSearch results;*/
341 parent = deep, master = this;
343 anchor = Anchor { top = 0, bottom = 0, right = 0 };
349 leftPane = tree, rightPane = viewHolder;
353 // Preview / Showcase
354 /*PreviewArea previewArea
359 //FlipStacker flipPanels { panels, spring = previous };
361 /*bool TreeNotifyBranchSelect(ExplorerTree tree, ExplorerFileBranch branch)
365 char path[MAX_LOCATION];
366 branch.GetPath(path);
367 toolBar.addressBar.contents = path;
373 /*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
375 ExplorerFileBranch branch = tree.branch;
378 if(item.type.isFolderType)
380 ExplorerFileBranch child;
382 if(!branch.loaded || !branch.childrenLoaded)
383 BranchLoad(branch, tree.tree);
385 for(child = branch.children.first; child; child = child.next)
386 if(!strcmp(child.name, item.name))
391 if(branch.row.collapsed)
392 child.row.collapsed = true;
393 child.EnsureVisible(false);
399 char path[MAX_LOCATION];
400 branch.GetPath(path);
401 PathCat(path, item.name);
407 /*void SwitchViews(ExplorerToolId viewId)
409 ExplorerFileBranch branch = tree.branch;
413 case viewList: view = ExplorerViewList { parent = viewHolder, master = this }; break;
414 case viewDetails: view = ExplorerViewDetails { parent = viewHolder, master = this }; break;
415 case viewIcons: view = ExplorerViewIcons { parent = viewHolder, master = this }; break;
416 case viewCards: view = ExplorerViewCards { parent = viewHolder, master = this }; break;
417 case viewShowcase: view = ExplorerViewShowcase { parent = viewHolder, master = this }; break;
419 view.tabCycle = true;
420 view.previewPictures = toolBar.previewPictures.checked;
421 view.anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
422 view.NotifyItemOpen = ViewNotifyItemOpen;
428 /*void GoToLocation(char * location)
432 char step[MAX_LOCATION];
434 StringArray steps { growingFactor = 4 };
435 ExplorerFileBranch last = null;
437 temp = CopyString(location);
440 GetLastDirectory(temp, step);
441 StripLastDirectory(temp, temp);
442 steps.Add(CopyString(step));
445 for(c = steps._count - 1; c >= 0; c--)
447 last = tree.Find(steps._[c], last);
457 /*void SearchLocation(char * location)
459 GoToLocation(location);
460 search.location.editBox.contents = location;
466 addressBar.path = view.path;
477 view = ExplorerViewList
479 parent = viewHolder, master = this;
481 previewPictures = toolBar.previewPictures.checked;
482 anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
483 NotifyItemOpen = ViewNotifyItemOpen;
485 lastViewId = viewList;
488 view.Load(tree.root);
500 //class TreeFileSystemBox : FileSystemBox { }