hpwSimpleGraph
Moderator: Neosoft Support
hpwSimpleGraph
Just released initial hpwSimpleGraph 1.0:
http://www.hpwsoft.de/anmeldung/html1/n ... ook19.html
Based on the excellent free TSimpleGraph component 2.0
http://www.delphiarea.com
Thanks to Kambiz R. Khojasteh for this great component.
The plugin supports similar features as the demo-app from TSimpleGraph.
First implementation with seperate runtime-plugin discussed here:
http://www.neosoftware.com/forum/viewto ... hlight=nbr
Until support through future neobook releases you can simply rename the NBR to NBP for delivering.
As always testers wellcomed!
http://www.hpwsoft.de/anmeldung/html1/n ... ook19.html
Based on the excellent free TSimpleGraph component 2.0
http://www.delphiarea.com
Thanks to Kambiz R. Khojasteh for this great component.
The plugin supports similar features as the demo-app from TSimpleGraph.
First implementation with seperate runtime-plugin discussed here:
http://www.neosoftware.com/forum/viewto ... hlight=nbr
Until support through future neobook releases you can simply rename the NBR to NBP for delivering.
As always testers wellcomed!
Hans-Peter
Just released hpwSimpleGraph 1.01:
http://www.hpwsoft.de/anmeldung/html1/n ... ook19.html
Variable: [hpwSimpleGraphDblClickAction] change to [RectangleName_DblClickAction]
Variable: [hpwSimpleGraphNodeDblClickAction] change to [RectangleName_NodeDblClickAction]
Variable: [hpwSimpleGraphLinkDblClickAction] change to [RectangleName_LinkDblClickAction]
Since it was late-night yesterday here some additional data:
Actionlist:
hpwSimpleGraphCreate = Append a SimpleGraph-Control to an existing NeoBook Rectangle object.
hpwSimpleGraphDelete = Remove a SimpleGraph-control previously attached to a Rectangle object.
hpwSimpleGraphShowGrid = Show or hide the grid of a SimpleGraph-control.
hpwSimpleGraphGridSize = Set the gridsize of a SimpleGraph-control.
hpwSimpleGraphNoZoom = Reset the zoom to 100 of a SimpleGraph-control.
hpwSimpleGraphZoomIn = Zoom in by 25 on a SimpleGraph-control.
hpwSimpleGraphZoomOut = Zoom out by 25 on a SimpleGraph-control.
hpwSimpleGraphZoomValue = Zoom to a specific value on a SimpleGraph-control.
hpwSimpleGraphNew = Start fresh with the simplegraph.
hpwSimpleGraphLoadFromFile = Load a graph from file in a SimpleGraph-control.
hpwSimpleGraphSaveToFile = Save a graph to file of a SimpleGraph-control.
hpwSimpleGraphLoadFromExe = Load a graph from Exe in a SimpleGraph-control.
hpwSimpleGraphPrint = Prints a graph on a printer.
hpwSimpleGraphExportToEMF = Exports the graph to EMF-file.
hpwSimpleGraphCut = Cut selected graph-objects.
hpwSimpleGraphCopy = Copy selected graph-objects.
hpwSimpleGraphPaste = Paste selected graph-objects.
hpwSimpleGraphDeleteObj = Delete selected graph-objects.
hpwSimpleGraphSelectAll = Select all graph-objects.
hpwSimpleGraphInvertSelection = Invert selection of graph-objects.
hpwSimpleGraphBringToFront = Bring selected graph-objects to front.
hpwSimpleGraphSendToBack = Send selected graph-objects to back.
hpwSimpleGraphLockNodes = Lock/unlock node-graph-objects.
hpwSimpleGraphLockLinks = Lock/unlock link-graph-objects.
hpwSimpleGraphEditProperties = Edit properties of graph-Objects.
hpwSimpleGraphLabelFormat = Set label format of selected nodes.
hpwSimpleGraphLabelAlignH = Set horizontal label alignment of selected nodes.
hpwSimpleGraphLabelAlignV = Set vertical label alignment of selected nodes.
hpwSimpleGraphMode = Switch to different modes.
hpwSimpleGraphInsRectangle = Switch to insert rectangle mode.
hpwSimpleGraphInsRoundRectangle = Switch to insert rounded rectangle mode.
hpwSimpleGraphInsEllipse = Switch to insert ellipse mode.
hpwSimpleGraphInsTriangle = Switch to insert triangle mode.
hpwSimpleGraphInsRhomboid = Switch to insert rhomboid mode.
hpwSimpleGraphInsPentagon = Switch to insert pentagon mode.
hpwSimpleGraphInsHexagon = Switch to insert hexagon mode.
hpwSimpleGraphInsLink = Switch to insert link mode.
Variables
[hpwSimpleGraphCommandMode]
[hpwSimpleGraphBackColor]
[hpwSimpleGraphGridColor]
[hpwSimpleGraphMarkerColor]
[hpwSimpleGraphShowGrid]
[hpwSimpleGraphSnapToGrid]
[hpwSimpleGraphGridSize]
[hpwSimpleGraphZoomValue]
[hpwSimpleGraphFontName]
[hpwSimpleGraphFontColor]
[hpwSimpleGraphFontSize]
[hpwSimpleGraphFontStyle]
[hpwSimpleGraphFontCharset]
[hpwSimpleGraphShowhint]
[hpwSimpleGraphHint]
[hpwSimpleGraphCursor]
[hpwSimpleGraphLabelAlignH]
[hpwSimpleGraphLabelAlignV]
[hpwSimpleGraphNodeBgColor]
[hpwSimpleGraphNodeBoColor]
[hpwSimpleGraphNodeDefaultText]
[hpwSimpleGraphNodeBorderStyle]
[hpwSimpleGraphLinkBgColor]
[hpwSimpleGraphLinkBoColor]
[hpwSimpleGraphLinkLineWidth]
[hpwSimpleGraphLinkDefaultText]
[hpwSimpleGraphLinkBeginStyle]
[hpwSimpleGraphLinkBeginSize]
[hpwSimpleGraphLinkEndStyle]
[hpwSimpleGraphLinkEndSize]
[hpwSimpleGraphLinkLineStyle]
[RectangleName_KeyDownAction]
[RectangleName_DblClickAction]
[RectangleName_NodeDblClickAction]
[RectangleName_LinkDblClickAction]
http://www.hpwsoft.de/anmeldung/html1/n ... ook19.html
Variable: [hpwSimpleGraphDblClickAction] change to [RectangleName_DblClickAction]
Variable: [hpwSimpleGraphNodeDblClickAction] change to [RectangleName_NodeDblClickAction]
Variable: [hpwSimpleGraphLinkDblClickAction] change to [RectangleName_LinkDblClickAction]
Since it was late-night yesterday here some additional data:
Actionlist:
hpwSimpleGraphCreate = Append a SimpleGraph-Control to an existing NeoBook Rectangle object.
hpwSimpleGraphDelete = Remove a SimpleGraph-control previously attached to a Rectangle object.
hpwSimpleGraphShowGrid = Show or hide the grid of a SimpleGraph-control.
hpwSimpleGraphGridSize = Set the gridsize of a SimpleGraph-control.
hpwSimpleGraphNoZoom = Reset the zoom to 100 of a SimpleGraph-control.
hpwSimpleGraphZoomIn = Zoom in by 25 on a SimpleGraph-control.
hpwSimpleGraphZoomOut = Zoom out by 25 on a SimpleGraph-control.
hpwSimpleGraphZoomValue = Zoom to a specific value on a SimpleGraph-control.
hpwSimpleGraphNew = Start fresh with the simplegraph.
hpwSimpleGraphLoadFromFile = Load a graph from file in a SimpleGraph-control.
hpwSimpleGraphSaveToFile = Save a graph to file of a SimpleGraph-control.
hpwSimpleGraphLoadFromExe = Load a graph from Exe in a SimpleGraph-control.
hpwSimpleGraphPrint = Prints a graph on a printer.
hpwSimpleGraphExportToEMF = Exports the graph to EMF-file.
hpwSimpleGraphCut = Cut selected graph-objects.
hpwSimpleGraphCopy = Copy selected graph-objects.
hpwSimpleGraphPaste = Paste selected graph-objects.
hpwSimpleGraphDeleteObj = Delete selected graph-objects.
hpwSimpleGraphSelectAll = Select all graph-objects.
hpwSimpleGraphInvertSelection = Invert selection of graph-objects.
hpwSimpleGraphBringToFront = Bring selected graph-objects to front.
hpwSimpleGraphSendToBack = Send selected graph-objects to back.
hpwSimpleGraphLockNodes = Lock/unlock node-graph-objects.
hpwSimpleGraphLockLinks = Lock/unlock link-graph-objects.
hpwSimpleGraphEditProperties = Edit properties of graph-Objects.
hpwSimpleGraphLabelFormat = Set label format of selected nodes.
hpwSimpleGraphLabelAlignH = Set horizontal label alignment of selected nodes.
hpwSimpleGraphLabelAlignV = Set vertical label alignment of selected nodes.
hpwSimpleGraphMode = Switch to different modes.
hpwSimpleGraphInsRectangle = Switch to insert rectangle mode.
hpwSimpleGraphInsRoundRectangle = Switch to insert rounded rectangle mode.
hpwSimpleGraphInsEllipse = Switch to insert ellipse mode.
hpwSimpleGraphInsTriangle = Switch to insert triangle mode.
hpwSimpleGraphInsRhomboid = Switch to insert rhomboid mode.
hpwSimpleGraphInsPentagon = Switch to insert pentagon mode.
hpwSimpleGraphInsHexagon = Switch to insert hexagon mode.
hpwSimpleGraphInsLink = Switch to insert link mode.
Variables
[hpwSimpleGraphCommandMode]
[hpwSimpleGraphBackColor]
[hpwSimpleGraphGridColor]
[hpwSimpleGraphMarkerColor]
[hpwSimpleGraphShowGrid]
[hpwSimpleGraphSnapToGrid]
[hpwSimpleGraphGridSize]
[hpwSimpleGraphZoomValue]
[hpwSimpleGraphFontName]
[hpwSimpleGraphFontColor]
[hpwSimpleGraphFontSize]
[hpwSimpleGraphFontStyle]
[hpwSimpleGraphFontCharset]
[hpwSimpleGraphShowhint]
[hpwSimpleGraphHint]
[hpwSimpleGraphCursor]
[hpwSimpleGraphLabelAlignH]
[hpwSimpleGraphLabelAlignV]
[hpwSimpleGraphNodeBgColor]
[hpwSimpleGraphNodeBoColor]
[hpwSimpleGraphNodeDefaultText]
[hpwSimpleGraphNodeBorderStyle]
[hpwSimpleGraphLinkBgColor]
[hpwSimpleGraphLinkBoColor]
[hpwSimpleGraphLinkLineWidth]
[hpwSimpleGraphLinkDefaultText]
[hpwSimpleGraphLinkBeginStyle]
[hpwSimpleGraphLinkBeginSize]
[hpwSimpleGraphLinkEndStyle]
[hpwSimpleGraphLinkEndSize]
[hpwSimpleGraphLinkLineStyle]
[RectangleName_KeyDownAction]
[RectangleName_DblClickAction]
[RectangleName_NodeDblClickAction]
[RectangleName_LinkDblClickAction]
Hans-Peter
Hans-Peter:
Just downloaded latest version ... and this time I installed and tested (sample) pub ... I echo David P's sentiments ... nice plugin with many uses for NeoBook developers ... especially liked how images can be displayed inside shapes (triangle, rounded rectangles, ellipses etc.)
Wonder if anyone has asked original author for enhancements like ...
- background color gradients (horizontal, vertical or circular bands of colors)
- display background images with special effects (like fish-eye, gaussian blur etc.)
- text rendered at angles (other than horizontal)
- save to files other than emf format (png/jpg)
Just downloaded latest version ... and this time I installed and tested (sample) pub ... I echo David P's sentiments ... nice plugin with many uses for NeoBook developers ... especially liked how images can be displayed inside shapes (triangle, rounded rectangles, ellipses etc.)
... wasn't too sure of this ... the .nbp file is 343 KB and the .nbr is 321 KB ... what does .nbp have that .nbr does not ? ... and if you don't rename, is there anything more than the 22 KB penalty ?Until support through future neobook releases you can simply rename the NBR to NBP for delivering.
... not really a bug ... but a deficiency in NeoBook re: Embedded Files ... the list is not "portable" ... so when developers have NeoBook installed in a folder other than yours, the Book >>> Embedded Files ... stuff has to be redefined for your sample pub ... otherwise hpwSimpleGraphLoadFromExe does not work.As always testers wellcomed!
Wonder if anyone has asked original author for enhancements like ...
- background color gradients (horizontal, vertical or circular bands of colors)
- display background images with special effects (like fish-eye, gaussian blur etc.)
- text rendered at angles (other than horizontal)
- save to files other than emf format (png/jpg)
Gaev,
So here it is not more than the 22 KB penalty.
But for me it is a first test to build such function without much developer overhead. So I learned new things about compiler directives and I can now switch from one source to both options. Thats the way to go for other plugins. And when it gets to Non-VCL plugins, then the differents becomes >300KB.
http://www.neosoftware.com/forum/viewtopic.php?t=13566
So at least it is on the list!
This time it has not so much wizards. In fact 4 small dialogs are included.... wasn't too sure of this ... the .nbp file is 343 KB and the .nbr is 321 KB ... what does .nbp have that .nbr does not ? ... and if you don't rename, is there anything more than the 22 KB penalty ?
So here it is not more than the 22 KB penalty.
But for me it is a first test to build such function without much developer overhead. So I learned new things about compiler directives and I can now switch from one source to both options. Thats the way to go for other plugins. And when it gets to Non-VCL plugins, then the differents becomes >300KB.
See my posthere:... not really a bug ... but a deficiency in NeoBook re: Embedded Files ... the list is not "portable" ... so when developers have NeoBook installed in a folder other than yours, the Book >>> Embedded Files ... stuff has to be redefined for your sample pub ... otherwise hpwSimpleGraphLoadFromExe does not work.
http://www.neosoftware.com/forum/viewtopic.php?t=13566
So at least it is on the list!
I do not know, but it seems he want to make a generic graphing-tool and not another image manipulation component. You may ask on the delphiarea-forum.Wonder if anyone has asked original author for enhancements like ...
Last edited by HPW on Mon Mar 13, 2006 12:02 am, edited 2 times in total.
Hans-Peter
Question on usage
When I create an object in the graph and double click on it I get a panel to describe the attributes of the object. The first attribute is whether the item is linkable or not. Does this only apply to linking objects with the arrow/line tool?
Is there a way to associate NB actions with any of these graphical items that are created? For example, if one shape is clicked to set a variable? Or would we do that in a manner similar to a map of the image determining the value of the data (as in a web page).
David P.
Is there a way to associate NB actions with any of these graphical items that are created? For example, if one shape is clicked to set a variable? Or would we do that in a manner similar to a map of the image determining the value of the data (as in a web page).
David P.
David P:
... so you can specify a routine to be called to handle each of these events ... then examine the mouse position to determine the shape underneath it ... though I do not see any mechanism to define/identify "currently selected shape" ... would ne nice to have the plugin populate reserved variables with such information ... like your Grid plugin.
Hans-Peter:
hpwSimpleGraphEditProperties pops up a dialog box for the end-user ... however, its style may not match the rest of the (NeoBook) objects on the same page ... might be preferable to provide developer with (scripted) control of these properties ... I see some reserved variables but not sure how one would deploy them to change an individual shape's properties at run time via script.
In Hans-Peter's sample pub, the button labelled Create Graph has this code (at the end of the click section) ...Is there a way to associate NB actions with any of these graphical items that are created? For example, if one shape is clicked to set a variable? Or would we do that in a manner similar to a map of the image determining the value of the data (as in a web page).
Code: Select all
Setvar "[RSimpleGraph_DblClickAction]" "hpwSimpleGraphEditProperties [#34]RSimpleGraph[#34]"
Setvar "[RSimpleGraph_NodeDblClickAction]" "hpwSimpleGraphEditProperties [#34]RSimpleGraph[#34]"
Setvar "[RSimpleGraph_LinkDblClickAction]" "hpwSimpleGraphEditProperties [#34]RSimpleGraph[#34]"
hpwSimpleGraphCreate "RSimpleGraph" "[GraphXSize]" "[GraphYSize]"
Hans-Peter:
hpwSimpleGraphEditProperties pops up a dialog box for the end-user ... however, its style may not match the rest of the (NeoBook) objects on the same page ... might be preferable to provide developer with (scripted) control of these properties ... I see some reserved variables but not sure how one would deploy them to change an individual shape's properties at run time via script.
David,
But he is also right that it is of limited use for now.
Gaev,
hpwSimpleGraphLabelAlignH
hpwSimpleGraphLabelAlignV
are an example how to set properties in one or more selected objects.
More of that might make sense.
I had to think about 2 kinds of commands. One for interactivly choosen objets and a pure code solution (without any selection). Also pure scripted content creation is on the wish-list.
For the integration into neobook might be more necessary.
Generic left,right and middle click action(edit and viewonly-mode?)
So 1.0 was a start on the base of the TSimpleGraph demo.
As always I see this as a living project which will get improved over time.
So don't resist and keep ideas flowing.
Yes.When I create an object in the graph and double click on it I get a panel to describe the attributes of the object. The first attribute is whether the item is linkable or not. Does this only apply to linking objects with the arrow/line tool?
Gaev is right with his RSimpleGraph_NodeDblClickAction.Is there a way to associate NB actions with any of these graphical items that are created? For example, if one shape is clicked to set a variable? Or would we do that in a manner similar to a map of the image determining the value of the data (as in a web page).
But he is also right that it is of limited use for now.
Gaev,
OnSelect there are some variabel populated for example [RSimpleGraph_SelText], but this might be not sufficient enough. Kambiz has provide a TAG property (Integer) for each object, which is empty in the moment. It's part of the programmer to use such field to build a unique identifier. When we want to use such a field, it has to be incremented each time an object is created. Deleted objects may leave holes in the numbering sheme. For now you could use the TEXT-property but you may want to use an emty TEXT.... so you can specify a routine to be called to handle each of these events ... then examine the mouse position to determine the shape underneath it ... though I do not see any mechanism to define/identify "currently selected shape" ... would ne nice to have the plugin populate reserved variables with such information ... like your Grid plugin.
For that reason they are called by script. So you have the control if you want to use them not. (The dialogs are the original demo-dialogs (D7) slightly modified to use them under D5.)..pops up a dialog box for the end-user ... however, its style may not match the rest of the (NeoBook) objects on the same page ...
hpwSimpleGraphLabelFormat>I see some reserved variables but not sure how one would deploy them to change an individual shape's properties at run time via script.
hpwSimpleGraphLabelAlignH
hpwSimpleGraphLabelAlignV
are an example how to set properties in one or more selected objects.
More of that might make sense.
I had to think about 2 kinds of commands. One for interactivly choosen objets and a pure code solution (without any selection). Also pure scripted content creation is on the wish-list.
For the integration into neobook might be more necessary.
Generic left,right and middle click action(edit and viewonly-mode?)
So 1.0 was a start on the base of the TSimpleGraph demo.
As always I see this as a living project which will get improved over time.
So don't resist and keep ideas flowing.
Hans-Peter
Hans_Peter:
With a comprehensive set of scripting commands, this can extend NeoBook in the deployment of applications for Diagramming, Org Charts, Business Charting ... even card games, puzzles ... and if composite images can be exported to jpg/png files, it can be the basis of an image builder application.
... there are many parallels between your hpwGrid plugin and this one ... each is better in some aspects ... so, to quote a famous plugin developer, always use the right tool (plugin) for the job ... having said that, you might look at providing for this plugin the same type of properties, methods and event triggers as you have for the grid plugin ... just think of each shape as a cell ... a cell with more features than plain text (shape type, background image/color, border color, not restricted to rows and columns nor common sizes and positions) ... that should keep you busy for the next ... few hoursSo don't resist and keep ideas flowing.
With a comprehensive set of scripting commands, this can extend NeoBook in the deployment of applications for Diagramming, Org Charts, Business Charting ... even card games, puzzles ... and if composite images can be exported to jpg/png files, it can be the basis of an image builder application.
Gaev,
yesterday I had a chance to have a look at a prerelease doku of the upcoming TSimpleGraph 2.1 and it seems that Kambiz had heard some of your wishes. As soon as it is released I will pick it up and will add some of the new features. With something like a new introduced 'UniqueID' a lot of things become easier.
http://www.delphiarea.com/forum/viewtopic.php?t=656
The bad news : Not in a few hours!
yesterday I had a chance to have a look at a prerelease doku of the upcoming TSimpleGraph 2.1 and it seems that Kambiz had heard some of your wishes. As soon as it is released I will pick it up and will add some of the new features. With something like a new introduced 'UniqueID' a lot of things become easier.
http://www.delphiarea.com/forum/viewtopic.php?t=656
The bad news : Not in a few hours!
Hans-Peter
Good job, Hans! Another item for the nb toolbox. Thanks for your efforts.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com