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);
134 // TODO TOFIX : need to fix Stacker for this to work
135 tree.visible = button.checked;
136 //search.visible = !button.checked;
137 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
140 // TODO TOFIX : need to fix Stacker for this to work
141 //search.visible = button.checked;
142 tree.visible = !button.checked;
143 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
150 case previewPictures:
151 view.previewPictures = button.checked;
159 //SwitchViews(toolId);
160 view.treeBranches = false;
164 view.treeBranches = button.checked;
171 Window s1 { toolBar, size = { w = 8 } };
172 ToolButton goBack { toolBar, this, id = ExplorerToolId::goBack };
173 Window s2 { toolBar, size = { w = 2 } };
174 ToolButton goForward { toolBar, this, id = ExplorerToolId::goForward };
175 Window s3 { toolBar, size = { w = 2 } };
176 ToolButton refresh { toolBar, this, id = ExplorerToolId::refresh };
177 Window s4 { toolBar, size = { w = 2 } };
178 ToolButton goHome { toolBar, this, id = ExplorerToolId::goHome };
179 Window s5 { toolBar, size = { w = 8 } };
183 size = { 300, 23 }, id = ExplorerToolId::addressBar;
184 typeExpected = directory;
186 bool OnKeyDown(Key key, unichar ch)
188 if((SmartKey)key == enter)
190 // how to make enter effect a modification
191 // how to implement in PathBox
196 bool NotifyModified(PathBox pathBox)
198 view.path = pathBox.path;
202 FlipStacker { toolBar, spring = previous };
203 Window s6 { toolBar, size = { w = 8 } };
204 ToolButton goUp { toolBar, this, id = ExplorerToolId::goUp };
205 Window s7 { toolBar, size = { w = 8 } };
206 GroupToggleToolButton selectedPanel;
207 GroupToggleToolButton panelTree { toolBar, this, id = ExplorerToolId::panelTree, selected = &selectedPanel, checked = true };
208 GroupToggleToolButton panelSearch { toolBar, this, id = ExplorerToolId::panelSearch, selected = &selectedPanel };
209 selectedPanel = panelTree;
210 Window s8 { toolBar, size = { w = 8 } };
211 OptionToolButton selectedView;
212 OptionToolButton viewList { toolBar, this, id = ExplorerToolId::viewList, selected = &selectedView, checked = true };
213 OptionToolButton viewDetails { toolBar, this, id = ExplorerToolId::viewDetails, selected = &selectedView };
214 OptionToolButton viewIcons { toolBar, this, id = ExplorerToolId::viewIcons, selected = &selectedView };
215 OptionToolButton viewTiles { toolBar, this, id = ExplorerToolId::viewCards, selected = &selectedView };
216 OptionToolButton viewShowcase { toolBar, this, id = ExplorerToolId::viewShowcase, selected = &selectedView };
217 OptionToolButton viewTree { toolBar, this, id = ExplorerToolId::viewTree, selected = &selectedView };
218 selectedView = viewList;
219 Window s9 { toolBar, size = { w = 8 } };
220 ToggleToolButton previewPictures { toolBar, this, id = ExplorerToolId::previewPictures };
222 Window s10 { toolBar, size = { w = 8 } };
223 ToolButton newWindow { toolBar, this, id = ExplorerToolId::newWindow };
224 Window s11 { toolBar, size = { w = 8 } };
228 iconBag.window = null;
232 bool OnLoadGraphics()
238 void OnUnloadGraphics()
247 direction = horizontal;
248 background = yellow;//activeBorder;
256 //FlipStacker flipStack { stack, spring = previous };
258 /*SearchPanel searchPanel
263 /*Tree*/FileSystemBox tree;
269 navigateFolders = true;
282 locationBox = addressBar;
283 navigateFolders = true;
286 bool NotifyNodeOpen(FileSystemBox box, FileSystemNode node)
290 char command[MAX_LOCATION];
291 char * t = node.path;
292 sprintf(command, "ide %s", node.path);
299 /*ExplorerSearch search
304 size = Size { 624, 268 };
305 anchor = Anchor { left = 0, top = 0, bottom = 0 };
308 ExplorerViewSearch results;*/
312 parent = deep, master = this;
314 anchor = Anchor { top = 0, bottom = 0, right = 0 };
320 leftPane = tree, rightPane = viewHolder;
324 // Preview / Showcase
325 /*PreviewArea previewArea
330 //FlipStacker flipPanels { panels, spring = previous };
332 /*bool TreeNotifyBranchSelect(ExplorerTree tree, ExplorerFileBranch branch)
336 char path[MAX_LOCATION];
337 branch.GetPath(path);
338 toolBar.addressBar.contents = path;
344 /*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
346 ExplorerFileBranch branch = tree.branch;
349 if(item.type.isFolderType)
351 ExplorerFileBranch child;
353 if(!branch.loaded || !branch.childrenLoaded)
354 BranchLoad(branch, tree.tree);
356 for(child = branch.children.first; child; child = child.next)
357 if(!strcmp(child.name, item.name))
362 if(branch.row.collapsed)
363 child.row.collapsed = true;
364 child.EnsureVisible(false);
370 char path[MAX_LOCATION];
371 branch.GetPath(path);
372 PathCat(path, item.name);
378 /*void SwitchViews(ExplorerToolId viewId)
380 ExplorerFileBranch branch = tree.branch;
384 case viewList: view = ExplorerViewList { parent = viewHolder, master = this }; break;
385 case viewDetails: view = ExplorerViewDetails { parent = viewHolder, master = this }; break;
386 case viewIcons: view = ExplorerViewIcons { parent = viewHolder, master = this }; break;
387 case viewCards: view = ExplorerViewCards { parent = viewHolder, master = this }; break;
388 case viewShowcase: view = ExplorerViewShowcase { parent = viewHolder, master = this }; break;
390 view.tabCycle = true;
391 view.previewPictures = toolBar.previewPictures.checked;
392 view.anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
393 view.NotifyItemOpen = ViewNotifyItemOpen;
399 /*void GoToLocation(char * location)
403 char step[MAX_LOCATION];
405 StringArray steps { growingFactor = 4 };
406 ExplorerFileBranch last = null;
408 temp = CopyString(location);
411 GetLastDirectory(temp, step);
412 StripLastDirectory(temp, temp);
413 steps.Add(CopyString(step));
416 for(c = steps._count - 1; c >= 0; c--)
418 last = tree.Find(steps._[c], last);
428 /*void SearchLocation(char * location)
430 GoToLocation(location);
431 search.location.editBox.contents = location;
437 addressBar.path = view.path;
448 view = ExplorerViewList
450 parent = viewHolder, master = this;
452 previewPictures = toolBar.previewPictures.checked;
453 anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
454 NotifyItemOpen = ViewNotifyItemOpen;
456 lastViewId = viewList;
459 view.Load(tree.root);
471 //class TreeFileSystemBox : FileSystemBox { }