IUiWorkspace.WxWorkspace

Syntax

WxWorkspace: IWxWorkspace;

Description

The WxWorkspace property returns the workspace graphic context that is displayed then in the WorkspaceBox component.

Example

Executing this example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and the UiWorkspace component that is used as the data source for WorkspaceBox1.

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

Var

Workspace: IWxWorkspace;

Rect: IWxRectangle;

Point: IGxPointF;

Begin

Point := New GxPointF.Create(-15, -15);

WorkspaceBox1.Source := UiWorkspace1 As IWorkspaceSource;

Workspace := UiWorkspace1.WxWorkspace;

Workspace.BeginUpdate;

//1 rectangle

Rect := Workspace.CreateRectangle;

//2 rectangle

Rect := Workspace.CreateRectangle;

Rect.PinPosition := Point;

Workspace.EndUpdate;

End Sub Button1OnClick;

The UiWorkspace1 component is installed as the data source for the WorkspaceBox1 component after executing the example when user presses the button. Two rectangles are created on the workspace of the UiWorkspace1 component. The second rectangle is shifted to the given point.

See also:

IUiWorkspace