In case you didn't read my other post about CodeTree, it's an add-in for RadASM based on an idea I saw in the Best Editor Thread: folding/collapsing blocks of code. All code between a proc statement and the corresponding endp statement can be "collapsed" or "expanded" by clicking a button in the margin or by using the items on the Edit menu. You can hide the code in every proc except the one(s) you're working on, and scroll much faster. From using CodeTree on my own CodeTree.asm file, I think it's a great improvement. If you think so too, you can now download version 1.00 of CodeTree.
(Edit: In an effort to remove all copies of CodeTree 1.00 and its embarassing bug from the world, you can no longer download version 1.00. Scroll down and get the latest version instead)

I fixed a lot of really bad bugs from the demo, but I might've accidentally added some new ones. I'd be very surprised if you lost any code as a result of a bug, but maybe you should use RadASM's "Bak" automatic backup feature, since you never know for sure. If you have any bug reports or ideas for new features, please let me know.

In later versions, I'm hoping to support other keywords such as MACRO/ENDM, .IF/.ENDIF, and maybe even user-defined branches triggered by a comment. You can look at CodeTree.txt in the zip file for more info on the bugs I need to fix and the new features I'd like to add.

To install CodeTree, just put CodeTree.dll into your RadASM\AddIns directory and add x=CodeTree.dll,0 to the add-ins section of RadASM.ini (where x is the next unused number in the section).

Thanks a lot to KetilO for his work on RadASM and its add-in model that made this add-in possible. I hope someone finds it useful. :)
Posted on 2001-11-05 19:11:25 by Irving W.
Some question, ideas, comments:

- Why have both PROC/ENDP lines? The -/+ square stands out quite well, and should be enough to eliminate confusion.

- Why delete comments/parameters after PROC/ENDP?

- I've used VS.NET a little, and it has a similar feature. In the VS.NET feature a mouseover tooltip is created from the comment block that lies just after the function declaration - this is nice.

- Maybe you can add a section to the .RAP file to save the info? You probably already are working on this. ;)

Posted on 2001-11-05 20:12:38 by bitRAKE
Hi Irving W.

Great work. :alright:

Some tiny bugs:

Save and restore the RichEdit's changed state when collapsing / expanding. This is important information I would hate to loose.

The code jumps up and down a lot when I collapse / expand.
You probably should save and restore top line index.

The CodeTree lost track of positions. I am not shure what I did. I will try to reproduce the bug and pay more attention.

Keep up your good work.

KetilO
Posted on 2001-11-05 20:16:36 by KetilO
bitRAKE: Good ideas. I'll work on keeping the parameter list/comments and only displaying the PROC line instead of the ENDP line as well. I was thinking of a section in the project .RAP file myself, actually. Each entry in the section would be the name of a project file, and contain a list of proc states. Things might get confused if you edit your .asm file in an editor other than RadASM, such as Notepad, but why would you want to do that? :)
(Edit: No offense to other ASM editors. Seriously, I'll assume all branches start out expanded and the worst that can happen is that branches exchange states with each other)

KetilO: I was sure I saved the state of the modify flag and index of the top line in this version. I specifically remember having those problems myself and writing extra code to fix them. I'll double-check my code, though, since I might not have fixed it in every case. In the meantime, make sure you replaced the demo version with this new version. You can check the DLL's VERSIONINFO to be sure (make sure the version is 1.01) (Edit: DON'T make sure this is version 1.00. That'll only make things worse). I wouldn't be terribly surprised if the new version still lost track of positions, but I haven't seen it happen. I'll test it more though. Let me know if you can reproduce it with any consistency and I'll post a fix it as soon as I can.
Posted on 2001-11-05 20:39:29 by Irving W.
I place the dll in AddIns. I change the INI to say =CodeTree.dll,1


Start RADASM, open a project... nothing. I'm using Win2k...


Thanks,
_Shawn
Posted on 2001-11-05 20:44:56 by _Shawn
_Shawn: To add an add-in to your list in RadASM, you also need a number before the equals sign. The number there depends on what other add-ins you have installed, but say it looks like this:


1=FlipCase.dll,3
2=MsdnHelp.dll,1
3=asciiTab.dll,1

Then you would add 4=CodeTree.dll,0 to the list:


1=FlipCase.dll,3
2=MsdnHelp.dll,1
3=asciiTab.dll,1
4=CodeTree.dll,0

Whichever number is the next in the list. If you don't have any other add-ins installed, the line will be 1=CodeTree.dll,0.

Hope that helps. I don't have Win2k myself, so I can't be sure this is it.
Posted on 2001-11-05 20:48:30 by Irving W.
Hi Irving W.

Yes, you save the changed state. My fault. It's getting late (or maybe early) here.

If the proc you expand is more than a page it does not hold top index and the caret is placed near endp.

What I tried was to add 3 small procs and then pressed enter several times while in the top proc. The bottom proc lost track after 6 or 7 enters.

KetilO
Posted on 2001-11-05 21:31:19 by KetilO
Ahh, OK. I'm not sure how I didn't notice this bug before, but you're definitely right. I was able to reproduce it. Working on the fix right now. Thanks for the report though!


Edit: Also, this is a bug with any key at all, it looks like, not just enter. Basically, if you type something inside a proc, it will lose track of positions. I'm not sure how there's still a bug like this after my testing, but hopefully I'll have a fix very soon.
Edit #2: I fixed it. I still can't believe I could be this careless. Hope it didn't cause anyone too much trouble.
Posted on 2001-11-05 21:42:29 by Irving W.
I found the problem! Apparently, when I was updating the branches, I set a "busy" flag to determine if I was already busy or not. Supposedly, it would be set at the start of the update and cleared at the end. What I should have done was have a "careless" flag, to let me know when I'm getting careless. That's been taken care of, and now I have version 1.01. I hope I didn't introduce another bug with this "quick fix" I'm posting. I bet I did though. :o

(Edit: Quick fixes are bad. Here's version 1.03, with a "slow-but-working" fix that was actually about as fast, plus a new fix. You didn't want to paste anything, did you?)
Posted on 2001-11-05 22:15:24 by Irving W.
Yes, I had a number, in my case, it's 5... so I just started with the equal... at the end, what's the difference between #=CodeTree,0 or 1, or 2 or 3? What's the last number mean?


THanks,
_Shawn
Posted on 2001-11-05 23:41:03 by _Shawn
Oh. I'm really not sure, then. Nothing at all happens? RadASM just starts normally? Can you be a little more specific?

The number at the end of the line is sent to the DLL on startup as an "Options" parameter. CodeTree has no options now, so currently it doesn't matter what that number is, but in the future I might add some options and I'm reserving 0 as the value for the default settings.
Posted on 2001-11-05 23:50:32 by Irving W.
When I say nothing happens I mean that there's no indication that the plugin exists. No menu in any of the menus, no + / - signs anywhere, no where to expand or collapse... as if nothing at all happened by adding the addin...

Thanks,
_Shawn
Posted on 2001-11-05 23:59:01 by _Shawn
I see. Tomorrow, I could make a debug build of CodeTree that'll log its execution to a file so I can see exactly what's going on.
I'd really appreciate it if you want to help. Just send me a private message with your e-mail address and I'll send it to you. But thanks, even if you don't want to. It's better than nothing. :)
Posted on 2001-11-06 00:12:26 by Irving W.
I ran a debuggin utility that monitors an application's modules as it loads them and if it terminates them... RadASM is indeed loading the addin correctly... just that somehow it's not taking place in the IDE...

I'll send you an private message. I'd be glad to help..


Thanks,
_Shawn
Posted on 2001-11-06 00:25:06 by _Shawn
What version of RadASM are you using _Shawn? 1.0.6.2?
Posted on 2001-11-06 00:32:48 by bitRAKE
1062... yes
Posted on 2001-11-06 01:47:18 by _Shawn
I assume the tree lines would be in the editor itself, next to the proc... if so, try this movie... and see what I see...

The attachment, rename it to .rar... then extract it... it has to be zip because it won't let me upload a rar... if I zip it, it becomes 200k, and it's 60k at rar... so... raname it to rar...




Thanks,
_Shawn
Posted on 2001-11-06 01:56:46 by _Shawn
I conforented with a serious bug today.I have collapsed some of procs at the end of my asm file. I guess they were 3-4 procs.Then I have scrolled up another proc which is 1-2 proc away from this procs.I have pasted some thing.Guess what, all collapsed proc dissappeared.I had only start and end of procs :( .Thanks to RadAsm's backup feature I have rescued my source.I dont know what happened but it happened.Hope you can fix it because it is a great add-in
Posted on 2001-11-07 13:49:20 by LaptoniC
I collapsed all of my procs, created a new one, closed the window(new proc didn't have +/- mark beside it), RadAsm asks should it save the file, I answered yes.
Reopened file and all procs expect the one i just created were gone.

Don't worry it was nothing important, just an landscape test usin OGL. =)

RadASM 1.0.6.2
CodeTree 1.0.2.0
Win2K prof sp2
Posted on 2001-11-07 19:10:24 by Aaro
Any word on the debug view? I'm still not getting it to work... :(



Thanks,
_Shawn
Posted on 2001-11-07 23:39:28 by _Shawn