+ //window = guiApp.desktop;
+ window = this;
+ alphaBlend = true;
+ iconNames =
+ [
+ "<:ecere>emblems/unreadable.png", /* none */
+
+ "<:ecere>actions/windowNew.png", /* newWindow */
+ "<:ecere>actions/goPrevious.png", /* goBack */
+ "<:ecere>actions/goNext.png", /* goForward */
+ "<:ecere>actions/goUp.png", /* goUp */
+ "<:ecere>actions/goHome.png", /* goHome */
+
+ ":browse.png", /* browse */
+
+ ":panel-tree.png", /* panelTree */
+ "<:ecere>actions/editFind.png", /* panelSearch */
+
+ "<:ecere>emblems/unreadable.png", /* addressBar */
+
+ "<:ecere>actions/viewRefresh.png", /* refresh */
+
+ ":view-list.png", /* viewList */
+ ":view-details.png", /* viewDetails */
+ ":view-icons.png", /* viewIcons */
+ ":view-cards.png", /* viewCards */
+ ":view-showcase-right.png", /* viewShowcase */
+ ":panel-tree.png", /* viewTree */
+ ":view-custom.png", /* viewCustom */
+
+ "<:ecere>mimeTypes/image.png" /* previewPictures */
+ ];
+ };
+
+ Stacker stack
+ {
+ this;
+ gap = 0;
+ direction = vertical;
+ background = activeBorder;
+ //opacity = 1.0f;
+
+ anchor = { left = 0, top = 0, right = 0, bottom = 0 };
+ //moveable = false;
+ };
+
+ ToolBar/*<ExplorerToolId>*/ toolBar
+ {
+ stack, this;
+ iconBag = iconBag;
+ size = { h = 32 };
+ //moveable = false;
+
+ void NotifyToolClick(ToolButton button)
+ {
+ ExplorerToolId id = (ExplorerToolId)button.id;
+ switch(id)
+ {
+ case none:
+ break;
+ case newWindow:
+ ExplorerWindow { }.Create();
+ break;
+ case goBack:
+ case goForward:
+ break;
+ case goHome:
+ {
+ char * home = getenv("HOME");
+ if(home && home[0] && FileExists(home).isDirectory)
+ GoToLocation(home, false, false);
+ break;
+ }
+ case goUp:
+ {
+ char * path = view.path;
+ char * newPath = new char[strlen(path)+1];
+ StripLastDirectory(path, newPath);
+ if(!newPath[0])
+ {
+ newPath[0] = '/';
+ newPath[1] = 0;
+ }
+ GoToLocation(newPath, false, false);
+ delete newPath;
+ break;
+ }
+ case panelTree:
+ // TODO TOFIX : need to fix Stacker for this to work
+ tree.visible = button.checked;
+ split.visible = button.checked;
+ if(button.checked)
+ {
+ split.rightPane = view;
+ view.anchor = { top = 0, bottom = 0, right = 0 };
+ tree.SelectLocation(view.path);
+ }
+ else
+ {
+ split.rightPane = null;
+ view.anchor = { left = 0, top = 0, bottom = 0, right = 0 };
+ }
+ //search.visible = !button.checked;
+ panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
+ break;
+ case panelSearch:
+ // TODO TOFIX : need to fix Stacker for this to work
+ //search.visible = button.checked;
+ tree.visible = false; //!button.checked;
+ split.visible = false; //!button.checked;
+ if(false/*button.checked*/)
+ {
+ split.rightPane = view;
+ view.anchor = { top = 0, bottom = 0, right = 0 };
+ }
+ else
+ {
+ split.rightPane = null;
+ view.anchor = { left = 0, top = 0, bottom = 0, right = 0 };
+ }
+ panels.size = { panels.size.w, panels.size.h }; // TOFIX : another Stacker fix needed
+ break;
+ case refresh:
+ if(tree.visible)
+ tree.Refresh();
+ view.Refresh();
+ break;
+ case previewPictures:
+ view.previewPictures = button.checked;
+ view.Refresh();
+ break;
+ case viewList:
+ case viewDetails:
+ case viewIcons:
+ case viewCards:
+ case viewShowcase:
+ //SwitchViews(toolId);
+ view.treeBranches = false;
+ view.Refresh();
+ break;
+ case viewTree:
+ view.treeBranches = button.checked;
+ view.Refresh();
+ break;
+ }
+ }
+ };
+
+ Window s1 { toolBar, size = { w = 8 } };
+ ToolButton goBack { toolBar, this, id = ExplorerToolId::goBack };
+ Window s2 { toolBar, size = { w = 2 } };
+ ToolButton goForward { toolBar, this, id = ExplorerToolId::goForward };
+ Window s3 { toolBar, size = { w = 2 } };
+ ToolButton refresh { toolBar, this, id = ExplorerToolId::refresh };
+ Window s4 { toolBar, size = { w = 2 } };
+ ToolButton goHome { toolBar, this, id = ExplorerToolId::goHome };
+ Window s5 { toolBar, size = { w = 8 } };
+ PathBox addressBar
+ {
+ toolBar, this;
+ size = { 300, 23 }, id = ExplorerToolId::addressBar;
+ typeExpected = directory;
+
+ bool OnKeyDown(Key key, unichar ch)
+ {
+ if((SmartKey)key == enter)
+ {
+ // how to make enter effect a modification
+ // how to implement in PathBox
+ }
+ return true;
+ }
+
+ bool NotifyModified(PathBox pathBox)