SimpleGraph 2.8 source changes.

Please discuss general Delphi programming topics here.

SimpleGraph 2.8 source changes.

Postby taazz2 » September 28th, 2011, 12:53 pm

Hi,

I see that a new version is out and I was wandering if it would possible to let me know where exactly the changes are made in the code.
The reason I ask is that I've been working with 2.72 version and I have significant changes that I do not want to lose.
Those changes are ..
1) chane the way the mouse is propagated through the objectlist to respect the DrawOrder user selection ee when the draw order was doNodesOnTop it could select a link drawn behind the node that it was on top of it in the ZOrder.
2) Added a new heirarchy of objects TSGCanvas which has the same interface as TCanvas but allows to override all the drawing methods those objects include
a TSGGDICanvas which is just a proxy to an existing Canvas, TSGGDIPlusCanvas which is using the progdigy GDI+ files to override the default draw methods to
use GDI+
3) Some minor changes that I needed to writed inherited TSimplegraph that has different behavior.

These changes are stable enough for pear review and testing and I would like to post them here for inclusion on the official release after beta testing from any one interested and I want to make sure that the latest version is used.

Thank you for your attention.
taazz2
Active Member
Active Member
 
Posts: 22
Joined: September 28th, 2011, 4:21 am

Re: SimpleGraph 2.8 source changes.

Postby Kambiz » September 29th, 2011, 8:22 am

It would be nice to have those improvements in SG.
I suggest to use ExamDiff, which is a freeware tool for visual file comparison.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: SimpleGraph 2.8 source changes.

Postby taazz2 » October 6th, 2011, 3:48 pm

Thank you for the pointer. It seems that I have made a number of changes that are not easy to port with out going through an other debug / test session with the new version. This makes it a bit to much to do all at once so I'm going to port part of the changes to the latest version and post a version here for you review.

I'll try to port the canvas related changes this weekend with a few enhancements I wanted to do and post a version in this thread. Thank you for your efforts.
taazz2
Active Member
Active Member
 
Posts: 22
Joined: September 28th, 2011, 4:21 am

Re: SimpleGraph 2.8 source changes.

Postby Kambiz » October 8th, 2011, 1:13 pm

This is a good news, thanks!
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: SimpleGraph 2.8 source changes.

Postby taazz2 » October 20th, 2011, 2:34 am

First I apologize for the delay but real life and promises rarely coexists with out problems.

I have attached a zip with the changes I have promised. I have tried to keep the changes in the Simplegraph.pas to a minimum so I moved the canvas objects to a new unit UEvsSGCanvas.pas as already said I have used the progdigy gdi+ trnaslation files so they are included as well, also there is one more unit included UevsGdipHelpers which is a cut down version of the one I'm using, I am not allowed to share the complete unit. All changes in the file are marked and the old code has been kept commented out. on the top of the unit there is are comments for the changes I made the comments have the format
{
TagName : description of the change.
tagname2 : etc...
}

in the code where I made changes I have tagged with // JKOZ : TagName
so a search on jkoz will take you to all the changes. The only place that I have not kept the old code when changed was on the DoBeforeDraw and DoAfterDraw methods although they are tagged.

To see the code work
1) copy everything on the demo directory and/or add the new files to the demo project.
2) add a new action on the action in the demos main form with caption GDI+ Canvas and name actGDIPlus.
3) on the onexecute event of the new action use the following code
begin
actGDIPlus.Checked := not actGDIPlus.Checked;

if actGDIPlus.Checked then
SimpleGraph.DefaultCanvasClass := TSGGdiPlusCanvas
else
SimpleGraph.DefaultCanvasClass := TSGGdiCanvas;
SimpleGraph.Invalidate;
end;
4) add a new menu item on the main menu in the view menu and link it to the new action.

run the demo load any one of the samples and simple check uncheck the gdi+ canvas on the menu to see the differences between gdi+ and gdi.
You can have greater changes if you change the modes in the canvas object initialization methods. I think that the code is easy to follow although not very clean and by no means complete. As it is I have not changed the string drawing to gdi+ since gdi already supports antialised text.

I'll try answer any questions on this thread and when I get some time I"ll try to port a few more changes.

A question for you though do you have an example of multipage printing from simplegraph?
Attachments
SimpleGraphCustomCanvasV2.8.zip
(185.86 KiB) Downloaded 1645 times
taazz2
Active Member
Active Member
 
Posts: 22
Joined: September 28th, 2011, 4:21 am

Re: SimpleGraph 2.8 source changes.

Postby Kambiz » October 23rd, 2011, 6:34 pm

Thank you taazz2!

I can't try your changes because I am in vacation and I don't have Delphi on my laptop. But I'm sure many people will find your changes very interesting.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: SimpleGraph 2.8 source changes.

Postby Marsel1972 » May 22nd, 2016, 11:31 am

Do not unpack the file SimpleGraphCustomCanvasV2.8.zip
Marsel1972
Member
Member
 
Posts: 1
Joined: May 22nd, 2016, 10:47 am


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron