Top  | Previous | Next

Label

display_Label

Description

The Label is one of the most versatile components. It can display text, images, or both. Its text can be HTML formatted (like most components). It can even be made to respond to user interaction through its events.

 

Labels are one of the most common components that you will want to add dynamic properties to. For instance, you can put an integer dynamic property "state" on a label, and then bind the text to be "On" when the state=1 and "Off" otherwise, using an expression binding. Bind the background color to be red when the state is 0, and green when the state is 1 using a property binding. Now you have a re-usable binary state indicator. While you could have used the Multi-State Indicator to achieve the same effect, the exercise is good practice for creating custom components. You can see how the flexibility of bindings and dynamic properties make the Label extremely versatile.

 

See also:

Dynamic Properties

Property Bindings

Properties

Appearance

Font

Font of text of this component

Scripting name

font

Data type

Font

Fill Background

If true, the label's background color will be drawn. If false, it will have a transparent background.

Scripting name

fillBackground

Data type

boolean

Flags

bindable

Foreground Color

The color of the Label's text.

Scripting name

foreground

Data type

Color

Flags

bindable

Background Color

The background color of the label, if opaque is set to "true".

Scripting name

background

Data type

Color

Flags

bindable

Image Path

The relative path of the image.

Scripting name

path

Data type

String

Flags

bindable

Disabled Image Path

The relative path of the image to be displayed when this component is not enabled.

Scripting name

disabledPath

Data type

String

Flags

expert

Icon-Text Spacing

The space (in pixels) between the icon (if any) and the text (if any)

Scripting name

iconTextGap

Data type

int

Rotation

The angle of rotation in degrees.

Scripting name

rotation

Data type

int

Antialias

Draw with antialias on? Makes text smoother

Scripting name

antialias

Data type

boolean

Flags

expert

Styles

Contains the component's styles

Scripting name

styles

Data type

Dataset

Flags

bindable | expert

Common

Name

The name of this component.

Scripting name

name

Data type

String

Flags

bindable

Enabled

If disabled, a component cannot be used.

Scripting name

componentEnabled

Data type

boolean

Visible

If disabled, the component will be hidden.

Scripting name

visible

Data type

boolean

Flags

bindable

Border

The border surrounding this component. NOTE that the border is unaffected by rotation.

Scripting name

border

Data type

Border

Mouseover Text

The text that is displayed in the tooltip which pops up on mouseover of this component.

Scripting name

toolTipText

Data type

String

Cursor

The mouse cursor to use when hovering over this component.

Scripting name

cursorCode

Data type

int

Values

0

Default

1

Crosshair

2

Text

3

Wait

12

Hand

13

Move

4

SW Resize

5

SE Resize

6

NW Resize

7

NE Resize

8

N Resize

9

S Resize

10

W Resize

11

E Resize

Data

Text

Text of this Label

Scripting name

text

Data type

String

Flags

bindable

Data Quality

The data quality code for any tag bindings on this component.

Scripting name

dataQuality

Data type

int

Flags

bindable | expert

Layout

Horizontal Alignment

Determines the alignment of the label's contents along the X axis

Scripting name

horizontalAlignment

Data type

int

Values

2

Left

0

Center

4

Right

10

Leading

11

Trailing

Horizontal Text Position

Determines the horizontal position of the label's text, relative to its image

Scripting name

horizontalTextPosition

Data type

int

Values

2

Left

0

Center

4

Right

10

Leading

11

Trailing

Vertical Alignment

Determines the alignment of the label's contents along the Y axis

Scripting name

verticalAlignment

Data type

int

Values

1

Top

0

Center

3

Bottom

Vertical Text Position

Determines the vertical position of the label's text, relative to its image

Scripting name

verticalTextPosition

Data type

int

Values

1

Top

0

Center

3

Bottom

Scripting

Events

The following event sets are fired by this component. See Component Event Handlers to learn more.

mouse
mouseMotion
propertyChange

 

Scripting Functions

This component has no special scripting functions.