new LayerForeOptions()
It is important to note that changing a field of the ForeOpt property does not automatically update the control. For example, oLayer.ForeOpt.tfi = "
- Since:
- 5.4
Members
(static) formatText :exontrol.DrawTextFormatEnum
The exontrol.DrawTextFormatEnum type support the following flags:
- exTextAlignTop (0x00), justifies the text to the top of the rectangle
- exTextAlignLeft (0x00), aligns text to the left
- exTextAlignCenter (0x01), centers text horizontally in the rectangle
- exTextAlignRight (0x02), aligns text to the right
- exTextAlignVCenter (0x04), centers text vertically
- exTextAlignBottom (0x08), justifies the text to the bottom of the rectangle.
- exTextAlignMask (0x0F), specifies the mask for text's alignment.
- exTextWordBreak (0x10), breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-line feed sequence also breaks the line. If this is not specified, output is on one line.
- exTextSingleLine (0x20), displays text on a single line only. Carriage returns and line feeds do not break the line.
- exTextExpandTabs (0x40), expands tab characters. The default number of characters per tab is eight.
- exPlainText (0x80), treats the text as plain text.
- exTextNoClip (0x0100), draws without clipping.
- exHTMLTextNoColors (0x0200), ignores the
and tags. - exTextCalcRect (0x0400), determines the width and height of the text.
- exHTMLTextNoTags (0x0800), ignores all HTML tags.
- exTextPathEllipsis (0x4000), for displayed text, replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle. If the string contains backslash (\) characters, exTextPathEllipsis preserves as much as possible of the text after the last backslash.
- exTextEndEllipsis (0x8000), for displayed text, if the end of a string does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the string goes beyond the limits of the rectangle, it is truncated without ellipses.
- exTextWordEllipsis (0x040000), truncates any word that does not fit in the rectangle and adds ellipses.
Type:
- exontrol.DrawTextFormatEnum
Example
null {null}, the text in the layer's foreground is drawn with the default formatting options defined by the control's Gauge.FormatText property
"center,vcenter,single" {string}, the text in the layer's foreground is centered and displayed on a single line
exontrol.DrawTextFormatEnum.exTextAlignCenter | exontrol.DrawTextFormatEnum.exTextAlignVCenter | exontrol.DrawTextFormatEnum.exTextSingleLine {number}, the text in the layer's foreground is centered and displayed on a single line
formatText
(static) front :boolean
Type:
- boolean
Example
true {boolean}, the caption is displayed in front of the layer's background
false {boolean}, the caption is displayed behind the layer's background
front
(static) height :number|string
The expression supports the following keywords:
"twidth", stands for the text's width
"height", stands for height of the layer's client rectangle currently used for drawing the foreground
For instance, if you set the height field to "theight + 20" the caption is displayed with a height that is 20 pixels taller than the text's height.
Type:
- number | string
Example
32 {number}, the caption is displayed with a height of 32 pixels
"theight/2" {string}, the caption is displayed with a height that is half of the text's height
height
(static) left :number|string
The expression supports the following keywords:
"twidth", stands for the text's width
"height", stands for height of the layer's client rectangle currently used for drawing the foreground
For instance, if you set the left field to 10 the caption is shifted horizontally to the right by 10 pixels from the from the original position.
Type:
- number | string
Example
10 {number}, the caption is displayed with a left margin of 10 pixels from the left edge of the layer
"(width - twidth)/2" {string}, the caption is horizontally centered within the layer's foreground (while formatText field does not contain exTextAlignCenter flag)
left
(static) tfi :string|object
The tfi field as string supports any of the following keywords (each keyword can be specified using first letters only such as "b" for "bold) separated by space characters:
- bold, displays the text in bold (equivalent of <b> tag)
- italic, displays the text in italics (equivalent of <i> tag)
- underline, underlines the text (equivalent of <u> tag)
- strikeout, specifies whether the text is strike-through (equivalent of <s> tag)
- <fontName name>, specifies the font's family (equivalent of <font name> tag)
- <fontSize size>, specifies the size of the font (equivalent of <font ;size> tag)
- <fgColor CSSColor>, specifies the text's foreground color (equivalent of <fgcolor> tag)
- <bgColor CSSColor>, specifies the text's background color (equivalent of <bgcolor> tag)
- <shaColor CSSColor;width;offset>, defines the text's shadow (equivalent of <sha color;width;offset> tag)
- <outColor CSSColor>, shows the text with outlined characters (CSScolor) (equivalent of <out color> tag)
- <graColor CSSColor;mode;blend>, defines a gradient text (equivalent of <gra color;mode;blend> tag)
Any other word within the tfi field that's not recognized as a keyword is interpreted as:
- name of the font (not a number), specifies the font's family (equivalent of <font name> tag)
- size of the font (number), specifies the size of the font (equivalent of <font ;size> tag)
The tfi field as object supports any of the following fields:
- bold {boolean}, displays the text in bold (equivalent of <b> tag)
- italic {boolean}, displays the text in italics (equivalent of <i> tag)
- underline {boolean}, underlines the text (equivalent of <u> tag)
- strikeout {boolean}, specifies whether the text is strike-through (equivalent of <s> tag)
- fontName {string}, specifies the font's family (equivalent of <font name> tag)
- fontSize {number}, specifies the size of the font (equivalent of <font ;size> tag)
- fgColor {string}, specifies the text's foreground color (CSScolor) (equivalent of <fgcolor> tag)
- bgColor {string}, specifies the text's background color (CSScolor) (equivalent of <bgcolor> tag)
- shaColor {object}, specifies an object of {color, width, offset} type that defines the text's shadow (equivalent of <sha color;width;offset> tag), where:
- color {string}, defines the color of the text's shadow (CSScolor)
- width {number}, defines the size of the text's shadow
- offset {number}, defines the offset to show the text's shadow relative to the text
- outColor {string}, shows the text with outlined characters (CSScolor) (equivalent of <out color> tag)
- graColor {object}, specifies an object of {color, mode, blend} type that defines a gradient text (equivalent of <gra color;mode;blend> tag), where:
- color {string}, defines the gradient-color (CSScolor)
- mode {number}, defines the gradient direction as 0 (left-right), 1 (default, top-bottom), 2 (left-center-right), and 3 (top-center-bottom)
- blend {number}, defines the gradient blend as a value between 0 and 1
CSSColor or CSS legal color values can be specified by the following methods:
- Hexadecimal colors, is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF. For example, #0000ff value is rendered as blue, because the blue component is set to its highest value (ff) and the others are set to 00.
- Hexadecimal colors with transparency, is specified with: #RRGGBBAA, where AA (alpha) value must be between 00 and FF. For example, #0000ff80 defines a semi-transparent blue.
- RGB colors, is specified with the RGB(red, green, blue) function. Each parameter (red, green, and blue) defines the intensity of the color and can be an integer between 0 and 255. For example, rgb(0,0,255) defines the blue color.
- RGBA colors, are an extension of RGB color values with an alpha channel as RGBA(red, green, blue, alpha) function, where the alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque). For example, rgba(0,0,255,0.5) defines a semi-transparent blue.
- HSL colors, is specified with the HSL(hue, saturation, lightness) function, where hue is a degree on the color wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue. saturation is a percentage value; 0% means a shade of gray and 100% is the full color. lightness is also a percentage; 0% is black, 100% is white. HSL stands for hue, saturation, and lightness - and represents a cylindrical-coordinate representation of colors. For example, hsl(240, 100%, 50%) defines the blue color.
- HSLA colors, are an extension of HSL color values with an alpha channel - which specifies the opacity of the object as HSLA(hue, saturation, lightness, alpha) function, where alpha parameter is a number between 0.0 (fully transparent) and 1.0 (fully opaque). For example, hsla(240, 100%, 50%,0.5) defines a semi-transparent blue.
- Predefined/Cross-browser color names, 140 color names are predefined in the HTML and CSS color specification. For example, blue defines the blue color.
Type:
- string | object
Example
null, the caption is displayed with the default font attributes defined by the control's Gauge.Tfi property
"bold <fgcolor red>" {string}, the caption is displayed in bold and red color
{bold: true, fgColor: "red"} {object}, the caption is displayed in bold and red color
tfi
(static) top :number|string
The expression supports the following keywords:
"twidth", stands for the text's width
"height", stands for height of the layer's client rectangle currently used for drawing the foreground
For instance, if you set the top field to 10 the caption is shifted vertically downwards by 10 pixels from the from the original position.
Type:
- number | string
Example
10 {number}, the caption is displayed with a top margin of 10 pixels from the top edge of the layer
"(height - theight)/2" {string}, the caption is vertically centered within the layer's foreground (while formatText field does not contain exTextAlignVCenter flag)
top
(static) width :number|string
The expression supports the following keywords:
"twidth", stands for the text's width
"height", stands for height of the layer's client rectangle currently used for drawing the foreground
For instance, if you set the width field to "twidth + 20" the caption is displayed with a width that is 20 pixels wider than the text's width.
Type:
- number | string
Example
32 {number}, the caption is displayed with a width of 32 pixels
"twidth/2" {string}, the caption is displayed with a width that is half of the text's width
width