TabBeforeObjectAngleChangeEventArgs.Create

Fore Syntax

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

                       Angle: Double;

                       Cancel: Boolean);

Fore.NET Syntax

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

                       Angle: double;

                       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.

Angle. The angle by which an object is rotated.

Cancel. Indicates whether object rotation must be canceled.

Description

The Create constructor creates an argument of the event that occurs on object rotation.

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.

Value of the Angle parameter is always positive and is counted clockwise. For example, if an object is rotated clockwise by 15 degrees, the parameter value must be 15, and if an object is rotated by 15 degrees counterclockwise, the value must be 345.

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.

Sub UserProc;
Var
    Tab: ITabSheet;
    Object: ITabObject;
    Argument: TabBeforeObjectAngleChangeEventArgs;
Begin
    Tab := TabSheetBox1.Source.GetTabSheet;
    Object := Tab.Objects.Item(0);
    Argument := New TabBeforeObjectAngleChangeEventArgs.Create(TabSheetBox1, Object, TabObjectChangeType.Angle, 15False);
    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 TabBeforeObjectAngleChangeEventArgs_Create_FormForm_Shown 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.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 TabBeforeObjectAngleChangeEventArgs_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;
    Argument: TabBeforeObjectAngleChangeEventArgs = New TabBeforeObjectAngleChangeEventArgs.Create();
Begin
    Tab := tabSheetBoxNet1.Source.GetTabSheet();
    tObject := Tab.Objects.Item[0];
    Argument.Create(tabSheetBoxNet1.CtrlBox As TabSheetBox, tObject, TabObjectChangeType.toctRect, 15False);
    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:

TabBeforeObjectAngleChangeEventArgs