SelectionStyle: IWxStyle;
SelectionStyle: Prognoz.Platform.Interop.Andy.IWxStyle;
The SelectionStyle property determines parameters for formatting the selected shape text fragment.
Style of the selected text fragment may differ from the entire text style, particularly, on editing the formatted shape text in the RTF format.
To determine shape formatting parameters, use IWxShape.Style.
Executing the example requires that the repository contains a workspace with the WORKSPACE_SELSTYLE identifier that contains a shape.
Add links to the Andy, Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
WSP: IWxWorkspace;
Shape: IWxShape;
SelStyle: IWxStyle;
Text: string;
Begin
// Get repository
MB := MetabaseClass.Active;
// Get workspace
WSP := MB.ItemById("WORKSPACE_SELSTYLE").Edit As IWxWorkspace;
// Get shape
Shape := WSP.Shapes.Item(0);
// Set shape text
Shape.Text := "text";
// Get formatting parameters of the selected shape text fragment
SelStyle := Shape.SelectionStyle;
// Change font size
SelStyle.TextFontSize := 24;
// Save changes
(Wsp As IMetabaseObject).Save;
End Sub UserProc;
After executing the example font size of the specified shape text is changed.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Andy;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
WSP: IWxWorkspace;
Shape: IWxShape;
SelStyle: IWxStyle;
Begin
// Get repository
MB := Params.Metabase;
// Get workspace
WSP := MB.ItemById["WORKSPACE_SELSTYLE"].Edit() As IWxWorkspace;
// Get shape
Shape := WSP.Shapes.Item[0];
// Set shape text
Shape.Text := "text";
// Get formatting parameters of the selected shape text fragment
SelStyle := Shape.SelectionStyle;
// Change font size
SelStyle.TextFontSize := 24;
// Save changes
(Wsp As IMetabaseObject).Save();
End Sub;
See also: