CreateRectangle: IWxRectangle;
CreateRectangle: Prognoz.Platform.Interoop.Andy.IWxRectangle;
The CreateRectangle method creates a rectangle.
Executing the example requires a form with the Button and UiWorkspaceObject components with the Button1 and UiWorkspaceObject1 identifiers respectively. A corresponding repository object must be connected to UiWorkspaceObject.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
ws: IWxWorkspace;
Rec: IWxRectangle;
Begin
ws := UiWorkspaceObject1.Instance As IWxWorkspace;
Rec := ws.CreateRectangle;
Rec.Id := "Rectangle1";
Rec.PinPosition := New GxPointF.Create(12.3,-2);
Rec.Text := "Rectangle";
End Sub Button1OnClick;
After executing the example a rectangle is created on the UiWorkspaceObject1 component on clicking the Button1 component.
Executing the example requires a form with the Button and UiWorkspaceObjectNet components with the Button1 and UiWorkspaceObjectNet1 identifiers respectively. A corresponding repository object must be connected to UiWorkspaceObjectNet.
Imports System;
Imports System.Windows.Forms;
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Workspace;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.ExtCtrls;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
ws: WxWorkspace;
Rec: IWxRectangle;
PinPoint: GxPointF = New GxPointFClass();
Begin
ws := uiWorkspaceObjectNet1.WorkspaceObjectUi.Instance As WxWorkspace;
Rec := ws.CreateRectangle();
Rec.Id := "Rectangle1";
PinPoint.Create(12.3,-2);
Rec.PinPosition := PinPoint;
Rec.Text := "Rectangle";
End Sub;
After executing the example a rectangle is created on the UiWorkspaceObjectNet1 component on clicking the Button1 component.
See also: