TextBlock
The text block is used to display text. The text may be static, or may use the Text Transform property to dynamically set the string value on every page update. This takes the place of the text, numeric displays and string display objects typically used in other systems.
Property | Description |
---|---|
Background | Background colour |
Bold | If true, the text will be bold. |
Border | Color of the box border. |
BorderThickness | Thickness of the box border. |
Color | Color of the text. |
Font | Name of the font to use. |
FontSize | Font size in pixels. Integer value. |
FontStyle | Style of the font. Options:
|
FontWeight | Thickness of the font. Not all options are valid for all fonts. Typical Options:
|
Format | [Deprecated] |
FormattedText | [Deprecated] |
Padding | Minimum distance from the edge of the box to the text. |
Text | The string that will be displayed. The text block object does not support text wrapping. Line breaks can be manually added using the \n line break character. |
TextAlignment | A pair of values denoting the horizontal and vertical alignment. E.g. "Top,Right" Horizontal options:
|
Underline | If true, the text will be underlined. |
View Example
{
"$type": "TextBlock",
"Name": "TextBlock1",
"Height": 20,
"Width": 180,
"TextAlignment": "Left",
"HorizontalAlignment": "Left",
"FontSize": 28,
"X": "20",
"Y": "10",
"Text": "Omniview"
}
Python Example
from Omniview.Python import *
myTextBlock = TextBlock("Hello World")
myTextBlock.TextAlignment = TextAlignment.Left + TextAlignment.Top
myTextBlock.Border = Color("#000000")
myTextBlock.Padding = Margin(5,5,5,5)
myTextBlock.Width = 200
myTextBlock.Height = 30
myTextBlock.X = 600
myTextBlock.Y = 200
Omniview.Windows[0].Content.AddViewObject(myTextBlock)