8 newWindow, goBack, goForward, goUp, goHome,
10 panelTree, panelSearch,
13 viewList, viewDetails, viewIcons, viewCards, viewShowcase, viewTree, viewCustom,
17 class ExplorerWindow : Window
19 text = "Ecere Explorer";
20 background = activeBorder;
21 borderStyle = sizable;
28 minClientSize = { 600, 300 };
29 nativeDecorations = true;
38 ExplorerToolId lastViewId;
43 Menu fileMenu { menu, "File", f };
44 Menu windowMenu { menu, "Window", w };
45 MenuItem itemNewWindow
47 windowMenu, "New Window", n;
49 bool NotifySelect(MenuItem selection, Modifiers mods)
51 ExplorerWindow { }.Create();
56 IconBag<ExplorerToolId> iconBag
58 //window = guiApp.desktop;
63 "<:ecere>emblems/unreadable.png", /* none */
65 "<:ecere>actions/windowNew.png", /* newWindow */
66 "<:ecere>actions/goPrevious.png", /* goBack */
67 "<:ecere>actions/goNext.png", /* goForward */
68 "<:ecere>actions/goUp.png", /* goUp */
69 "<:ecere>actions/goHome.png", /* goHome */
71 ":browse.png", /* browse */
73 ":panel-tree.png", /* panelTree */
74 "<:ecere>actions/editFind.png", /* panelSearch */
76 "<:ecere>emblems/unreadable.png", /* addressBar */
78 "<:ecere>actions/viewRefresh.png", /* refresh */
80 ":view-list.png", /* viewList */
81 ":view-details.png", /* viewDetails */
82 ":view-icons.png", /* viewIcons */
83 ":view-cards.png", /* viewCards */
84 ":view-showcase-right.png", /* viewShowcase */
85 ":panel-tree.png", /* viewTree */
86 ":view-custom.png", /* viewCustom */
88 "<:ecere>mimeTypes/image.png" /* previewPictures */
97 background = activeBorder;
100 anchor = { left = 0, top = 0, right = 0, bottom = 0 };
104 ToolBar/*<ExplorerToolId>*/ toolBar
111 void NotifyToolClick(ToolButton button)
113 ExplorerToolId id = (ExplorerToolId)button.id;
119 ExplorerWindow { }.Create();
126 char * path = view.path;
127 char * newPath = new char[strlen(path)];
128 StripLastDirectory(path, newPath);
139 // TODO TOFIX : need to fix Stacker for this to work
140 tree.visible = button.checked;
141 //search.visible = !button.checked;
142 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
145 // TODO TOFIX : need to fix Stacker for this to work
146 //search.visible = button.checked;
147 tree.visible = !button.checked;
148 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
155 case previewPictures:
156 view.previewPictures = button.checked;
164 //SwitchViews(toolId);
165 view.treeBranches = false;
169 view.treeBranches = button.checked;
176 Window s1 { toolBar, size = { w = 8 } };
177 ToolButton goBack { toolBar, this, id = ExplorerToolId::goBack };
178 Window s2 { toolBar, size = { w = 2 } };
179 ToolButton goForward { toolBar, this, id = ExplorerToolId::goForward };
180 Window s3 { toolBar, size = { w = 2 } };
181 ToolButton refresh { toolBar, this, id = ExplorerToolId::refresh };
182 Window s4 { toolBar, size = { w = 2 } };
183 ToolButton goHome { toolBar, this, id = ExplorerToolId::goHome };
184 Window s5 { toolBar, size = { w = 8 } };
188 size = { 300, 23 }, id = ExplorerToolId::addressBar;
189 typeExpected = directory;
191 bool OnKeyDown(Key key, unichar ch)
193 if((SmartKey)key == enter)
195 // how to make enter effect a modification
196 // how to implement in PathBox
201 bool NotifyModified(PathBox pathBox)
203 view.path = pathBox.path;
207 FlipStacker { toolBar, spring = previous };
208 Window s6 { toolBar, size = { w = 8 } };
209 ToolButton goUp { toolBar, this, id = ExplorerToolId::goUp };
210 Window s7 { toolBar, size = { w = 8 } };
211 GroupToggleToolButton selectedPanel;
212 GroupToggleToolButton panelTree { toolBar, this, id = ExplorerToolId::panelTree, selected = &selectedPanel, checked = true };
213 GroupToggleToolButton panelSearch { toolBar, this, id = ExplorerToolId::panelSearch, selected = &selectedPanel };
214 selectedPanel = panelTree;
215 Window s8 { toolBar, size = { w = 8 } };
216 OptionToolButton selectedView;
217 OptionToolButton viewList { toolBar, this, id = ExplorerToolId::viewList, selected = &selectedView, checked = true };
218 OptionToolButton viewDetails { toolBar, this, id = ExplorerToolId::viewDetails, selected = &selectedView };
219 OptionToolButton viewIcons { toolBar, this, id = ExplorerToolId::viewIcons, selected = &selectedView };
220 OptionToolButton viewTiles { toolBar, this, id = ExplorerToolId::viewCards, selected = &selectedView };
221 OptionToolButton viewShowcase { toolBar, this, id = ExplorerToolId::viewShowcase, selected = &selectedView };
222 OptionToolButton viewTree { toolBar, this, id = ExplorerToolId::viewTree, selected = &selectedView };
223 selectedView = viewList;
224 Window s9 { toolBar, size = { w = 8 } };
225 ToggleToolButton previewPictures { toolBar, this, id = ExplorerToolId::previewPictures };
227 Window s10 { toolBar, size = { w = 8 } };
228 ToolButton newWindow { toolBar, this, id = ExplorerToolId::newWindow };
229 Window s11 { toolBar, size = { w = 8 } };
233 iconBag.window = null;
237 bool OnLoadGraphics()
243 void OnUnloadGraphics()
252 direction = horizontal;
253 background = yellow;//activeBorder;
261 //FlipStacker flipStack { stack, spring = previous };
263 /*SearchPanel searchPanel
268 /*Tree*/FileSystemBox tree;
274 navigateFolders = true;
287 locationBox = addressBar;
288 navigateFolders = true;
293 bool NotifyNodeOpen(FileSystemBox box, FileSystemNode node)
297 char command[MAX_LOCATION];
298 char * t = node.path;
299 sprintf(command, "ide %s", node.path);
306 /*ExplorerSearch search
311 size = Size { 624, 268 };
312 anchor = Anchor { left = 0, top = 0, bottom = 0 };
315 ExplorerViewSearch results;*/
319 parent = deep, master = this;
321 anchor = Anchor { top = 0, bottom = 0, right = 0 };
327 leftPane = tree, rightPane = viewHolder;
331 // Preview / Showcase
332 /*PreviewArea previewArea
337 //FlipStacker flipPanels { panels, spring = previous };
339 /*bool TreeNotifyBranchSelect(ExplorerTree tree, ExplorerFileBranch branch)
343 char path[MAX_LOCATION];
344 branch.GetPath(path);
345 toolBar.addressBar.contents = path;
351 /*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
353 ExplorerFileBranch branch = tree.branch;
356 if(item.type.isFolderType)
358 ExplorerFileBranch child;
360 if(!branch.loaded || !branch.childrenLoaded)
361 BranchLoad(branch, tree.tree);
363 for(child = branch.children.first; child; child = child.next)
364 if(!strcmp(child.name, item.name))
369 if(branch.row.collapsed)
370 child.row.collapsed = true;
371 child.EnsureVisible(false);
377 char path[MAX_LOCATION];
378 branch.GetPath(path);
379 PathCat(path, item.name);
385 /*void SwitchViews(ExplorerToolId viewId)
387 ExplorerFileBranch branch = tree.branch;
391 case viewList: view = ExplorerViewList { parent = viewHolder, master = this }; break;
392 case viewDetails: view = ExplorerViewDetails { parent = viewHolder, master = this }; break;
393 case viewIcons: view = ExplorerViewIcons { parent = viewHolder, master = this }; break;
394 case viewCards: view = ExplorerViewCards { parent = viewHolder, master = this }; break;
395 case viewShowcase: view = ExplorerViewShowcase { parent = viewHolder, master = this }; break;
397 view.tabCycle = true;
398 view.previewPictures = toolBar.previewPictures.checked;
399 view.anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
400 view.NotifyItemOpen = ViewNotifyItemOpen;
406 /*void GoToLocation(char * location)
410 char step[MAX_LOCATION];
412 StringArray steps { growingFactor = 4 };
413 ExplorerFileBranch last = null;
415 temp = CopyString(location);
418 GetLastDirectory(temp, step);
419 StripLastDirectory(temp, temp);
420 steps.Add(CopyString(step));
423 for(c = steps._count - 1; c >= 0; c--)
425 last = tree.Find(steps._[c], last);
435 /*void SearchLocation(char * location)
437 GoToLocation(location);
438 search.location.editBox.contents = location;
444 addressBar.path = view.path;
455 view = ExplorerViewList
457 parent = viewHolder, master = this;
459 previewPictures = toolBar.previewPictures.checked;
460 anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
461 NotifyItemOpen = ViewNotifyItemOpen;
463 lastViewId = viewList;
466 view.Load(tree.root);
478 //class TreeFileSystemBox : FileSystemBox { }