Results 1 to 10 of 10

Thread: [VB6] AddIn IDE Codefolding

Threaded View

  1. #1

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

    Post [VB6] AddIn IDE Codefolding

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


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




    This is an add-in to Add Codefolding like capabilities to VB6 IDE


    Name:  Snap_CodeFold_2.jpg
Views: 1812
Size:  62.5 KB

    Name:  Snap_CodeFold_3.jpg
Views: 1882
Size:  43.2 KB

    Name:  Snap_CodeFold_1.jpg
Views: 1773
Size:  21.7 KB





    Unfortunately VB6 doesnt support codefolding so I came with an idea to mimic its functionality
    by relocating part of the code (Functions/Sub or Regions) towards the bottom of the file and
    leaving a placeholder that can be expanded (It can be used with subclasing. The fold storage can be moved up without problems)

    I divide foldable content into two types:

    -Function/Sub:
    They can be Folded without any problem. The project can be opened by anyone without the AddIn and
    be 100% compatible.

    -Regions:
    This are the user defined area (they can be created by selecting the lines and opening the context
    menu with the right mouse). Regions can be of three types:
    -Outer regions:
    Regions that have several Functions/Sub inside. Like before this leave a 100% compatible project.
    -Outer region with declares/enums/type:
    This ones (usually at the top of the module) are automatically marked to unfold on run/compile.
    -Inner region:
    This are the regions inside functions.There is no limit on the number of sublevels that can be
    created. If folded they are automatically unfolded on run/compile and refolded after.

    IMPORTANT!!!: Inner regions need to be padded and every region inside another need another extra level
    of padding. Not respecting this rule may break your code.
    The last two groups needs the AddIn to be enabled only if they are Folded.
    An Unfolded project is still 100% compatible with any VB6 IDE not using the AddIn.


    NOTES:
    -Sub/Function/Props need scope to be explicit ("Public Sub","Private Sub","Public Func...)
    -May fail on FULL COMPILE (CTRL+F5) when Regions are folded and VB6 is configured with
    "General->Compile on demand" (This is a bug on VB6 IDE. It dont raise the addIn event)



    DOWNLOAD: prj (AddIn) CodeFold v1.0.0.zip

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