TSimpleGraph
v1.08
|
Copyright ©
Kambiz R. Khojasteh. All rights reserved.
Get future component updates from http://www.delphiarea.com.
Delphi 4 | Delphi 5 | Delphi 6 | Delphi 7 |
TSimpleGraph is a visual component, which provides a simple user interface for drawing schematic graphs. User can draw nodes on the control's client area and link them together by either keyboard or mouse. Currently the component supports three different shapes for the nodes, however the new shapes can be added. The component is fully customizable and has methods for supporting Delphi's clipboard and printer objects.
TSimpleGraph
= class(TCustomControl) TSimpleGraph is a windowed control that provides a canvas for drawing a graph. It also manages relation between graph objects and the application.
|
TGraphObjectList
= class(TList)
|
TGrephObjectClass
= class of TGraphObject
|
TGraphLinkClass
= class of TGraphLink
|
TGraphNodeClass
= class of TGraphNode
|
TRectangularNode
= class(TGraphNode) |
TRoundRectangularNode
= class(TGraphNode) |
TEllipticNode
= class(TGraphNode) |
TGraphScrollBar
= class(TPersistent) |
function
ReadGraphObject(Stream: TStream; Owner: TSimpleGraph): TGraphObject; |
procedure
WriteGraphObject(Stream: TStream; GraphObject: TGraphObject); |
procedure
RotatePoints(var Points: array of TPoint; Angle: Extended; const Org:
TPoint); Rotates points specified by the Points parameter across a point specified by the Org parameter. The amount of rotation specifies by the Angle parameter in radians. |
function
MakeRect(const Corner1, Corner2: TPoint): TRect; Returns a rectangle by specifying its two corners. |
function
CenterOfRect(const Rect: TRect): TPoint; Returns the center point of the rectangle specified by Rect parameter. |
function
DistanceToLine(const LinePt1, LinePt2, QueryPt: TPoint): Integer; Returns the distance of a point specified by QuaryPt parameter from the a specified by LinePt1 and LinePt2 parameters. |
function
NextPointOfLine(LineAngle: Extended; const ThisPoint: TPoint; Distance:
Integer): TPoint; Returns the cordinates of a point, which is on a line defines as LineAngle and ThisPoint parameters, and distance of the point from ThisPoint parameter is specified by Distance parameter. |
function
IntersectLineRect(LineAngle: Extended; const Bounds: TRect; Backward:
Boolean): TPoint; Retruns the intersection cordinate of a rectangle specified by the Bounds parameter with a line that pass through center of the rectangle with an angle specified by LineAngle parameter in radians. Because there are two intersection points, use Backward parameter to specify your desired one. |
function
IntersectLineRoundRect(LineAngle: Extended; const Bounds: TRect; Backward:
Boolean; Rgn: HRgn): TPoint; Retruns the intersection cordinate of a round rectangle specified a Bounds and Rgn parameters with a line that pass through center of the round rectangle with an angle specified by LineAngle parameter in radians. Because there are two intersection points, use Backward parameter to specify your desired one. |
function
IntersectLineEllipse(LineAngle: Extended; const Bounds: TRect; Backward:
Boolean): TPoint; Retruns the intersection cordinate of an ellipse specified a Bounds parameter with a line that pass through center of the ellipse with an angle specified by LineAngle parameter in radians. Because there are two intersection points, use Backward parameter to specify your desired one. |
Key | Function | |
Left | Moves the selected objects to the left by the number of pixels specified by the GridSize property. | |
Right | Moves the selected objects to the right by the number of pixels specified by the GridSize property. | |
Up | Moves up the selected objects by the number of pixels specified by the GridSize property. | |
Down | Moves down the selected objects by the number of pixels specified by the GridSize property. | |
Ctrl+Left | Moves the selected objects to the left by one pixel. | |
Ctrl+Right | Moves the selected objects to the right by one pixel. | |
Ctrl+Up | Moves up the selected objects by one pixel. | |
Ctrl+Down | Moves down the selected objects by one pixel. | |
Shift+Left | Decreases width of the selected objects by the number of pixels specified by the GridSize property. | |
Shift+Right | Increases the width of the selected objects by the number of pixels specified by the GridSize property. | |
Shift+Up | Decreases the height of the selected objects by the number of pixels specified by the GridSize property. | |
Shift+Down | Increases the height of the selected objects by the number of pixels specified by the GridSize property. | |
Shift+Ctrl+Left | Decreases width of the selected objects by one pixel. | |
Shift+Ctrl+Right | Increases width of the selected objects by one pixel. | |
Shift+Ctrl+Up | Decreases height of the selected objects by one pixel. | |
Shift+Ctrl+Down | Increases height of the selected objects by one pixel. | |
Del | Deletes the selected objects. | |
Enter | Fires the OnObjectDblClick event for each selected object. | |
Esc | Deselects the selected objects. | |
Ins | Inserts a new node. | |
Ctrl+Ins | Links selected nodes together. | |
Tab | Selects the next node. | |
Shift+Tab | Selects the prior node. | |
Ctrl+Tab | Selects the next link. | |
Shift+Ctrl+Tab | Selects the prior link. | |
Ctrl+X | Cuts the selected objects in the Clipboard. | |
Ctrl+C | Copies the selected objects in the Clipboard. | |
Ctrl+V | Pastes the Clipboard's Contents in the graph. |
Special thanks to:
TSimpleGraph component is freeware. You may copy component's files AS LONG AS YOU COPY ALL OF THEM. If you want to change the source code in order to improve the component's features, performance, etc. please send me the new source code so that I can have a look at it. The changed source code should contain descriptions what you have changed, and of course your name. The only thing you MAY NOT CHANGE is the ORIGINAL COPYRIGHT INFORMATION.
TSimpleGraph component is provided "AS IS" without any warranty of any kind, either express or implied. The entire risk as to the quality and performance of the software is with you. The author is NOT liable for any DAMAGES resulting from the use and misuse of the component, especially he is NOT liable for DAMAGES that were caused BY ANY VERSION WHICH HAS NOT BEEN PROGRAMMED BY THE AUTHOR HIMSELF.
|
END OF DOCUMENT |