TTMSFNCBloxLine Class
Base class for all line objects that connect two points on a diagram.
API unit family: TMSFNCBloxCoreLine
Inherits from: TTMSFNCBloxElement
Syntax
TTMSFNCBloxLine = class(TTMSFNCBloxElement)
Remarks
Do not create an instance of this class directly; descend from it to implement a custom line. The key extension points are CalcNewHandles and RecalcPoints: override them to provide a custom line algorithm.
Properties
| Name | Description |
|---|---|
| LineStyle | Selects which shape is drawn for the line; the style can be switched at runtime. |
| Points | The ordered points that define the drawn path of the line; segments are drawn from each point to the next. |
| RecalcIntermediateArcHandles | When True, the intermediate handles of an arc line are recomputed automatically when the line is moved or its anchors change. |
| RequiresConnections | When True, the line must be connected to a block at both its start and end points; the user cannot insert, move, or resize it unless both ends are connected. |
| SourceArrow | The arrow shape drawn at the start point of the line. |
| SourceHandle | The handle at the start point of the line, or nil when none exists. |
| SourceLinkPoint | The link point associated with the start point of the line. Read or assign its anchor to connect the line's start point. |
| TargetArrow | The arrow shape drawn at the end point of the line. |
| TargetHandle | The handle at the end point of the line, or nil when none exists. |
| TargetLinkPoint | The link point associated with the end point of the line. Read or assign its anchor to connect the line's end point. |
Methods
| Name | Description |
|---|---|
| AnchorLinkChanged | Recalculates the line's anchors when the anchor of the given link point changes. |
| CalcNewHandles | Recalculates the handles of the line from the supplied geometry information. |
| ElementRect | Returns the smallest rectangle, in element coordinates, that contains all line points. |
| EndCursorPlacement | Restores the original handles after cursor placement ends. |
| GetLinkPoint | Returns the current position of the endpoint associated with the given link point. |
| HandleMoving | Recalculates the line while one of its handles is being dragged. |
| HandlesChanged | Recalculates the text cells whenever the handle collection changes. |
| LinkPointByHandle | Returns the link point associated with the given start or end handle of the line. |
| LinkedAnchorChanged | Responds to a change of an anchor the line is linked to by recalculating the line's anchors and geometry. |
| MovePosition | Offsets every handle of the line by the given amounts, moving the whole line. |
| PointInElement | Determines whether a point lies on or close to the line. |
| StartCursorPlacement | Swaps in the temporary handles so the line can be drawn at the cursor position. |
| StartMoving | Captures the current handles before a move of the whole line begins. |
| StartMovingHandle | Captures the current handles before a handle drag begins. |
| SurroundRect | Returns the smallest rectangle, in element coordinates, that surrounds the line. |
| TextCellDestroyed | Notifies the line that one of its text cells has been destroyed so it can clear the matching internal reference. |
| UpdateDrawing | Handles interactive drawing of the line. |
| UpdateInserting | Recalculates the line while it is being inserted and binds its endpoints to the supplied anchors. |
| UpdateMoving | Recalculates the line while it is being moved. |