IWxWorkspace.CreateRectangle

Syntax

CreateRectangle: IWxRectangle;

CreateRectangle(): Prognoz.Platform.Interoop.Andy.IWxRectangle;

Description

The CreateRectangle method creates a rectangle.

Example

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.

Add links to the Andy, Drawing, Metabase system assemblies.

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;

Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

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 UiWorkspaceObject1 component on clicking the Button1 component.

See also:

IWxWorkspace