CreateExtension([ProgId: String = ""]);
ProgId. Class of the object, for which an extension is created.
By default, an extension is created for repository objects. An extension for repository objects can also be created by setting this parameter value to KeWsp.WxMetabaseObject.
The CreateExtension method creates an extension for a workspace shape.
This method is used to arrange various objects in the workspace. After creating an extension use the IWxShape.Extension property to define the object corresponding to workspace shape.
In the current version extensions are created to display on the workspace shapes corresponding to repository objects.
Executing the example requires a form with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and a data source for the WorkspaceBox1. The repository contains a form with the Form_1 identifier.
Add links to the Andy, Drawing, Metabase, Workspace system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
MbObj: IMetabaseObject;
Shape: IWxShape;
WxObj: IWxMetabaseObject;
Style: IWxStyle;
ws: IWxWorkspace;
Begin
//Arrange and format repository object on the workspace
ws := WorkspaceBox1.View.Workspace;
ws.BeginUpdate;
Mb := MetabaseClass.Active;
MbObj := Mb.ItemById("Form_1") As IMetabaseObject;
Shape := ws.CreateRectangle;
Shape.CreateExtension;
WxObj := Shape.Extension As IWxMetabaseObject;
WxObj.MetabaseObject := MbObj;
Shape.Id := "Form";
//Create a style
Style := ws.CreateStyle;
Style.ShadowBrushForeColor := GxColor.FromName("Blue");
Style.ShadowBrushForeTransparent := 50;
Style.LinePenTransparent := 100;
Style.TextAlignmentVertical := GxAlignment.Far;
Shape.Style := Style;
ws.EndUpdate;
End Sub Button1OnClick;
After executing the example the repository object is positioned in the workspace.
See also: