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 * path = view.path;
131 char * newPath = new char[strlen(path)];
132 StripLastDirectory(path, newPath);
143 // TODO TOFIX : need to fix Stacker for this to work
144 tree.visible = button.checked;
145 //search.visible = !button.checked;
146 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
149 // TODO TOFIX : need to fix Stacker for this to work
150 //search.visible = button.checked;
151 tree.visible = !button.checked;
152 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
159 case previewPictures:
160 view.previewPictures = button.checked;
168 //SwitchViews(toolId);
169 view.treeBranches = false;
173 view.treeBranches = button.checked;
180 Window s1 { toolBar, size = { w = 8 } };
181 ToolButton goBack { toolBar, this, id = ExplorerToolId::goBack };
182 Window s2 { toolBar, size = { w = 2 } };
183 ToolButton goForward { toolBar, this, id = ExplorerToolId::goForward };
184 Window s3 { toolBar, size = { w = 2 } };
185 ToolButton refresh { toolBar, this, id = ExplorerToolId::refresh };
186 Window s4 { toolBar, size = { w = 2 } };
187 ToolButton goHome { toolBar, this, id = ExplorerToolId::goHome };
188 Window s5 { toolBar, size = { w = 8 } };
192 size = { 300, 23 }, id = ExplorerToolId::addressBar;
193 typeExpected = directory;
195 bool OnKeyDown(Key key, unichar ch)
197 if((SmartKey)key == enter)
199 // how to make enter effect a modification
200 // how to implement in PathBox
205 bool NotifyModified(PathBox pathBox)
207 view.path = pathBox.path;
211 FlipStacker { toolBar, spring = previous };
212 Window s6 { toolBar, size = { w = 8 } };
213 ToolButton goUp { toolBar, this, id = ExplorerToolId::goUp };
214 Window s7 { toolBar, size = { w = 8 } };
215 GroupToggleToolButton selectedPanel;
216 GroupToggleToolButton panelTree { toolBar, this, id = ExplorerToolId::panelTree, selected = &selectedPanel, checked = true };
217 GroupToggleToolButton panelSearch { toolBar, this, id = ExplorerToolId::panelSearch, selected = &selectedPanel };
218 selectedPanel = panelTree;
219 Window s8 { toolBar, size = { w = 8 } };
220 OptionToolButton selectedView;
221 OptionToolButton viewList { toolBar, this, id = ExplorerToolId::viewList, selected = &selectedView, checked = true };
222 OptionToolButton viewDetails { toolBar, this, id = ExplorerToolId::viewDetails, selected = &selectedView };
223 OptionToolButton viewIcons { toolBar, this, id = ExplorerToolId::viewIcons, selected = &selectedView };
224 OptionToolButton viewTiles { toolBar, this, id = ExplorerToolId::viewCards, selected = &selectedView };
225 OptionToolButton viewShowcase { toolBar, this, id = ExplorerToolId::viewShowcase, selected = &selectedView };
226 OptionToolButton viewTree { toolBar, this, id = ExplorerToolId::viewTree, selected = &selectedView };
227 selectedView = viewList;
228 Window s9 { toolBar, size = { w = 8 } };
229 ToggleToolButton previewPictures { toolBar, this, id = ExplorerToolId::previewPictures };
231 Window s10 { toolBar, size = { w = 8 } };
232 ToolButton newWindow { toolBar, this, id = ExplorerToolId::newWindow };
233 Window s11 { toolBar, size = { w = 8 } };
237 iconBag.window = null;
241 bool OnLoadGraphics()
247 void OnUnloadGraphics()
256 direction = horizontal;
257 background = yellow;//activeBorder;
265 //FlipStacker flipStack { stack, spring = previous };
267 /*SearchPanel searchPanel
272 /*Tree*/FileSystemBox tree;
278 navigateFolders = true;
291 locationBox = addressBar;
292 navigateFolders = true;
297 bool NotifyNodeOpen(FileSystemBox box, FileSystemNode node)
301 char command[MAX_LOCATION];
302 char * t = node.path;
303 sprintf(command, "ide %s", node.path);
310 /*ExplorerSearch search
315 size = Size { 624, 268 };
316 anchor = Anchor { left = 0, top = 0, bottom = 0 };
319 ExplorerViewSearch results;*/
323 parent = deep, master = this;
325 anchor = Anchor { top = 0, bottom = 0, right = 0 };
331 leftPane = tree, rightPane = viewHolder;
335 // Preview / Showcase
336 /*PreviewArea previewArea
341 //FlipStacker flipPanels { panels, spring = previous };
343 /*bool TreeNotifyBranchSelect(ExplorerTree tree, ExplorerFileBranch branch)
347 char path[MAX_LOCATION];
348 branch.GetPath(path);
349 toolBar.addressBar.contents = path;
355 /*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
357 ExplorerFileBranch branch = tree.branch;
360 if(item.type.isFolderType)
362 ExplorerFileBranch child;
364 if(!branch.loaded || !branch.childrenLoaded)
365 BranchLoad(branch, tree.tree);
367 for(child = branch.children.first; child; child = child.next)
368 if(!strcmp(child.name, item.name))
373 if(branch.row.collapsed)
374 child.row.collapsed = true;
375 child.EnsureVisible(false);
381 char path[MAX_LOCATION];
382 branch.GetPath(path);
383 PathCat(path, item.name);
389 /*void SwitchViews(ExplorerToolId viewId)
391 ExplorerFileBranch branch = tree.branch;
395 case viewList: view = ExplorerViewList { parent = viewHolder, master = this }; break;
396 case viewDetails: view = ExplorerViewDetails { parent = viewHolder, master = this }; break;
397 case viewIcons: view = ExplorerViewIcons { parent = viewHolder, master = this }; break;
398 case viewCards: view = ExplorerViewCards { parent = viewHolder, master = this }; break;
399 case viewShowcase: view = ExplorerViewShowcase { parent = viewHolder, master = this }; break;
401 view.tabCycle = true;
402 view.previewPictures = toolBar.previewPictures.checked;
403 view.anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
404 view.NotifyItemOpen = ViewNotifyItemOpen;
410 /*void GoToLocation(char * location)
414 char step[MAX_LOCATION];
416 StringArray steps { growingFactor = 4 };
417 ExplorerFileBranch last = null;
419 temp = CopyString(location);
422 GetLastDirectory(temp, step);
423 StripLastDirectory(temp, temp);
424 steps.Add(CopyString(step));
427 for(c = steps._count - 1; c >= 0; c--)
429 last = tree.Find(steps._[c], last);
439 /*void SearchLocation(char * location)
441 GoToLocation(location);
442 search.location.editBox.contents = location;
448 addressBar.path = view.path;
459 view = ExplorerViewList
461 parent = viewHolder, master = this;
463 previewPictures = toolBar.previewPictures.checked;
464 anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
465 NotifyItemOpen = ViewNotifyItemOpen;
467 lastViewId = viewList;
470 view.Load(tree.root);
482 //class TreeFileSystemBox : FileSystemBox { }