Results 1 to 13 of 13

Thread: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,191

    [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Background
    I'm not much of Add-In user, but my liking for a tabbed interface of open code windows has meant that CodeHelp has been a permanent fixture of my IDE for a few years now. Just recently, I thought I'd develop an Add-In of my own, and wondered if I could improve on the CodeHelp offering. Whether I have or not, will be a matter of personal opinion, as I only focussed on the things that I wanted to change, without regard for any features that I, personally, do not use.

    Things I like about CodeHelp's tabstrip:
    1) It's always available, whether in Design, Run or Break mode
    2) You can re-order the tabs to your liking (although it's a bit clunky-feeling)

    Things I don't like:
    1) It has lots of sub-classing and hooking, which gives me stability concerns
    2) You can't close a tab without activating it first
    3) You can't re-order the tabs without first activating the tab you are moving
    4) Sometimes the active tab gets out of sync with the active code pane

    About my Tab-Strip
    I tried, of course, to retain everything from my 'positive' list, whilst eliminating those that (to me) are negatives. I suspect that other users may have quite different lists, such as keyboard shortcut access, and so on. If so, I'd like to hear from you in the replies. Maybe I can then incorporate those features. Or maybe you can modify the code as you see fit...

    Anyway, this add-in, as the title says, can be used in both MDI and SDI modes, and contains no sub-classing or hooking. Instead, it uses a simple polling mechanism which does two tests, every 125ms, essentially asking:

    1) Has the active window changed?
    2) Has the number of IDE windows changed?

    If either of those is true, things get taken a step further and all of the windows are enumerated, and the tab-strip is updated if there are any recently-closed or newly-opened code/designers windows. All-in-all, this should be pretty IDE-safe, and is actually less process-intensive than testing Window messages as they come by. It is only a tab-strip after all, and just doesn't require the level of 'state-awareness' that hooking/sub-classing might afford.

    So, here it is:

    Name:  Untitled.jpg
Views: 961
Size:  28.6 KB


    What Else?

    I have commented out all the logging code, but if you need/want to turn this on, there is a hidden listbox in frmTabStripOptions (just resize the form to see it)

    Oh, yes, the UserControl is perfectly re-usable outside of this Add-In, if you like it and want such a thing.


    Known Issues

    MDI Only
    None, yet, but I'm sure somebody will find one!

    SDI Only
    Window captions for Forms are not in the format 'Project - Component' but, instead, show the caption property for the form. As such, any caption re-naming is not picked up as part of the polling process. This could be addressed, but just doesn't seem worthwhile, at least not to me.

    Both
    Because the Tab-Strip is hosted by a regular Office toolbar, it is possible to drop another toolbar on top of it. Not sure anything can be done to prevent this behaviour.

    When pressing F5, all designer windows are immediately closed (normal behaviour), but the same is not true (at least not consistently) for the Object Browser, which seems to sometimes remain open and sometimes get closed. As such, the tabstrip might occasionally show a tab for a non-existent Object Browser window, depending on when the IDE chooses to destroy it (if at all), and whether or not it was the active window when F5 was pressed.


    UPDATE: 1st Feb 2021
    New version available, with the following improvements:
    • TabStrip now handles 'overflow' via two scroller buttons, at either end. Mouse-down for continuous scroll, or right-click to jump to either end. (You can still Ctrl-Mouse-down to sroll the control, as an alternative)
    • Menu options available upon right-click of tab, to bulk-close windows (all to right, all to left, all but this one, all designers, all)
    • Option to maintain VBW file, which will restore tab order when a project is next re-opened. Note that this ony works when a project is launched with the IDE (for example, when a vbp file is double-clicked), because there is no reliable way (via the built-in events) of determining when a project has fully loaded.
    • TabStrip is less 'intrusive' when closing and opening projects (all re-draws and updates are suspended when it is observed that there are many window changes, all at once)
    • An options form is available from the IDE's 'Add-ins' menu, to cover other behavioural aspects of the TabStrip


    UPDATE: 3rd Feb 2021
    The 'Ensure tab is visible' setting behaved a bit over-zealously in certain situations! Fixed that and a couple of other obscure bugs that nobody would ever have encountered.
    Attached Files Attached Files
    Last edited by ColinE66; Feb 3rd, 2021 at 12:09 PM.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  2. #2
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaСЃa
    Posts
    303

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    very good job.
    when loading the add-ins I get the following error:

    Name:  error.jpg
