Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: danselmi on December 23, 2008, 04:51:40 pm
-
Hi
I have built a Structogram editor, the NassiShneiderman Plugin.
Some features:
- Edit the diagram with the mouse (dnd), copy/cut/paste
- export to StrukTeX, PNG(or just copy and paste as bitmap (into bitmap editor)) and svg
- export to source code
To edit a diagram, choose the brick from the toolbar and move the mouse over the diagram. A red Line
or Grid will indicate where the brick gets inserted.
To disable SVG export remove the USE_SVG define from the build options.
To get SVG export, you need to compile the SVG lib from WxWidgets contrib dir. Don't forget to
copy wxmsw28u_svg_....dll where it can be found.
There is the file "lexer_nassi.xml" in the archive, copy it to the other lexer configutation files and
Code::Blocks knows the nsd files in it's file open dialog. (it is not really a lexer configuration...)
"Save As" and "Select All" will work after applying patch ID 002606.
If you have any questions, don't hesitate to ask.
Now the NassiShneiderman Plugin is only an editor plugin. I like to integrate it more into Code::Blocks.
The question is: How would you (as a user) expect the behavior of such a plugin?
I have prepared a parser (with boost::spirit) which is able to read c sources and generate
the diagram. When should the parser get called and over which part of a source file? When should
the plugin generate sourcecode from the structogram and replace the previously parsed code?
Thanks for your help in advance.
Regards danselmi
[attachment deleted by admin]
[attachment deleted by admin]
-
I had no idea this diagram existed
Link to what it is http://en.wikipedia.org/wiki/Structogram
Tim S
-
Hi
Some had problems to build this plugin. I hope this helps.
(missing postscript support on wxMSW).
regards, danselmi
[attachment deleted by admin]
-
Some had problems to build this plugin. I hope this helps.
...probably that was not the reason. I had issues, too. The reaosn was that you include the resources via "../rc/[resource_file]". Changing all the occurrences to "rc/[resource_file]"" got me rid of a lot of compiler errors.
in addition since we use wx28 you should prefer "wxFD_SAVE" over "wxSAVE" and alike for file constants. People not having the wx_compatibility flag set will get errors otherwise.
Besides this and to make myself clear: EXCELLENT contribution! Great work!
-
Currently updated my svn revision from 6370 to 6376 and breaks on your plugin. The rest of plugins compile just fine.
The exact error message is ld.exe||cannot find -lwxmsw28u_svg|
I use TDM's GCC 4.5.0 with wxMSW-2.8.10, under Windows XP Professional SP3.
Please advice.
-
The dependency can be removed by removing the define USE_SVG in the build options and "wxmsw28u_svg" from the link libraries. The export to svg is not available then.
-
Cheers buddy, that would do.
-
I have just written some documentation about the usage of this plugin but it is not finished yet:
http://wiki.codeblocks.org/index.php?title=NassiShneiderman (http://wiki.codeblocks.org/index.php?title=NassiShneiderman)
-
Is this plugin still available? I would very much like to use it. I've been searching trough duckduckgo now over a hour without any luck. The wiki page is nice and all, but there is no link to a download for said plugin. Anyway I can get my hands on it? The link to nassiplugin.berlios.de does not seem to work anymore :/.
-
It's part of the contrib plugins.
-
Thank you Danselmi for your quick reply. Does that mean that it should be included in current version of Code::Blocks? Is it also included in the 64bit version? Becuase I cant find it nowhere. Installed Code:Blocks via a packet manager on Mint Linux 17.
-
You need to install the contrib plugins too.
-
If anyone's interested, I've submitted 3 patches for this plugin:
1- This patch allows the usage of editor colors instead of hardcoded colors to create the diagram. Thanks to Alpha for pointing me out how to get the actual editor colors. Unfortunately I couldn't pinpoint the piece of code responsible for editing the comments/sources on the diagram itself. So editing colors are still hardcoded. Please see screenshots below.
patch here -> https://sourceforge.net/p/codeblocks/tickets/124/ (https://sourceforge.net/p/codeblocks/tickets/124/)
2- This patch enhances the Cparser to allow for more comments at various different places. Please see screenshots below.
patch here -> https://sourceforge.net/p/codeblocks/tickets/125/ (https://sourceforge.net/p/codeblocks/tickets/125/)
3- A simple patch to insert a menu item for 'Create diagram' so that a shortcut can be assigned. Unfortunately I don't know how to disable the menu item if there is no code selected but it must be implemented as cb crashes when the menu item is activated with no selection.
patch here -> https://sourceforge.net/p/codeblocks/tickets/126/ (https://sourceforge.net/p/codeblocks/tickets/126/)
Sample code:
(http://i.imgur.com/GAm0vMF.jpg)
Diagram:
(http://i.imgur.com/80OQFVB.jpg)
-
1. I've posted a comment on the sf.net about this.
2. Can you post a screenshot without this patch?
3. If you've set a menu id, then you can register an UpdateUI event which can be used to enable/disable the menu item.
-
Thanks for the feedback.
1- I've posted a new patch with some comments on sf.net.
2- I can't because the Cparser won't even parse it without the patch (because of some of the comments) and even if it could, the true condition comments won't be at the correct place. I forgot to say; the parser enhancements is not only limited to if/else if/else blocks but to all other structures the plugin can parse.
3- If you can point me to the exact location in cb's source where I can register an UpdateUI event, I'll see what I can do.
-
1. ok
2. ok
3. you have to register wxwidgets event using the id of the menu item. See their documentation. You can either use Connect method of your event handler or the EVT_XXXX macro.
-
3- I managed to disable the menu item when no text is selected and posted the patch to sf.net. Thanks for the tip. I don't know why the menu item is enabled when the current editor is a diagram though. Fortunately it doesn't lead to a crash when activated.
-
1- Added new patch that uses 'settings -> environment -> colours'.
3- Updated the patch. The enabled menu item problem in my previous post is resolved.