8 newWindow, goBack, goForward, goUp, goHome,
10 panelTree, panelSearch,
13 viewList, viewDetails, viewIcons, viewCards, viewShowcase, 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 ":view-custom.png", /* viewCustom */
87 "<:ecere>mimeTypes/image.png" /* previewPictures */
96 background = activeBorder;
99 anchor = { left = 0, top = 0, right = 0, bottom = 0 };
103 ToolBar/*<ExplorerToolId>*/ toolBar
110 void NotifyToolClick(ToolButton button)
112 ExplorerToolId id = (ExplorerToolId)button.id;
118 ExplorerWindow { }.Create();
125 char * path = view.path;
126 char * newPath = new char[strlen(path)];
127 StripLastDirectory(path, newPath);
133 // TODO TOFIX : need to fix Stacker for this to work
134 tree.visible = button.checked;
135 //search.visible = !button.checked;
136 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
139 // TODO TOFIX : need to fix Stacker for this to work
140 //search.visible = button.checked;
141 tree.visible = !button.checked;
142 panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
149 case previewPictures:
150 view.previewPictures = button.checked;
158 //SwitchViews(toolId);
164 Window s1 { toolBar, size = { w = 8 } };
165 ToolButton goBack { toolBar, this, id = ExplorerToolId::goBack };
166 Window s2 { toolBar, size = { w = 2 } };
167 ToolButton goForward { toolBar, this, id = ExplorerToolId::goForward };
168 Window s3 { toolBar, size = { w = 2 } };
169 ToolButton refresh { toolBar, this, id = ExplorerToolId::refresh };
170 Window s4 { toolBar, size = { w = 2 } };
171 ToolButton goHome { toolBar, this, id = ExplorerToolId::goHome };
172 Window s5 { toolBar, size = { w = 8 } };
176 size = { 300, 23 }, id = ExplorerToolId::addressBar;
177 typeExpected = directory;
179 bool OnKeyDown(Key key, unichar ch)
181 if((SmartKey)key == enter)
183 // how to make enter effect a modification
184 // how to implement in PathBox
189 bool NotifyModified(PathBox pathBox)
191 view.path = pathBox.path;
195 FlipStacker { toolBar, spring = previous };
196 Window s6 { toolBar, size = { w = 8 } };
197 ToolButton goUp { toolBar, this, id = ExplorerToolId::goUp };
198 Window s7 { toolBar, size = { w = 8 } };
199 GroupToggleToolButton selectedPanel;
200 GroupToggleToolButton panelTree { toolBar, this, id = ExplorerToolId::panelTree, selected = &selectedPanel, checked = true };
201 GroupToggleToolButton panelSearch { toolBar, this, id = ExplorerToolId::panelSearch, selected = &selectedPanel };
202 selectedPanel = panelTree;
203 Window s8 { toolBar, size = { w = 8 } };
204 OptionToolButton selectedView;
205 OptionToolButton viewList { toolBar, this, id = ExplorerToolId::viewList, selected = &selectedView, checked = true };
206 OptionToolButton viewDetails { toolBar, this, id = ExplorerToolId::viewDetails, selected = &selectedView };
207 OptionToolButton viewIcons { toolBar, this, id = ExplorerToolId::viewIcons, selected = &selectedView };
208 OptionToolButton viewTiles { toolBar, this, id = ExplorerToolId::viewCards, selected = &selectedView };
209 OptionToolButton viewShowcase { toolBar, this, id = ExplorerToolId::viewShowcase, selected = &selectedView };
210 selectedView = viewList;
211 Window s9 { toolBar, size = { w = 8 } };
212 ToggleToolButton previewPictures { toolBar, this, id = ExplorerToolId::previewPictures };
214 Window s10 { toolBar, size = { w = 8 } };
215 ToolButton newWindow { toolBar, this, id = ExplorerToolId::newWindow };
216 Window s11 { toolBar, size = { w = 8 } };
220 iconBag.window = null;
224 bool OnLoadGraphics()
230 void OnUnloadGraphics()
239 direction = horizontal;
240 background = yellow;//activeBorder;
248 //FlipStacker flipStack { stack, spring = previous };
250 /*SearchPanel searchPanel
255 /*Tree*/FileSystemBox tree;
261 navigateFolders = true;
274 locationBox = addressBar;
275 navigateFolders = true;
279 /*ExplorerSearch search
284 size = Size { 624, 268 };
285 anchor = Anchor { left = 0, top = 0, bottom = 0 };
288 ExplorerViewSearch results;*/
292 parent = deep, master = this;
294 anchor = Anchor { top = 0, bottom = 0, right = 0 };
300 leftPane = tree, rightPane = viewHolder;
304 // Preview / Showcase
305 /*PreviewArea previewArea
310 //FlipStacker flipPanels { panels, spring = previous };
312 /*bool TreeNotifyBranchSelect(ExplorerTree tree, ExplorerFileBranch branch)
316 char path[MAX_LOCATION];
317 branch.GetPath(path);
318 toolBar.addressBar.contents = path;
324 /*bool ViewNotifyItemOpen(ExplorerView view, ExplorerFileItem item)
326 ExplorerFileBranch branch = tree.branch;
329 if(item.type.isFolderType)
331 ExplorerFileBranch child;
333 if(!branch.loaded || !branch.childrenLoaded)
334 BranchLoad(branch, tree.tree);
336 for(child = branch.children.first; child; child = child.next)
337 if(!strcmp(child.name, item.name))
342 if(branch.row.collapsed)
343 child.row.collapsed = true;
344 child.EnsureVisible(false);
350 char path[MAX_LOCATION];
351 branch.GetPath(path);
352 PathCat(path, item.name);
358 /*void SwitchViews(ExplorerToolId viewId)
360 ExplorerFileBranch branch = tree.branch;
364 case viewList: view = ExplorerViewList { parent = viewHolder, master = this }; break;
365 case viewDetails: view = ExplorerViewDetails { parent = viewHolder, master = this }; break;
366 case viewIcons: view = ExplorerViewIcons { parent = viewHolder, master = this }; break;
367 case viewCards: view = ExplorerViewCards { parent = viewHolder, master = this }; break;
368 case viewShowcase: view = ExplorerViewShowcase { parent = viewHolder, master = this }; break;
370 view.tabCycle = true;
371 view.previewPictures = toolBar.previewPictures.checked;
372 view.anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
373 view.NotifyItemOpen = ViewNotifyItemOpen;
379 /*void GoToLocation(char * location)
383 char step[MAX_LOCATION];
385 StringArray steps { growingFactor = 4 };
386 ExplorerFileBranch last = null;
388 temp = CopyString(location);
391 GetLastDirectory(temp, step);
392 StripLastDirectory(temp, temp);
393 steps.Add(CopyString(step));
396 for(c = steps._count - 1; c >= 0; c--)
398 last = tree.Find(steps._[c], last);
408 /*void SearchLocation(char * location)
410 GoToLocation(location);
411 search.location.editBox.contents = location;
417 addressBar.path = view.path;
428 view = ExplorerViewList
430 parent = viewHolder, master = this;
432 previewPictures = toolBar.previewPictures.checked;
433 anchor = Anchor { left = 0, top = 0, bottom = 0, right = 0 };
434 NotifyItemOpen = ViewNotifyItemOpen;
436 lastViewId = viewList;
439 view.Load(tree.root);
451 //class TreeFileSystemBox : FileSystemBox { }