Author Topic: MDI buffers and windows and tab groups, oh my  (Read 4737 times)

jvert

  • Community Member
  • Posts: 30
  • Hero Points: 2
MDI buffers and windows and tab groups, oh my
« on: May 22, 2013, 03:45:04 pm »
I want to love the new MDI architecture but I can't quite get it to work the way I am used to.

In the old architecture, I had Slick set up so that files share a window. Then I could v-split the window and set things up with different files in each window. (for example, .cpp source files in the left pane, .h header files in the right). I bound next-window to ctrl-TAB to quickly switch between windows, and I could use prev/next-buffer to cycle through the files in the current window.

With the new architecture, I had to change things so each file gets its own window (and therefore its own tab). Then I create a new vertical tab group. My problem is there is no prev/next-tab-group to switch back and forth between the left and right tab groups. prev/next buffer hops around between the two tab groups. I really want two different things - cycle through the tabs in a tab group, and cycle through the different tab groups. I don't see how to map these onto the existing commands.

Any suggestions?

Matthew

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: MDI buffers and windows and tab groups, oh my
« Reply #1 on: May 22, 2013, 04:18:18 pm »
If you really like using the "files share one window" mode (and a lot of folks do, including 50% of our dev team :-) ), then continue using it and dock the File Tabs tool window.

jvert

  • Community Member
  • Posts: 30
  • Hero Points: 2
Re: MDI buffers and windows and tab groups, oh my
« Reply #2 on: May 22, 2013, 04:37:03 pm »
Sure I can do that, but I was looking forward to some of the promised upcoming MDI features (floating tab groups, dragging tabs between groups, etc). I assume if I go back to the File Tabs, I wouldn't get those features.

I can probably crock up a macro that does what I want based on change_window.

jvert

  • Community Member
  • Posts: 30
  • Hero Points: 2
Re: MDI buffers and windows and tab groups, oh my
« Reply #3 on: May 22, 2013, 05:18:29 pm »
Turns out _MDINextDocumentWindow() has support for the behavior I want, I just needed to write a few macros to call it. Works for me, maybe you can convert the 50% of your dev team still using File Tabs :-)

_command void window_next() name_info(','VSARG2_READ_ONLY|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_NOEXIT_SCROLL)
{
    wid=_MDINextDocumentWindow(p_window_id,'G',false);
    activate_window((int)wid);
    _set_focus();
}

_command void next_window_in_tabgroup() name_info(','VSARG2_READ_ONLY|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_NOEXIT_SCROLL)
{
    wid=_MDINextDocumentWindow(p_window_id,'1',false);
    activate_window((int)wid);
    _set_focus();
}

_command void prev_window_in_tabgroup() name_info(','VSARG2_READ_ONLY|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL|VSARG2_NOEXIT_SCROLL)
{
    wid=_MDINextDocumentWindow(p_window_id,'2',false);
    activate_window((int)wid);
    _set_focus();
}


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3940
  • Hero Points: 256
Re: MDI buffers and windows and tab groups, oh my
« Reply #4 on: May 22, 2013, 09:50:14 pm »
I use "files share one window" mode like you. I suspect there will be two camps. Those who are like me that need a more pure emulation and those like you who will attempt to switch to the other window mode in order to have multiple tabs.

If you use "files share one window" mode like me, you still benefit from WAY better split window support and the ability to drag a window off to display on another monitor or wherever.

