IWxWorkspace.Shapes

Syntax

Shapes: IWxShapes;

Shapes: Prognoz.Platform.Interop.Andy.IWxShapes;

Description

The Shapes property returns a shape collection.

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. This component must also contain a previously created shape.

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

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    ws: IWxWorkspace;
    Shapes: IWxShapes;
    Shape: IWxShape;
Begin
    ws := UiWorkspaceObject1.Instance 
As IWxWorkspace;
    ws.BeginUpdate;
    Shapes := ws.Shapes;
    Shape := Shapes.Item(
0);
    Shape.Angle := 
40;
    Shape.Size := 
New GxSizeF.Create(4378);
    ws.EndUpdate;
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;
    Shapes: IWxShapes;
    Shape: IWxShape;
    SSize: GxSizeF = New  GxSizeFClass();
Begin
    ws := uiWorkspaceObjectNet1.WorkspaceObjectUi.Instance As WxWorkspace;
    ws.BeginUpdate();
    Shapes := ws.Shapes;
    Shape := Shapes.Item[0];
    Shape.Angle := 40;
    SSize.Create(43,  78);
    Shape.Size := SSize;
    ws.EndUpdate();
End Sub;

After executing the example the size and rotation angle of the shape are changed in the UiWorkspaceObject1 component on clicking the Button1 component.

See also:

IWxWorkspace