UIButton

(Engine-Level Function)

Description: Basic button control capable of styling and image display.
Returns: Boolean
Usage: Steady State only.
Function Groups: Graphics
Related to: DropList | GUIBitmap |GUIButton |GUIText |WinButton
Format: UIButton(Left, Bottom, Right, Top[, Label, FontParm, BGColor, LabelColor, BorderColor, SelectedColor, ImageFilename, StateInfo, Invisible, ImgPctPadding, LabelHAlign]);
Parameters:  
Left

A number that gives the left side reference coordinate, the total distance from the left side of the page to the left side of the button.

Bottom

A number that gives the bottom side reference coordinate, the total distance from the top of the page to the bottom of the button.

Right

A number that gives the left side reference coordinate, the total distance from the left side of the page to the right side of the button.

Top

A number that gives the top side reference coordinate, the total distance from the top of the page to the top of the button.

Label
Optional text label displayed on the button. Will display to the right of the image ('ImageFileName') if both are set. May be a string or expression returning a string. No text is shown if not set. Overrides set font size to increase size proportionately along with the button, not just when the page scales.
FontParm
Optional Font tag or font value to apply to the label text.
BGColor
Optional. Any expression for the background color of the button. Defaults to grey.
LabelColor
Optional. Any expression for the foreground color and text of the button. Defaults to black.
BorderColor
Optional. Any expression for the color of the button's border. Defaults to the Windows default "field shadow."
SelectedColor
Optional. Any expression for the color of the button's border when the mouse pointer hovers over the button. This color will also be blended with the background color for the color of the button when selected. Defaults to blue.
ImageFilename

Optional. Image to display in the foreground of the button, shown left of the text if both parameters are set.

May be a string name referencing an icon within the VTScada standard library ("shield", for example) or a string file path to a preferred image file (absolute or relative to the root of your application).

Supported image formats include, SVG, BMP, EMF, WMF, APM, CUT, PCX, JPG, PNG, and TIF.

StateInfo
Optional instance of the UIState structure, applying distinct styling to the button corresponding to each state. Commonly used for Visibility and FocusID (enabling).
Invisible
Optional boolean. If set to TRUE the button will not appear within the page but can still be clicked. Defaults to FALSE.
ImgPctPadding
Optional percentage value from 0 - 0.5. An amount of padding to apply to the image if ImageFilename is set. Defaults to 0.
LabelHAlign

Optional numeric expression that specifies the horizontal alignment justification and clipping, as shown in the following table. Defaults to 4.

Value

H. Justification 

Clipping

0

Left

Right

1

Left

Both

2

Left

Left

3

Center

Right

4

Center

Both

5

Center

Left

6

Right

Right

7

Right

Both

8

Right

Left

Comments:

Should not be called within a GUITransform without first calling UnTransform, so that the component is drawn with absolute coordinates.

Example:

\System.UIButton(100 { Left }, 100 { bottom }, 300 { Right }, 50 { Top },
		  "Print Report" { Button Label         }, 
		  Font("ARIAL" { Font name              },
		       0       { Character set          }, 
		       14      { Height in points       }, 
		       0       { Rotation               }, 
		       5       { Weight - somewhat bold }, 
		       0       { Not italic             }, 
		       0       { Non-fixed              }),
		  "FFFDFDFD"     { Background Color }, 
		  "FF000000"     { Label Color      },
		  "FFD0D0D0"     { Border Color     }, 
		  "FF005499"     { Selected Color   },
		  "lock"         { Display Image    }, 
		  Invalid        { UIState Struct   },
		  0.15           { Image Padding    },
		  2              { Text Horizontal
			           Justification    });