CPIndex: Integer;
The CPIndex property returns the index of the connection point that should be moved.
Lines have two points: start point with the 0 index and the end point with the 1 index.
Executing the example requires a form, a button named the Button1 on the form, the UiEtlObject component named UiEtlObject1 and the EtlBox component named EtlBox1. UiEtlObject1 is selected as a data source for EtlBox1. Any ETL task is connected to UiEtlObject1. The OnCreate event handler is created for a form, the OnBeforeMoveCP and OnAfterMoveCP event handlers are created for the EtlBox1 component.
Add links to the Andy, and ETL system assemblies.
Class SAMPLEForm: Form
UiEtlObject1: UiEtlObject;
EtlBox1: EtlBox;
Sub SAMPLEFormOnCreate(Sender: Object; Args: IEventArgs);
Begin
EtlBox1.ActiveTool := WxTool.Pointer;
End Sub SAMPLEFormOnCreate;
Sub EtlBox1OnBeforeMoveCP(Sender: Object; Args: IEtlMoveCPEventArgs);
Begin
If Args.CPIndex = 0 Then
Args.Cancel := True
End If;
Debug.WriteLine("Shape: " + Args.Shape.Id);
End Sub EtlBox1OnBeforeMoveCP;
Sub EtlBox1OnAfterMoveCP(Sender: Object; Args: IEtlAttachCPEventArgs);
Begin
Debug.WriteLine("Shape: " + Args.ShapeToAttach.Id + ". End point: " + Args.CPIndexToAttach.ToString);
End Sub EtlBox1OnAfterMoveCP;
End Class SAMPLEForm;
After executing the example, the pointer mode is activated for the EtlBox1 component where object bindings can be modified. If it is attempted to move the point with the 0 index (that is, the start point), the moving will be forbidden. Identifiers of shapes and shape point, with which the link is created, will be displayed in the development console.
See also: