CreateObjectChangeArgs(TabSheet: ITabSheetBox;
Object: ITabObject;
Type: TabObjectChangeType);
CreateObjectChangeArgs(TabSheet: Prognoz.Platform.Interop.Tab.TabSheetBox;
Object: Prognoz.Platform.Interop.Tab.ITabObject;
Type: Prognoz.Platform.Interop.Tab.TabObjectChangeType);
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.
The CreateObjectChangeArgs constructor creates an argument of the event that occurs on changing an object.
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.
Executing the example requires a form containing the components:
TabSheetBox with the TabSheetBox1 identifier. The OnAfterObjectChange event handler must be assigned for this component.
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: TabObjectChangeEventArgs;
Begin
Tab := TabSheetBox1.Source.GetTabSheet;
Object := Tab.Objects.Item(0);
Argument := New TabObjectChangeEventArgs.CreateObjectChangeArgs(TabSheetBox1, Object, TabObjectChangeType.Angle);
TabSheetBox1.OnAfterObjectChange(TabSheetBox1, Argument);
End Sub UserProc;
After executing the example the procedure calls the OnAfterObjectChange event in the TabSheetBox1 component.
Executing the example requires a form containing the components:
TabSheetBoxNet with the tabSheetBoxNet1 identifier.
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 TABOBJECTCHANGEEVENTARGS_CREATEOBJECTCHANGEARGS_FORMForm_Shown handler must be determined for the Shown event for the form.
The example creates and calls a custom handler of the OnAfterObjectChange event in the tabSheetBoxNet1 component.
Imports Prognoz.Platform.Interop.Tab;
…
// Custom handler of the OnAfterObjectChange event
Public Sub UserOnAfterObjectChange(Sender: Object; Args: TabObjectChangeEventArgs);
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 UserOnAfterObjectChange;
// Determine the UserOnAfterObjectChange custom handler for the OnAfterObjectChange event
Private Sub TABOBJECTCHANGEEVENTARGS_CREATEOBJECTCHANGEARGS_FORMForm_Shown(sender: System.Object; e: System.EventArgs);
Begin
tabSheetBoxNet1.OnAfterObjectChange += New Prognoz.Platform.Forms.Net.TabSheetBoxNet.OnAfterObjectChangeEventHandler(UserOnAfterObjectChange);
End Sub;
// Call the OnAfterObjectChange custom event handler
Public Sub UserProc();
Var
Tab: ITabSheet;
Object: ITabObject;
Argument: TabObjectChangeEventArgsClass;
Begin
Tab := tabSheetBoxNet1.Source.GetTabSheet();
Object := Tab.Objects.Item[0];
Argument := New TabObjectChangeEventArgsClass.Create();
Argument.CreateObjectChangeArgs(tabSheetBoxNet1.CtrlBox As TabSheetBox, Object, TabObjectChangeType.toctAngle);
UserOnAfterObjectChange(tabSheetBoxNet1, Argument);
End Sub UserProc;
After executing the example the UserProc procedure calls the UserOnAfterObjectChange custom handler of the OnAfterObjectChange event in the tabSheetBoxNet1 component.
See also: