WxWorkspace: IWxWorkspace;
The WxWorkspace property returns the workspace graphic context that is further displayed in the WorkspaceBox component.
Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and the UiWorkspace component that is used as a data source for the WorkspaceBox1 component.
Add links to the Andy, ExtCtrls, Forms, Ui, and Workspace system assemblies.
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;
After executing the example, clicking the button sets the UiWorkspace1 component as a data source for the WorkspaceBox1 component. Two rectangles are created in the workspace of the UiWorkspace1 component. The second rectangle is shifted to the given point.
See also: