IWxSelectedShapes.Align

Syntax

Align(Aligment: WxShapesAlignment);

Parameters

Aligment. Type of object alignment.

Description

The Align method aligns shapes based on the defined alignment settings.

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 := UiWorkspace1.WxWorkspace.Views.Item(0).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