Author Topic: First Workspace  (Read 5737 times)

Thom Little

  • Community Member
  • Posts: 83
  • Hero Points: 2
First Workspace
« on: March 17, 2007, 03:55:57 PM »
I am new to SlickEdit Workspaces and Projects.  I have used SlickEdit for many years to manipulate HTML and ASP 3 folders for numerous websites.  I have always operated out of the Open pane of the main window.

I would like to setup the Project pane of the main window so there would be a tree of websites listed (I assume they would be Projects)

I could navigate among the websites using a menu like …

Workspace
   Project A
      File 1
      File 2
      File 3
   Project B
      File 1
      File 2
      File 3

The thing that is eluding me …

When Project A is made active I want File 2 to be loaded and displayed.

When Project B is made active I want it to hide File 2 and make Files 1 and 3 loaded and displayed.

When Project A is made active I want it to hide Files 1 and 3 and make File 2 loaded and displayed.

What do I have to do to achieve this?

... Thom

Tim Kemp

  • Senior Community Member
  • Posts: 546
  • Hero Points: 92
Re: First Workspace
« Reply #1 on: March 19, 2007, 11:56:31 AM »
The behaviour you want is what you get when you switch between workspaces.  If there is a way to get that sort of behavior when switching between projects I'm not aware of it.  Most of my workspaces have a single project.

Thom Little

  • Community Member
  • Posts: 83
  • Hero Points: 2
Re: First Workspace
« Reply #2 on: March 19, 2007, 12:46:42 PM »
Thanks for the reply.

Yes ... in SlickEdit terms ... what I am looking for is the ability to display multiple workspaces in the tree structure of the Project pane of the SlickEdit main window.

This was possible in another (unnamed) editor but I have now been able to figure out how to do it in SlickEdit.

Have you found a technique to do it?

... Thom

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: First Workspace
« Reply #3 on: March 19, 2007, 06:41:50 PM »
It's not pretty, but you could write a _prjopen_xxx handler that:
-- closed all buffers;
-- looked in the project's dir for a specific initialization file.
-- if found, read the list of files to open.

Of course, you would have to create such an init file for each project.

Update:  This seemed sort of interesting, so I toggled up this:
Code: [Select]
void _prjopen_initView ()
{
   _str names[];
   int i;

   if (_project_name != '') {
      _str pfn = strip_filename(_project_name, 'E')'_project.init';
      pfn = maybe_quote_filename(pfn);

//      messageNwait(pfn);

      if (file_exists(pfn)) {
         // This hangs -- ctrl-alt-shift-f2 breaks
         //  close_all();

         _ini_get_section_array(pfn, "Init", names);
         for (i = 0; i < names._length(); ++i) {
            edit(names[i]);
         }
      }
   }
}

Unfortunately, the close_all() seems to hang SlickEdit (v12 on WinXP).
The .init file it reads:
Code: [Select]
[Init]
core\src\farkle.cpp

N. B.:  This has been tested only minimally; it is more just a proof-of-concept experiment.  I don't know all the situations in which _prjopen_XXX is called; it's entirely possible this routine could be called in a situation in which it can't edit files.  (Adding a project to a workspace in the GUI, for example?)

I'm sure one of the real SlickEdit macro programmers that reads this bb could polish this in to something really useful...
« Last Edit: March 19, 2007, 08:07:40 PM by Wanderer »

Thom Little

  • Community Member
  • Posts: 83
  • Hero Points: 2
Re: First Workspace
« Reply #4 on: March 19, 2007, 10:39:25 PM »
Since each Project has its own workspace what I am an alternative would be to have the "Organize All Workspaces" be a pane in the main window like "Projects".  With this I could simply select the name I wanted and the appropriate files would be swapped .

The nicest thing would be to have the list of workspaces in the Projects pane but two panes would be an effective workaround.

The current "Organize All Workspaces" is a little clumsy when refrtenced frewquently.

If you have something like 80 websites to manipulate and each has a few pages that need frequent tweaking you can see the utility of having a capability like this.  Simply select the website of interest and the frequently tweaked pages appear.

... Thom


Tim Kemp

  • Senior Community Member
  • Posts: 546
  • Hero Points: 92
Re: First Workspace
« Reply #5 on: March 20, 2007, 12:13:17 PM »
I tend to use the history at the bottom of the Project menu the way you want to use the Projects toolbar.  I agree with you it would be nice to have the higher level available in the Projects toolbar.