IGxSize.Equals

Syntax

Equals(Size: IGxSize): Boolean;

Parameters

Size. The size used for comparison.

Description

The Equals method checks if this size is equal to the size passed by the Size parameter.

Comments

The size is determined with integer values.

Example

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Size, Size1: IGxSize;

Rect, Rect1: IWxRectangle;

s: String;

Begin

Size:=New GxSize.Create(0,0);

Size1:=New GxSize.Create(0,0);

Rect:=UiWorkspace1.WxWorkspace.CreateRectangle;

Rect1:=UiWorkspace1.WxWorkspace.CreateRectangle;

Size.Width:=Math.RandBetweenI(0,50);

Size1.Width:=Math.RandBetweenI(0,50);

Size.Height:=Math.RandBetweenI(0,50);

Size1.Height:=Math.RandBetweenI(0,50);

Rect.BeginUpdate;

Rect1.BeginUpdate;

Rect.Size:=New GxSizeF.CreateFromSize(Size.ToSizeF);

Rect1.Size:=New GxSizeF.CreateFromSize(Size1.ToSizeF);

Rect.EndUpdate;

Rect1.EndUpdate;

If Size.Equals(Size1) Then

s:="Yes";

Else

s:="No";

End If;

End Sub Button1OnClick;

After executing the example clicking the button creates two rectangles in the workspace, and the "s" variable contains Yes if their sizes are equal.

See also:

IGxSize