Extension: IWxShapeExtension;
The Extension property determines shape extension object.
Use the CreateExtension method to create a shape extension. After the specified method is called, the object to be used as a shape extension can be defined using this property.
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.
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: