Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: danselmi on December 23, 2008, 04:51:40 pm

Title: Editing Structograms with the NassiShneiderman plugin
Post by: danselmi on December 23, 2008, 04:51:40 pm
Hi

I have built a Structogram editor, the NassiShneiderman Plugin.
Some features:

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]
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: stahta01 on December 25, 2008, 12:33:45 am
I had no idea this diagram existed
Link to what it is http://en.wikipedia.org/wiki/Structogram

Tim S
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: danselmi on December 25, 2008, 08:12:56 pm
Hi

Some had problems to build this plugin. I hope this helps.
(missing postscript support on wxMSW).

regards, danselmi

[attachment deleted by admin]
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: MortenMacFly on December 25, 2008, 09:39:22 pm
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!
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: stefanos_ on June 28, 2010, 10:07:27 am
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.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: danselmi on June 28, 2010, 10:38:58 am
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.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: stefanos_ on June 28, 2010, 11:43:48 am
Cheers buddy, that would do.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: danselmi on September 10, 2010, 01:02:25 am
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)
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: daplan on December 23, 2014, 12:00:04 pm
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 :/.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: danselmi on December 23, 2014, 12:08:44 pm
It's part of the contrib plugins.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: daplan on December 28, 2014, 09:10:18 am
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.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: danselmi on December 28, 2014, 07:26:40 pm
You need to install the contrib plugins too.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: scarphin on January 04, 2015, 07:02:58 pm
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)
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: oBFusCATed on January 04, 2015, 07:57:49 pm
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.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: scarphin on January 04, 2015, 10:46:03 pm
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.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: oBFusCATed on January 05, 2015, 12:03:55 am
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.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: scarphin on January 05, 2015, 03:14:23 pm
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.
Title: Re: Editing Structograms with the NassiShneiderman plugin
Post by: scarphin on January 05, 2015, 09:36:47 pm
1- Added new patch that uses 'settings -> environment -> colours'.
3- Updated the patch. The enabled menu item problem in my previous post is resolved.