TTMSFNCBloxXBlox Class
Owns and manages the diagram model: the collection of elements, the subset of blocks and links, the layers, and the background. Provides methods to add, remove, locate, reorder, and link elements, and to persist the diagram to and from files or streams.
API unit family: TMSFNCBloxCoreDiagram
Inherits from: TTMSFNCBloxCustomBlox
Implements: ITMSFNCPersistence, ILayerCallback
Syntax
TTMSFNCBloxXBlox = class(TTMSFNCBloxCustomBlox, ITMSFNCPersistence, ILayerCallback)
Remarks
Acts as the central container that the host control binds to. Blocks and links are derived views over the same element collection: every element added through Add participates in the element list, while the block and link lists expose only the matching element kinds.
Properties
| Name | Description |
|---|---|
| Background | Gets the background of the diagram, including its grid and fill appearance. |
| BlockCount | Gets the number of block elements in the diagram. |
| Blocks | Provides indexed access to the block elements in the diagram. |
| Callback | Gets or sets the callback interface used to relay diagram notifications to the host. |
| ElementCount | Gets the number of elements in the diagram. |
| Elements | Provides indexed access to the elements in the diagram. |
| Layers | Gets the collection of layers that group and control the visibility of elements in the diagram. |
| LinkCount | Gets the number of link elements in the diagram. |
| Links | Provides indexed access to the link elements in the diagram. |
| ShowCrossIndicators | Determines whether cross indicators are shown where links intersect. |
Methods
| Name | Description |
|---|---|
| Add | Adds an element to the diagram. Blocks and links become available through the corresponding block and link views. |
| AreBlocksLinked | Indicates whether two blocks are directly connected by a link. |
| Clear | Removes and frees all elements, leaving an empty diagram. |
| Extract | Removes an element from the diagram without freeing it, transferring ownership to the caller. |
| FindElement | Finds the element with the given identifier. |
| IndexOfElement | Returns the position of an element within the element list. |
| LinkBetweenBlocks | Creates a link connecting two blocks and adds it to the diagram. |
| LoadSettingsFromFile | Loads a diagram from a file, replacing the current elements, layers, and background settings. |
| LoadSettingsFromStream | Loads a diagram from a stream, replacing the current elements, layers, and background settings. |
| MoveElementIndex | Moves an element to a new position in the element order, which affects the z-order in which elements are drawn. |
| Remove | Removes an element from the diagram and frees it, together with any links that depend on it. |
| SaveSettingsToFile | Saves the diagram to a file, persisting all elements, layers, and background settings. |
| SaveSettingsToStream | Saves the diagram to a stream, persisting all elements, layers, and background settings. |