TabObjectMovingEventArgs.Create

Syntax

Create(Sheet: ITabSheetBox; Object: ITabObject; Rect: IGxRectF; [Cancel: Boolean]);

Parameters

Sheet. Component, for which event is generated.

Object. Object, for which event is generated.

Rect. Coordinates of rectangular area occupied by the object.

Cancel. It determines whether object moving is canceled.

Description

The Create constructor creates an argument of the event occurring on object moving.

Example

Executing the example requires a form containing the TabSheetBox component named TabSheetBox1 and the UiReport component named UiReport1 that is a data source for TabSheetBox1. Set the Active property of the UiReport1 component to True. UiReport1 must contain loaded regular report with shapes on the active list.

A custom handler for the OnObjectMoving event is created and called in the TabSheetBox1 component in the example.

Add links to the Drawing, Tab, Ui system assemblies.

// Create a custom handler of the OnObjectMoving event
Sub UserOnObjectMoving(Sender: Object; Args: ITabObjectMovingEventArgs);
Begin
    Args.Cancel := 
Not WinApplication.ConfirmationBox("Move object: " + Args.Object.Id + "?");
End Sub UserOnObjectMoving;
// Call custom handler of the OnObjectMoving event
Public Sub UserProc;
Var
    Tab: ITabSheet;
    rObject: ITabObject;
    Rect: IGxRectF;
    Argument: ITabObjectMovingEventArgs;
Begin
    Tab := TabSheetBox1.Source.GetTabSheet;
    rObject := Tab.Objects.Object(
"PrxShape1");
    Argument := 
New TabObjectMovingEventArgs.Create(TabSheetBox1, rObject, Rect, False);
    UserOnObjectMoving(TabSheetBox1, Argument);
End Sub UserProc;

After executing the example the UserProc procedure calls the UserOnObjectMoving custom handler.

See also:

TabObjectMovingEventArgs