Pelles C forum

Pelles C => Add-ins => Topic started by: frankie on September 26, 2005, 05:56:36 PM

Title: Comments automation addin
Post by: frankie on September 26, 2005, 05:56:36 PM
This addin is based on the excellent work of CLR, while it is keeping the function and prototypes (lightly improved) it adds the following features:
1) Module comment (creation and editing)
2) Function comment (creation and editing)
3) Win32 help search (with F1)
4) Automatic versioning and build counter with version editing.
5) Element usage (still incomplete)
6) Classic CLR code features

The features of points 1 and 2 are accessed with left mouse botton (the module comment from from anywhere in the file, function comment clicking inside the function).
For feature 3 select the word and press F1 (first declare win32.hlp in setup)
The automatic versioning is enabled creating a macro in the project options named 'VERSION'. The value of this macro is the name of the versioning .c and .h files (before enable versioning feature in the setup). After the first creation include the version.c file in the project.
Element usage for now simply search the next forward occourrence of the selected word in the text.
The classic CLR functions are available as before.
This is a Alpha release. Update will follow.
Enjoy.

Note: please download the updated version below.
Title: Comments automation addin
Post by: Pelle on September 26, 2005, 07:31:05 PM
Very nice - thanks!

Just after enabling the version feture, there seem to be "garbage" in the version info. I get "Error: File line too long" when building - until I use the "Edit Version" dialog, and set the version numbers myself. Maybe nice if the default, if possible, was something other than "garbage"?

Pelle
Title: Comments automation addin
Post by: frankie on September 27, 2005, 05:02:06 PM
Quote from: "Pelle"
Very nice - thanks!

Just after enabling the version feture, there seem to be "garbage" in the version info. I get "Error: File line too long" when building - until I use the "Edit Version" dialog, and set the version numbers myself. Maybe nice if the default, if possible, was something other than "garbage"?
Pelle


Sorry Pelle, I forget to specify inizialization flag in version file create.
This new revision seems to work correctly.
Moreover I added the feature of autoincluding the version file on the first project building.
Title: Comments automation addin
Post by: Pelle on September 27, 2005, 06:18:51 PM
Quote from: "frankie"
Sorry Pelle, I forget to specify inizialization flag in version file create.

No problems! (...and you said it was a Alpha release...)

Quote from: "frankie"

This new revision seems to work correctly.

Yes, works for me too. Thanks!

Pelle
Title: Comments automation addin
Post by: frankie on September 27, 2005, 06:29:34 PM
Quote from: "Pelle"

Yes, works for me too. Thanks!
Pelle


Thanks Pelle  :mrgreen:

In the next version I'll try to update directly the versioninfo structure in the resorces, so they are keeped aligned.
Title: Comments automation addin
Post by: Pelle on September 27, 2005, 08:47:36 PM
Quote from: "frankie"
In the next version I'll try to update directly the versioninfo structure in the resorces, so the are keeped aligned.

That would be cool!  :D

Pelle
Title: Comments automation addin
Post by: CLR on October 01, 2005, 10:09:02 PM
Hello frankie.

That is really useful. Thanks! !
Title: Comments automation addin
Post by: frankie on October 03, 2005, 09:52:38 PM
Quote from: "CLR"
Hello frankie.

That is really useful. Thanks! !


Thanks CLR  :D !

Now I have to thank you for your superb code that is substantial to this tool  :wink: !
Title: Comments automation addin
Post by: CLR on October 04, 2005, 01:38:12 AM
Quote from: "frankie"
Quote from: "CLR"
Hello frankie.

That is really useful. Thanks! !


Thanks CLR  :D !

Now I have to thank you for your superb code that is substantial to this tool  :wink: !


Hello frankie. Thank you very much!!
I"m very happy!!  :D
Title: Comments automation addin
Post by: Miralex on February 14, 2006, 08:26:25 AM
Can I put buttons 'Edit function comment' and 'Edit module comment' to the top panel, like as button 'Function prototypes'?
Title: Comments automation addin
Post by: frankie on February 14, 2006, 09:32:00 AM
In the file "faddin.c", function "AddInMain", change the function and module comment sections from:
Code: [Select]
AddCmd.idMenu = AIM_MENU_SOURCE;
to
Code: [Select]
AddCmd.idMenu = AIM_MENU_NOTHING;
Title: Comments automation addin
Post by: Miralex on February 14, 2006, 10:00:25 AM
Big Thanks. It Work   :)


And I still have a proposition:
When I'm add a solid function comment  - it add's and cutting on some fixed strings. But it It would be nice if cutting where just sentence ended or finded 'line feed character'.
Title: Comments automation addin
Post by: frankie on February 14, 2006, 10:17:06 AM
I don't exactly catch what you mean.
Anyway to keep code simple I just get a line at time and if it ends with a space this means that the comment continues on the next line. A comment is closed when the last char in a line is != space.
To make it more flexible I should introduce REGEX to discriminate comments start and end, and this is somwhat complicate at this time.
Anyway your welcome to modify the code as per your preferences and I'll be glad to see your own implementation.

P.S. I'm still planning to add other features, as soon as I will have time, as automatic arguments listing for comment (inside a function comment) and the already promised automatic version resource updating.