IWxStyle.TextPosition

Syntax

TextPosition: WxTextPosition;

TextPosition: Prognoz.Platform.Interop.Andy.WxTextPosition;

Description

The TextPosition property determines the position of text relative to an image used as an object fill.

Example

Executing the example requires that repository contains a workspace with the IWSTYLE identifier containing shape. It is also required to have the ConnectedCPs.gif image.

Add links to the Andy, Drawing, Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Shape: IWxShape;
    Style: IWxStyle;
Begin
    // Get workspace for edit
    mb := MetabaseClass.Active;
    ws := mb.ItemById("IWSTYLE").Edit As IWxWorkspace;
    ws.BeginUpdate;
    Shape := ws.Shapes.Item(0);
    Shape.Picture := New GxImage.CreateFromFile("C:\ConnectedCPs.gif");
    Shape.Text := "Text";
    Style := Shape.Style;
    Style.TextFontBrushColor := GxColor.FromName("Red");
    Style.TextPosition := WxTextPosition.Right;
    ws.EndUpdate;
    (ws As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Andy;
Imports Prognoz.Platform.Interop.Drawing;

 
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ws: IWxWorkspace;
    Shape: IWxShape;
    Style: IWxStyle;
    Img: GxImage;
    Color: GxColorClassClass = 
New GxColorClassClass();
Begin
    
// Get workspace for edit
    mb := Params.Metabase;
    ws := mb.ItemById[
"IWSTYLE"].Edit() As IWxWorkspace;
    ws.BeginUpdate();
    Shape := ws.Shapes.Item[
0];
    Img := 
New GxImageClass_2();
    Img.CreateFromFile(
"C:\ConnectedCPs.gif");
    Shape.Picture := Img;
    Shape.Text := 
"Text";
    Style := Shape.Style;
    Style.TextFontBrushColor := Color.FromName(
"Red");
    Style.TextPosition := WxTextPosition.wtpRight;
    ws.EndUpdate();
    (ws 
As IMetabaseObject).Save();
End Sub;

After executing the example an image is used as shape fill and a shape contains text, aligned at the right relative to the image.

See also:

IWxStyle