Table of Contents

TTMSFNCBloxElement Class

Abstract base (top ancestor) class for all diagram elements, both lines and blocks.

API unit family: TMSFNCBloxCoreElement Inherits from: TTMSFNCBloxBaseElement

Syntax

TTMSFNCBloxElement = class(TTMSFNCBloxBaseElement)

Remarks

Do not instantiate this class directly; it is abstract. To create a new block, descend from a block class; to create a new line, descend from a line class. Descending directly from this class is uncommon and only needed for fundamentally different element types.

Properties

Name Description
Angle Specifies the rotation angle of the element, in degrees.
AutoCreateLinkPoints Determines whether the block always accepts a connection even when no matching link point exists. When True, an implicit link point is created where a line connects to the block.
Cursor Specifies the mouse cursor shown when the pointer is over the element.
DataBoolean Stores an arbitrary boolean value associated with the element for application use.
DataInteger Stores an arbitrary integer value associated with the element for application use.
DataObject Stores an arbitrary object reference associated with the element for application use.
DataPointer Stores an arbitrary pointer associated with the element for application use.
DataString Stores an arbitrary string value associated with the element for application use.
DgrDrawer Provides the internal block drawer used while rendering the element.
Drawer Provides the block drawer used to assist in rendering the element.
ElementId Gets or sets the element identifier; when empty, the class name is returned.
FillColor Gets or sets the primary fill color of the element.
FillColorTo Gets or sets the secondary fill color used for gradient fills.
FillType Gets or sets how the element is filled.
FontName Gets or sets the font name applied to the element's text cells.
FontSize Gets or sets the font size applied to the element's text cells.
FontStyle Gets or sets the font style applied to the element's text cells.
GradientStyle Gets or sets the gradient style used when the element is filled with a gradient.
GroupBlock Returns the immediate group block the element belongs to, or nil when it is not grouped.
Handles Provides the collection of resize and rotation handles of the element.
HandlesAppearance Gets or sets the appearance overrides applied to the element's handles.
Hint Holds the hint text shown for the element.
IsBackgroundElement Determines whether the element is a background element. When True, the element is painted before regular elements and appears behind them.
IsDisplaying Returns whether the element is effectively displayed, considering visibility and collapsed state.
IsGroup Returns whether the element is a group that holds other elements. True when it is a group.
IsMember Returns whether the element belongs to a group. True when grouped.
IsSelection Returns whether the element represents the current selection. True when it is a selection.
IsTextEditing Determines whether the element is currently in text-editing mode. True while editing.
Layer Specifies the index of the layer the element belongs to.
LayerName Gets or sets the layer the element belongs to, identified by its name.
LayerObj Specifies the layer object the element belongs to.
LinkPointStyle Reserved for future use; not used in the current version.
LinkPoints Provides the collection of link points of the element.
MasterGroup Returns the top-level group block that holds the element across all nesting levels. Unlike GroupBlock, which returns the immediate group, this returns the outermost group.
Obj Associates an arbitrary object with the element. The object is not used internally and is not saved with the diagram.
PaintMode Controls how the element is painted, including or limiting painting to the editing cursor.
Restrictions Specifies which actions the end user cannot perform on the element, such as moving, resizing, or editing text.
ShowHint Determines whether a hint is shown when the pointer rests over the element. When True, a hint is displayed.
StringData Holds arbitrary string information associated with the element. It is not used internally but is saved with the diagram, so it can carry persistent data.
Stroke Provides the stroke used to draw the element's border.
StrokeColor Gets or sets the stroke color used to draw the element's border.
StrokeStyle Gets or sets the style of the element's border stroke.
StrokeWidth Gets or sets the width of the element's border stroke.
Text Gets or sets the text of the active text cell of the element.
TextAlignment Gets or sets the horizontal text alignment of the active text cell.
TextCells Provides the collection of text cells of the element.
TextColor Gets or sets the text color of the active text cell.
TheBlox References the owning diagram, used to resolve cross-element calculations.
Visible Determines whether the element is requested to be visible. When True, the element is shown, subject to the active layers and to whether it is collapsed by a node.

Methods

