Results 1 to 23 of 23

Thread: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

  1. #1

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Post [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    Please download a newer version here: https://www.vbforums.com/showthread....test-versions)

    This post is old and will not be updated
    ***************************************************************************************************


    Hi guys I want to share my first Add-In with you: Document Map v2.0 (important bugfix!)

    Name:  s_DocumentMapv2.0b.jpg
Views: 1241
Size:  39.2 KB
    Name:  s_DocumentMapv2.0a.jpg
Views: 1162
Size:  27.9 KB
    Name:  ScreenshotV1.3.jpg
Views: 1960
Size:  42.6 KB

    It display graph colored representation of the current code window wich can be clicked to navigate from
    one point of the code to another instantly
    It shows what part of the code you're seeing in the editor.
    Its flicker free!
    It has checks to not redraw when there is no code/views changes (its fast and not cpu intensive)
    Default Colors:
    -Grey: Normal code
    -Light Grey: Begin of sub/function
    -Green: Comments


    Left Click jump to that part of code.
    Right click brings a menu to add/remove marks:
    Cause I dont know how to access the Flags/Breakpoints I added a few special delimiters
    that draw visual clues on the Document Map. (Must be the first chars in the line, except TODO)


    '*- = Full purple line
    '*1 = Red mark on the right
    '*2 = Yellow mark on the right
    '*3 = Cyan mark on the right
    'TODO: = Shorter green mark on the right


    (Marks are part of the code so, unlike bookmarks, they are saved)

    Use "Standard API Color Picker" by Elroy


    DOWLOAD: vb6_Addin_DocumentMapv2.0.zip



    Changelog
    =======

    v1.0 (24/07/19)
    +Basic version as proof of concept (it just 'works') and is my first AddIn. There is a lot
    of room for improvement.


    v1.1 (26/07/19)
    +Change focus back to project so mousewheel works after clicking document map
    +Moving while keeping the mouse pressed allow smooth scrolling through the document map
    +Right mouse menu give option to set / remove marks
    +Codeview are now centered on the click
    +While mouse button held it show the name of Sub / Fuction in that part of code
    +Support for CodeSmart bookmarks


    v1.2 (28/07/19)
    +Integrated in VB6 Ide (No more a floating on-top form)
    +Full analisys for marks (before was skipping lines if code was too big)
    +Reworked some logics for faster code

    v1.3 (04/08/19)
    +Better drawing representation (with spaces, no more just lines)
    +No more double height lines on short documents (double line space instead)


    v1.4 (06/08/19)
    +Added a refresh to the UserDocument after redrawing wich make it more responsive using a compiled dll while
    moving the mouse with the left button down.
    +Recicle AddIn toolbar menu (only useful if youre editing the addin and stop it without removing it from
    another proyect.


    v1.5 (20/08/19)
    +Right mouse menu integration on VB Ide (to add marks)
    +New Toolbar Icon


    v1.6 (06/12/19)
    +Added new button to clear inmediate window


    v1.7 (07/06/21)
    +Added Codemap default region header/footer
    +Improve some colors a little. (more contrast on Function/Sub)
    +Fixed End Sub/Function draw with a line (should have been working before)
    +No more dependency on Office library
    +Selection is highlighted on the document map


    v2.0 (16/06/21)
    +Added Zoom on right mouse menu over Documentmap with zoom level indication and reset.
    (Only available on large files and depending on documentmap window size)
    +New command bar to move up/down between marks 1,2,3
    +Added configuration screen
    +Added customizable colors
    +Fixed bug wich caused IDE icons to disappear under certain circunstances (Finally!)


    IMPORTANT: Before version 2.0 there was bug that produce missing icons on the IDE.
    If this happened to you, deleting the reg key "HKCU\Software\Microsoft\Visual Basic\6.0\UI"
    and reopening vb6 will restore the lost icons


    Improvements while dragging LMB over Documentmap:
    +Show procedure name near mouse always (before was only when declaration was visible on screen)
    +Full procedure highlight while moving
    +Show linenumber
    Last edited by shagratt; Apr 19th, 2022 at 11:36 AM. Reason: Updated

  2. #2
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaƱa
    Posts
    506

    Re: VB6 - Document Map AddIn (code thumbnail navigation)

    very good addin
    I would put the option, floating window inside the ide.

    a greeting

  3. #3

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (code thumbnail navigation)

    Quote Originally Posted by yokesee View Post
    very good addin
    I would put the option, floating window inside the ide.
    a greeting
    What did you mean with "Inside the ide" ? This is my first AddIn and still dont know much about interacting with the toolbars in the IDE thats why I implementing everything in AddIn window itself
    I plan to make it colapsable with double clicking the title so it will be not much need to enabling/disabling the onTop feature at all. I work with a dual monitor setup and put it on my second monitor (to the right) so it stay there all the time. But love to hear feedback and ideas.

  4. #4

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (code thumbnail navigation)

    Quote Originally Posted by yokesee View Post
    very good addin
    I would put the option, floating window inside the ide.
    a greeting
    I think I nailed what you mean with "inside the ide". Since v1.2 is part of the ide now

  5. #5
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaƱa
    Posts
    506

    Re: VB6 - Document Map AddIn (code thumbnail navigation) - Updated

    Very good work, if I was referring to that window, it is perfect like that.

    you could add a contextual menu in editor right click menu, and in the line where you add the texts '* 1' * 2 ...

    keep up the good work

    Greetings

  6. #6

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (code thumbnail navigation) - Updated

    Quote Originally Posted by yokesee View Post
    Very good work, if I was referring to that window, it is perfect like that.
    you could add a contextual menu in editor right click menu, and in the line where you add the texts '* 1' * 2 ...
    keep up the good work
    Greetings
    That's a good idea but unfortunately I dont know how to add things to the right click standard menu :/
    I uploaded a new version today with better drawing of the code. Hope you like it

  7. #7
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaƱa
    Posts
    506

    Re: VB6 - Document Map AddIn (code thumbnail navigation) - Updated 04/07/19

    Very good work keep it up.
    You're right I thought it was simpler
    I've been researching the menu and I can't find anything.
    some type of subclass or hook of the menu will be used.



    I have a problem as can be done to show the window as soon as it opens.

    Greetings

  8. #8

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (code thumbnail navigation) - Updated 04/07/19

    Quote Originally Posted by yokesee View Post
    I have a problem as can be done to show the window as soon as it opens.
    Check new version. It's working now?

  9. #9
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaƱa
    Posts
    506

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 06/07/19

    You have made some improvement to the code look I found this project in a discursion.
    in the added items to the contextual menu.
    When I have time I will try to see how he has implemented it now I have a lot of work.
    If it helps you.

    http://www.planet-source-code.com/vb...74734&lngWId=1

    Greetings

  10. #10

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 06/07/19

    I successfully added a new submenu with all the options to the right click in code window, but now my problem is Im unable to detect the line where you opened the menu. My workarroud is to use SendKey to emulate the typing but im not happy with the result so I will keep looking for a way to get that info.

  11. #11
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaƱa
    Posts
    506

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 06/07/19

    find this
    Code:
          Dim lngStartLine As Long
          Dim lngStartColumn As Long
          Dim lngEndLine As Long
          Dim lngEndColumn As Long
          ' Only add a new line if a code pane is present.
          If VBInstance.CodePanes.Count > 0 Then
              ' Retrieve the starting line of the
              ' selection in active code pane.
              VBInstance.ActiveCodePane.GetSelection lngStartLine, _
                 lngStartColumn, lngEndLine, lngEndColumn
              ' Add a line at the location that is
              ' retrieved in the GetSelection statement.
              VBInstance.ActiveCodePane.CodeModule.InsertLines lngStartLine, _
                 "'Line inserted from Add-In"
          End If

  12. #12

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 06/07/19

    Quote Originally Posted by yokesee View Post
    find this
    Code:
          Dim lngStartLine As Long
          Dim lngStartColumn As Long
          Dim lngEndLine As Long
          Dim lngEndColumn As Long
          ' Only add a new line if a code pane is present.
          If VBInstance.CodePanes.Count > 0 Then
              ' Retrieve the starting line of the
              ' selection in active code pane.
              VBInstance.ActiveCodePane.GetSelection lngStartLine, _
                 lngStartColumn, lngEndLine, lngEndColumn
              ' Add a line at the location that is
              ' retrieved in the GetSelection statement.
              VBInstance.ActiveCodePane.CodeModule.InsertLines lngStartLine, _
                 "'Line inserted from Add-In"
          End If
    Great Yokesee!!! Thankyou for pointing that out. I thought that was for getting selected text only! Now I got it working! Uploading new version now (v1.5)

  13. #13
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaƱa
    Posts
    506

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 06/07/19

    Nothing, the work is yours.
    I wish I had more time to help you.

    I hope you add more things, for me it will be very useful.

    Greetings

  14. #14
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 06/07/19

    I love it but I had real problems getting it to dock on the right hand side of the code page next to the vertical scrollbar. In the end I did it but I am still unsure how. Superb add in.

  15. #15

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 06/07/19

    Quote Originally Posted by yereverluvinuncleber View Post
    I love it but I had real problems getting it to dock on the right hand side of the code page next to the vertical scrollbar. In the end I did it but I am still unsure how. Superb add in.
    We all got into that fight. Snaping addins windows can be frustrating sometimes. you can press shift when moving it to avoid snap on the undesired place

  16. #16

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: VB6 - Document Map AddIn (graphical code thumbnail) - Updated 07/06/21

    v1.7 (07/06/21)
    +Added Codemap default region header/footer mark ('/////...)
    +Improve some colors a little. (more contrast on Function/Sub)
    +Fixed End Sub/Function draw with a line (should have been working before)
    +No more dependency on Office library
    +Selection is highlighted on the document map

  17. #17

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    v2.0 (16/06/21)
    +Added Zoom on right mouse menu over Documentmap with zoom level indication and reset.
    (Only available on large files and depending on documentmap window size)
    +New command bar to move up/down between marks 1,2,3
    +Added configuration screen
    +Added customizable colors
    +Fixed bug wich caused IDE icons to disappear under certain circunstances (Finally!)


    IMPORTANT: Before version 2.0 there was bug that produce missing icons on the IDE.
    If this happened to you, deleting the reg key "HKCU\Software\Microsoft\Visual Basic\6.0\UI"
    and reopening vb6 will restore the lost icons


    Improvements while dragging LMB over Documentmap:
    +Show procedure name near mouse always (before was only when declaration was visible on screen)
    +Full procedure highlight while moving
    +Show linenumber

  18. #18
    Addicted Member
    Join Date
    Jun 2009
    Location
    C:\Windows\SysWOW64\
    Posts
    227

    Re: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    Where is the download link?

  19. #19
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    In the first post

  20. #20
    Addicted Member
    Join Date
    Jun 2009
    Location
    C:\Windows\SysWOW64\
    Posts
    227

    Re: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    Oops! You're right, I missed it.

  21. #21
    Addicted Member
    Join Date
    Jun 2010
    Posts
    182

    Re: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    Interesting AddIn, which I must have missed earlier browsing through the code bank (so thank you Cube8 for not finding the file ), and I will play a bit more with it before giving a judgment. Just one thing, the font size in the Document Map pane is really tiny and the only options available it appears (by right click context menu) is to make it even smaller! I know the code is there so I could possibly change it but would be interesting to hear from OP on this, what his thinking is and what he may have tried to work on to make the display more readable? A setting for the font size maybe, and a scroll bar...

    Otherwise, I like the idea to have an overview of the code with the ability to quickly jump back and forth.

    One thing noted already. I use a tabbed interface for the code/designer panes (from Code Smart 2013 AddIn) and it appears that the Map pane doesn't update first time I change from one tab to the other, not until I repeat the action a second time.
    M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?

  22. #22

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Re: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    Quote Originally Posted by 7edm View Post
    Interesting AddIn, which I must have missed earlier browsing through the code bank (so thank you Cube8 for not finding the file ), and I will play a bit more with it before giving a judgment. Just one thing, the font size in the Document Map pane is really tiny and the only options available it appears (by right click context menu) is to make it even smaller! I know the code is there so I could possibly change it but would be interesting to hear from OP on this, what his thinking is and what he may have tried to work on to make the display more readable? A setting for the font size maybe, and a scroll bar...

    Otherwise, I like the idea to have an overview of the code with the ability to quickly jump back and forth.

    One thing noted already. I use a tabbed interface for the code/designer panes (from Code Smart 2013 AddIn) and it appears that the Map pane doesn't update first time I change from one tab to the other, not until I repeat the action a second time.
    Hi 7edm!
    The document map is a visual guide. Its not a 'tiny font' at all. What you see are just lines where characters should be. You can make it display actual characters but I dont find any reason to make it cause you will not be able to read a font smaller than 7 points unless you make the font so big that it will loose the intended purpose of having a representation of all the code in just one view.

    Please download a newer version here: https://www.vbforums.com/showthread....test-versions)

  23. #23
    Addicted Member
    Join Date
    Jun 2010
    Posts
    182

    Re: [VB6] AddIn Document Map (graphical code thumbnail) - v2.0 Updated 16/06/21

    Ok thanks. Whatever, the good side of it is that it got my eyes open for looking closer at the coding of Addins, so thanks for that. I will dig in to the latest versions of this and your other addin as I find both of them very useful.
    M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?

Tags for this Thread

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