Views: 667
Size:  20.8 KB
    https://i.ibb.co/z2WY872/error.jpg
    after removing the message it seems to work fine.

    i use vb6 version 8176 i dont have sp6

    improvements:
    add a popup menu right click with:
    • close all
    • close all tabs on the right
    • close all except the active
    • Save all the tabs and when the project is reopened they will be restored.



    In options, you can limit the maximum width of the tab so that if there are very long names, it will not take up much space.
    back buttons forward, or some simple way to navigate if you have many windows open.

    I will use it for a longer time to test if I see more bugs and improvements.

    greetings very good job
    Last edited by yokesee; Jan 28th, 2021 at 06:26 PM.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,191

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Quote Originally Posted by yokesee View Post
    when loading the add-ins I get the following error:
    Ah, my error-trapping on add-in connection picked up the infamous 'Method ~ of Object ~' error. It's supposed to ignore that error but I forgot to trap it in a more locale-neutral way. I've fixed that now.

    Quote Originally Posted by yokesee View Post

    improvements:
    add a popup menu right click with:
    • close all
    • close all tabs on the right
    • close all except the active
    • Save all the tabs and when the project is reopened they will be restored.

    Yes, they're already on my To-do list. I just forgot to mention them in my opening post.

    Quote Originally Posted by yokesee View Post
    In options, you can limit the maximum width of the tab so that if there are very long names, it will not take up much space.
    Good idea...

    Quote Originally Posted by yokesee View Post
    back buttons forward, or some simple way to navigate if you have many windows open.
    Already on the list, but for now you can Ctrl-drag the whole TabStrip to do this...
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  4. #4
    Member
    Join Date
    Sep 2016
    Location
    Texas panhandle
    Posts
    61

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Love it. Thanks for sharing.

    One thing: Doesn't seem to remember the Form(Design) tabs when reloading.
    May be intentional and not really a biggee since just dblclicking the form adds it to the tabstrip.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,191

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Quote Originally Posted by VBClassic04 View Post
    Love it. Thanks for sharing.

    One thing: Doesn't seem to remember the Form(Design) tabs when reloading.
    May be intentional and not really a biggee since just dblclicking the form adds it to the tabstrip.
    No, it doesn't at the moment. The next version will restore all the tabs, in their correct order, and all the open windows. Working on it as I type.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,191

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Updated: See original post for details and new download link.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  7. #7
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaСЃa
    Posts
    303

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    very good implementations.
    when I have time I will try it

    greetings very good job

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,191

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Small update. New link in original post.
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  9. #9
    Lively Member
    Join Date
    Aug 2017
    Posts
    72

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Would you like to put an option to save a section? To open and restore windows later? I have an add-on that will delete the .vbw

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,191

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Hi germano, Can you please elaborate? If you have an add-in that deletes the vbw file, then my add-in won't work? Are you saying that you'd prefer that it writes to a different file?
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  11. #11
    Lively Member
    Join Date
    Aug 2017
    Posts
    72

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    for security reasons vbw files are excluded, so if you can write to another file and open the forms that were recently opened it would be very good

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2012
    Posts
    1,191

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Quote Originally Posted by germano.barbosa View Post
    for security reasons vbw files are excluded, so if you can write to another file and open the forms that were recently opened it would be very good
    Why not just change the source code, and replace the .vbw references with a different extension?
    If you don't know where you're going, any road will take you there...

    My VB6 love-children: Vee-Hive and Vee-Launcher

  13. #13
    Lively Member
    Join Date
    Oct 2016
    Posts
    78

    Re: [Add-In] IDE Code-Pane Tabs for MDI/SDI (No sub-classing/hooking)

    Thanks, started using this yesterday. this is fantastic.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width