Results 1 to 24 of 24

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,253

    [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: 2068
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
    506

    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: 1427
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,253

    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
    Lively Member
    Join Date
    Sep 2016
    Location
    Texas panhandle
    Posts
    64

    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,253

    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,253

    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
    506

    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,253

    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
    75

    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,253

    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
    75

    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,253

    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
    108

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

    Thanks, started using this yesterday. this is fantastic.

  14. #14
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

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

    https://github.com/wqweto/TabStrip-Addin

    Commit 75a94d1 fixed tab-strip height when large icons toolbars setting is ON to auto-size to toolbar's full height. Tab icons became 32x32 pixels wide in this mode to match toolbar icons.




    Blends with IDE by using current Window theme system icon font, not just Tahoma 8 pt as in initial implementation. Fixes right-click context menu not showing when right-clicking again while context menu is already shown.

    There is a known bug with closing MDI child windows through context menu while current project is running. (Tab-strip becomes hatched because missing explicit error handler on the menu click event handler probably.)

    There is a precompiled TabStripAddIn.dll binary in releases section of the repository.

    cheers,
    </wqw>

  15. #15
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

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

    In fact, the simplest VB6 project is to develop a new interface. Because it provides the perfect way for plug-ins to operate.

    Even if we minimize the original fertilizer, we can also control it by clicking on the menu.
    It's just that it was windows more than 20 years ago, and it was a product in 1998.
    There are a lot of problems with control.

    The simplest thing is. Operation of hook vba6.dll
    But if you repeat the same code, many of them will not execute the function.call

  16. #16
    Addicted Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    176

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

    I have downloaded the project from github, and there's a problem with Connect.dsr, the line delimiter is LF, like in Unix instead of CR LF like in Windows, is the only file with that problem

  17. #17
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

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

    Quote Originally Posted by gilman View Post
    I have downloaded the project from github, and there's a problem with Connect.dsr, the line delimiter is LF, like in Unix instead of CR LF like in Windows, is the only file with that problem
    The file is actually named Connect.Dsr with capital D.

    This sucks big time as .gitattributes filemasks for end-of-line conversions are case-sensitive. Ouch!

    Edit: Should be fixed in latest commit.

    cheers,
    </wqw>

  18. #18

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

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

    Quote Originally Posted by wqweto View Post
    https://github.com/wqweto/TabStrip-Addin

    Commit 75a94d1 fixed tab-strip height when large icons toolbars setting is ON to auto-size to toolbar's full height. Tab icons became 32x32 pixels wide in this mode to match toolbar icons.


    </wqw>
    Thanks for picking this up and running with it, wqweto.
    If you don't know where you're going, any road will take you there...

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

  19. #19
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

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

    If you ever encounter this issue and nobody is around to update it, I successfully use WinHex to fix this. It has a 'Replace Hex Values' option under the Search menu, and you replace 0A with 0D0A in all the text-based files (.frm, .vbp, .ctl, .cls, .dsr) but not binary files (.frx, .ctx, .tlb, .res, etc). Choose 'Yes' when asked if you want to move the data (No will overwrite the next byte and corrupt the file)

  20. #20
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,746

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

    Maybe write a generic function to automatically search for all the files in the project directory and replace them.

  21. #21
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

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

    You could certainly do that I just don't encounter it often enough for that to be worthwhile.

  22. #22
    Addicted Member
    Join Date
    Feb 2022
    Posts
    167

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

    @wqweto - NOTE: GitHub mangling EOL chars again, so you must open Connect.Dsr and change EOL from Unix to Windows.
    In Notepad ++ :
    Edit > EOL Conversion > Windows CRLF

  23. #23
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    5,647

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

    I recently posted a utility to automatically correct the line breaks when you do get VB6 files corrupted by bad settings:

    VB6 GitHub Linebreak Repair

    Dsr isn't on the list by default, just add it to the textbox.

  24. #24
    Addicted Member
    Join Date
    Feb 2022
    Posts
    167

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

    Quote Originally Posted by fafalone View Post
    I recently posted a utility to automatically correct the line breaks...
    EDIT: CONGRATS ON YOUR 5,000th POST fafalone !!!

    Thank you! It's going to be very useful moving forward, because github has 90% of the VB6 codes marked as "Visual Basic"...

    I'm not sure if it is the author not selecting the right box or if it is just flat-out prejudism and racism and sexism against VB6.

    I thought we were moving into a brave new world, but it seems github or the knuckleheads who post the projects just lazily select "Visual Basic" when they upload it?

    Asking for a friend who actually cares about such trivial matters...
    Last edited by taishan; Dec 15th, 2023 at 10:20 PM.

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