Name Description
AddAnchored Records that another link point is anchored to one of this element's link points.
AnchorLinkChanged Called when the anchor link of the given link point changes, including changes to its anchor link, anchor, or anchor index.
BeginNotifying Increments the notification nesting counter to suppress nested anchor notifications.
BloxDrawInfo Returns paint information populated with the supplied canvas and drawer.
CanDoClipboard Returns whether the element may take part in clipboard operations.
CanEditText Returns whether the element's text may be edited by the user.
CanLink Returns whether the element may be linked to other elements.
CanMove Returns whether the element may be moved by the user.
CanMoveRotCenter Returns whether the element's rotation center may be moved by the user.
CanResize Returns whether the element may be resized by the user.
CanRotate Returns whether the element may be rotated by the user.
CanSelect Returns whether the element may be selected by the user.
Click Called when the element is clicked.
DblClick Called when the element is double-clicked.
DefaultTextCell Returns the default text cell of the element, creating one when none exists.
DrawHandle Draws the specified handle on the canvas at the given point.
DrawLinkPoint Draws the specified link point on the canvas at the given point.
DrawTemporary Draws a temporary representation of the element while it is being manipulated.
ElementRect Returns the smallest rectangle that contains the whole element, ignoring rotation.
EndCursorPlacement For internal use.
EndNotifying Decrements the notification nesting counter started by BeginNotifying.
GetBloxDrawInfo Returns paint information populated with the current drawer and the supplied canvas.
GetHandlePos Returns the coordinates of the specified handle. Descendants can override this to convert their own handle coordinates into element coordinates.
GetLinkPoint Returns the coordinates of the specified link point. Descendants can override this to convert their own link point coordinates into element coordinates.
GetTextCellRect Converts the relative rectangle of a text cell into canvas coordinates. Block descendants override this to translate relative cell coordinates using their own size.
HandleDestroyed Called when a handle is destroyed.
HandleMoving Called once for each pointer move while a handle is being moved, so descendants can react to the handle movement.
HandlesChanged Called when the handles collection changes.
HasAnchorableLinkPoints Returns whether the element has link points that can be anchored to other link points.
HasDefaultTextCell Returns whether the element has a default text cell.
IncludedInGroup Called when the element is added to a group.
InsertMouseState Returns the interaction state to enter when this element starts being added.
Inserted Called after the element has been inserted into the diagram.
LayerEditable Returns whether the layer the element belongs to is currently editable.
LinkPointByHandle Returns the link point associated with the specified handle, if any.
LinkedAnchorChanged Called when a change occurs to the anchor that the given link point is attached to, so this element can react to the change.
MouseDown Called when the user presses a mouse button while the pointer is over the element.
MouseDownEx Called when the user presses a mouse button while the pointer is over the element, also reporting the handle involved.
MouseMove Called when the user moves the pointer over the element.
MouseUp Called when the user releases a mouse button while the pointer is over the element.
MovePosition Moves the element by the given horizontal and vertical offsets.
NotifyAnchoreds Notifies all elements anchored to this element when this element is moved or removed, so they can reposition themselves.
Paint Paints the element on the supplied canvas.
Perform Invokes the supplied method on this element.
PointInElement Returns whether the given point lies inside the element.
Redraw Forces the element to be redrawn.
RemoveAnchored Removes a previously recorded anchor from one of this element's link points.
Removed Called after the element has been removed from the diagram.
RemovedFromGroup Called when the element is removed from a group.
RestoreLayer Reassigns the element to its current layer object based on its layer settings.
SelectNextCell Returns the next or previous editable text cell, starting from the given cell.
SetActiveHandlesAppearance Applies the element's own handle appearance overrides onto the supplied appearance.
StartCursorPlacement For internal use.
StartMoving Called when the element is about to be moved by the user.
StartMovingHandle Called when a handle of the element is about to be moved by the user.
SurroundRect Returns the smallest rectangle that contains the whole element, taking rotation into account.
TextCellDestroyed Called when a text cell is destroyed.
TextCellsChanged Called when the element's text cells change.
UpdateDrawing Called once for each click, drag, or release while the element is being drawn over multiple steps (such as poly lines or polygons), so descendants can react to the drawing.
UpdateInserting Called once for each click, drag, or release while the element is being inserted, so descendants can react to the insertion.
UpdateMoving Called once for each pointer move while the element is being moved, so descendants can react to the movement.

Events

Name Description
OnVisibilityChanged Occurs after the element's visibility changes.

Used by