IWxSelectedShapes.Add

Syntax

Add(Value: IWxShape);

Parameters

Value. Shape.

Description

The Add method adds a shape to a collection of selected shapes.

Example

Sub Draw;

Var

UiWorkspace1: UiWorkspace;

Rect : IWxRectangle;

Ellipse : IWxEllipse;

pos : IGxPointF;

SelectS : IWxSelectedShapes;

 

Begin

UiWorkspace1.WxWorkspace.BeginUpdate;

 

Rect := UiWorkspace1.WxWorkspace.CreateRectangle;

pos := New GxPointF.Create(20,10);

Rect.PinPosition := pos;

Rect.Text := "Rectangle";

 

Ellipse := UiWorkspace1.WxWorkspace.CreateEllipse;

pos := New GxPointF.Create(40,50);

Ellipse.PinPosition := pos;

Ellipse.Text := "Ellipse";

 

SelectS := WorkspaceBox1.View.SelectedShapes;

SelectS.Add(Ellipse);

SelectS.Add(Rect);

SelectS.Align(WxShapesAlignment.VerticalCenter);

 

UiWorkspace1.WxWorkspace.EndUpdate;

End Sub Draw;

After executing the example the created objects are selected and aligned to the vertical center.

See also:

IWxSelectedShapes