TabBeforeObjectRectChangeEventArgs.Create

Fore Syntax

TabBeforeObjectAngleChangeEventArgs(TabSheet: ITabSheetBox;
                       Object: ITabObject;
                       Type: TabObjectChangeType;

                       Value: IGxRectF;

                       Cancel: Boolean);

Fore.NET Syntax

TabBeforeObjectAngleChangeEventArgs(TabSheet: Prognoz.Platform.Interop.Tab.TabSheetBox;
                       Object: Prognoz.Platform.Interop.Tab.ITabObject;
                       Type: Prognoz.Platform.Interop.Tab.TabObjectChangeType;

                       Value: Prognoz.Platform.Interop.Drawing.IGxRectF;

                       Cancel: boolean);

Parameters

TabSheet. The component, for which an event is generated.

Object. An object, for which an event is generated.

Type. Type of change that occurs with an object.

Value. Object's new position and size.

Cancel. Indicates whether object rotation must be canceled.

Description

The Create constructor creates an argument of the event that occurs before moving or resizing an object.

Comments

By default event arguments are generated automatically on occurring an event. A constructor is required for manual calling the event. For details about manual event generation see the Manual generation of Events section.

Available values of the Cancel parameter:

Fore Example

Executing the example requires a form containing the components:

  1. TabSheetBox with the TabSheetBox1 identifier. The OnBeforeObjectChange event handler must be assigned for this component.

  2. UiReport with the UiReport1 identifier that is a data source for TabSheetBox1. UiReport1 must also be active and contain a loaded regular report with shapes on an active sheet.

Add a link to the Drawing system assembly.

Sub UserProc;
Var
    Tab: ITabSheet;
    tObject: ITabObject;
    Rect: IGxRectF;
    Argument: TabBeforeObjectRectChangeEventArgs;
Begin
    Tab := TabSheetBox1.Source.GetTabSheet;
    tObject := Tab.Objects.Item(0);
    Rect := New GxRectF.Create(10106060);
    Argument := New TabBeforeObjectRectChangeEventArgs.Create(TabSheetBox1, tObject, TabObjectChangeType.Rect, Rect, False);
    TabSheetBox1.OnBeforeObjectChange(TabSheetBox1, Argument);
End Sub UserProc;

After executing the example the procedure calls the OnBeforeObjectChange event in the TabSheetBox1 component.

Fore.NET Example

Executing the example requires a form containing the components:

  1. TabSheetBoxNet with the tabSheetBoxNet1 identifier.

  2. UiReportNet with the uiReportNet1 identifier that is a data source for tabSheetBoxNet1. UiReportNet1 must also be active and contain a loaded regular report with shapes on an active sheet.

The TabBeforeObjectRectChangeEventArgs_Create_FormForm_Shown event handler must be determined for the Shown event for the form.

The example creates and calls a custom handler for the OnBeforeObjectChange event in the tabSheetBoxNet1» component.

Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Tab;

// Custom handler of the OnBeforeObjectChange event
Public Sub UserOnBeforeObjectChange(Sender: Object; Args: ITabObjectChangeEventArgs);
Begin
    Select Case Args.Type
    Case TabObjectChangeType.toctAngle:
        System.Diagnostics.Debug.WriteLine("Object '" + Args.Object.Id + "' was rotated");
    Case TabObjectChangeType.toctRect:
        System.Diagnostics.Debug.WriteLine("Object '" + Args.Object.Id + "' was moved or resized");
    End Select;
End Sub UserOnBeforeObjectChange;
    
// Determine UserOnBeforeObjectChange custom event handler for the OnBeforeObjectChange event
Private Sub TabBeforeObjectRectChangeEventArgs_Create_FormForm_Shown(sender: System.Object; e: System.EventArgs);
Begin
    tabSheetBoxNet1.OnBeforeObjectChange += New Prognoz.Platform.Forms.Net.TabSheetBoxNet.OnBeforeObjectChangeEventHandler(UserOnBeforeObjectChange);
End Sub;

// Call the OnBeforeObjectChange custom event handler
Public Sub UserProc();
Var
    Tab: ITabSheet;
    tObject: ITabObject;
    Rect: GxRectFClass = New GxRectFClass.Create();
    Argument: TabBeforeObjectRectChangeEventArgsClass = New TabBeforeObjectRectChangeEventArgsClass.Create();
Begin
    Tab := tabSheetBoxNet1.Source.GetTabSheet();
    tObject := Tab.Objects.Item[0];
    Rect.Create(10106060);
    Argument.Create(tabSheetBoxNet1.CtrlBox As TabSheetBox, tObject, TabObjectChangeType.toctRect, Rect, False);
    UserOnBeforeObjectChange(tabSheetBoxNet1, Argument);
End Sub UserProc;

After executing the example the UserProc procedure calls the UserOnBeforeObjectChange custom handler for the OnBeforeObjectChange event in the tabSheetBoxNet1 component.

See also:

TabBeforeObjectRectChangeEventArgs