For those who try to switch modes, you're on your own a bit right now. You'll have to decide how you want to switch between files and windows. When we were designing the new MDI, I rolled some ideas around in my head but nothing worked well. One idea I had was to show tabs for all the buffers on every tab row. This would look too busy though, you would have too many tabs to show the path, and creating GUI tabs does have a slight speed cost (I'm a speed freak).

I may see what I can hack up for myself and see if I can deal with it. I'm very hooked on my key bindings and expectations of what they should do.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3940
  • Hero Points: 256
Re: MDI buffers and windows and tab groups, oh my
« Reply #5 on: May 23, 2013, 02:15:54 pm »
I've added next_tab_group and prev_tab_group commands which is similar to your window_next command. Currently they only switch groups in the current mdi window. When I have more time, I'll have them cycle through other all MDI windows.

mako

  • Community Member
  • Posts: 27
  • Hero Points: 1
Re: MDI buffers and windows and tab groups, oh my
« Reply #6 on: July 17, 2013, 05:32:07 pm »
I'm trying to figure out if I can use one-file-per-window with tab groups. I would like to, since it is nice having a tab for each open file, but there is still one fly in the ointment: There is no way using the keyboard to switch between tab groups while preserving the active tab in each group.

I like to have one pane visible for each file I am actively working on at the moment (e.g. source & header, or caller/callee), but I have other files open that I have visited recently and might want to refer to again. In v17 and before, I used multiple-files-share-window, with one MDI window per active file (always tiled), and I could use next-window and prev-window to easily switch between the panes, allowing me to jump quickly between files I'm actively working on. If I needed to visit one of the other files not currently visible, I used the "List open files..." dialog (bound to a key) to select and show it in the current pane.

What I would like to do in v18 is have one pane/tab group for each file I'm actively working on, and have other recently visited files in tabs that are not currently active/visible. Then I can easily find, move and activate them using the tabs. However, there does not currently appear to be a way to quickly switch between the tab groups from the keyboard while preserving the active tab in each group. As described by Clark in another thread (http://community.slickedit.com/index.php/topic,9130.msg39345.html#msg39345) :

Quote
next_tab_group doesn't maintain the active tab of the tab group it switches to. It switches to the first tab (left most tab) in the next group. prev_tab_group switches to the last tab (right most tab).

I find that using next-tab-group does not always activate the first tab in the group, sometimes it activates the last one, but either way it is annoying, because what I always want to do when switching between groups is switch to the previously active tab in the next/previous group. I do this switching between panes constantly, and it drives me nuts when the file I've been working on is hidden because it activates a tab that I don't need right now. So I would really like to see the idea that Clark proposed in that other thread implemented:

Quote
Maybe there should be two sets of commands. Maybe we need additional commands maybe called next_tab_group_active_tab and prev_tab_group_active_tab which do what you want. I don't think there is a way to do this from Slick-C right now but the C++ code has the functionality.

Until this functionality is provided, I'll have to go back to multiple-files-share-window mode and miss out on the convenience of using the tabs.

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: MDI buffers and windows and tab groups, oh my
« Reply #7 on: July 17, 2013, 11:53:22 pm »
If you really like using the "files share one window" mode (and a lot of folks do, including 50% of our dev team :-) ), then continue using it and dock the File Tabs tool window.

The big problem I have with this is that the file tabs toolbar is dog ugly when compared to the MDI tab groups. Any chance you can fix this?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3940
  • Hero Points: 256
Re: MDI buffers and windows and tab groups, oh my
« Reply #8 on: July 20, 2013, 11:03:50 am »
For 18.0.1, I changed next_tab_group and prev_tab_group to preserve the active tab. I don't think it makes sense for them to do anything else. The previous implementation wasn't inconsistent with which tab was activated.

mako

  • Community Member
  • Posts: 27
  • Hero Points: 1
Re: MDI buffers and windows and tab groups, oh my
« Reply #9 on: July 22, 2013, 05:16:59 pm »
Clark,
Thanks for doing this, I look forward to trying it out.

It's moot now, but I did see a case where the last (right-most) tab was activated in one group when I used next-tab-group to switch focus. Maybe it is affected by the tab ordering preference (I had mine set to alphabetical). I just using next-tab-group to cycle repeatedly through three groups with the tab sort order set to "most recently viewed" and in one group with three tabs I got a different one activated each time I landed on that group - a bit mysterious, but not worth pursuing.