Label

Form and theme XML code and CSS element selector

Inheritance diagram

Most commonly used form and theme properties

Associated 4gl syntax and ui methods

Influence and behavior

Label defines a text area to display a read-only text, image, or both.

Form XML code:

<Label text="Label"identifier="lb1">

   <Label.onInvoke>

      <ActionEventHandler type="actioneventhandler"actionName="actDisplay"/>

   </Label.onInvoke>

</Label>

Theme element filter XML code:

<ElementFilter ElementName="Label">

...

</ElementFilter>

CSS element selector code:

qx-aum-label

.qx-aum-label .qx-text ↓

.qx-aum-label .qx-image

Inheritance diagram:

Most commonly used form properties:

allowNewLines

classnames

image

horizontalAlignment

verticalAlignment

preferredSize

textAlignment

text

Most commonly used theme properties:

Image:

New Image

Image Url

Image Scaling

Image Position

Size

Background:

New Background

Fill Color

Background Image

Background Style

Size

Location

Associated 4gl syntax:

DISPLAY TO

Associated ui methods:

SetImage

GetImage

SetText  →

GetText 

SetIsDynamic →

GetIsDynamic →

SetAllowNewlines →

GetAllowNewlines

Create

ForName

Influence and behavior:

In 4gl, there are two types of labels - static and dynamic.

Static labels cannot be modified at runtime. These labels are created by the DISPLAY...AT statement.

Dynamic labels can be modified at runtime. These labels can be made dynamic - by setting the isDynamic property to true in Form Builder, LTD, or via setIsDynamic().

 

To add a Label to your form, drag-and-drop a Label widget from the Palette to the Design Area. Mind that the form must have at least one container (a Root Container) to be able to contain widgets.

With Material Design, the label text is aligned to center, center.

 

 

Main Properties

Main properties for labels are text and image.

You can change the text of a label in the .fm2 form (using the master or user theme, via ui methods, or by the DISPLAY...TO statement.

Here you can find out how to change the image of the label both when designing the form or at runtime.

 

At runtime, labels can be manipulated with ui methods:

create()

creates an object of the ui.Label class:

LET lb= ui.Label.Create("lb1")

forName()

initializes the object of the ui.Label class:

LET lb= ui.Label.ForName("lb1")

setAllowNewLines()

enables multiple-line display to the label:

CALL lb.SetAllowNewLines(TRUE)

getAllowNewLines()

returns whether multiple-line display is allowed for the label

setImage()

sets the image for the label (requires setImageURL()):

CALL lb.SetImage(img_var)

getImage()

returns the image set for the label

setIsDynamic()

makes the dynamic label static:

CALL lb.SetIsDynamic(FALSE)

getIsDynamic()

returns whether the label is static or dynamic

Here you can read how to make a label static or dynamic using the setIsDynamic() method.

 

You can change appearance properties of a label via .qxtheme themes and CSS styles.

Properties set for labels via Lycia Theme Designer are applied both to dynamic and static labels. If you want to apply certain properties to dynamic or static labels only, you must use the Pseudo-Class filter - DynamicLabel or StaticLabel.

To apply a property to a label, set its value in the user theme, directly or using filters.

In the example below, we make a label look different by applying Background and Element Border properties with a With ID filter (the label has no text).

property applied in the user theme:

theme XML code

runtime appearance:

In the example below, we use CSS to change the style of the label text:

.qx-aum-label .qx-text {

    padding: 2px;

    padding: 5px 10px;

    color: white !important;

    font: bold 14px "Calibri","Helvetica Neue", Sans-Serif;

}

 

Label: Rating Bar

By assigning the label a couple of classes, you can turn it into a Rating Bar, assign colours to it, specify the value, and set the max value:

Classes

Purpose

rating

Turn a Label into a Rating Bar. A mandatory class for this feature.

rating-max-<maxvalue>

Specify a maximum value of a Rating Bar (5 or 10). Example: rating-max-10. Default (if not specified): max=5.

rating-value-<value> Display a certain value to the Rating Bar (amount of stars of the max value). Example: rating-value-5. Default (if not specified): value=0

The colour of the Rating Bar follows the current colour of the Label. However, you can also specify the appearance of your Rating Bars using CSS ↑.

 

Label: Tag

You can also turn your labels into tags:

To do that, add classes:

Classes

Result

tag

Turns a Label into a Tag. A mandatory class for this feature.

tag, attribute_red

Turn a Label into a Tag, uses a built-in Lycia class attribute_red.

tag, attribute_red, attribute_reverse

Turn a Label into a Tag, uses a built-in Lycia class attribute_red with the colour inversion for the text appearance.

tag, attribute_red, attribute_dim

Turn a Label into a Tag, uses a built-in Lycia class attribute_red with the colour dimming for the text appearance.

Alternatively, you can specify custom colors in the CSS file (e.g. UserTheme.css) and then add that custom class to the Label (in the example below, the custom class is called custom1. The custom class must have two variables - the background colour variable --md3-bg and the foreground colour variable --md3-fg:

.custom1 {
  --md3-bg: #DBEAFE !important;
  --md3-fg: #1E40AF !important;
}
Note: Tag labels are compatible with /public CSS styles, meaning that the /public styles don’t override the Tag styles (except that attribute_<colour> styles from /public may override standard Lycia attribute_<color> styles).

 

Label: Avatar

To turn a Label into an Avatar, add the avatar class to the Label widget and fill in the text property. This will turn a widget into a circular icon and render the text value as an abbreviation (in the example below, the text value is Avatar Without Image):

Example:

Customization

<Label isDynamic="true" text="Avatar Without Image" visible="true" verticalAlignment="Center" horizontalAlignment="Center" classNames="avatar, attribute_green, attribute_reverse, attribute_bold, attribute_dim" gridItemLocation="3,0,1,2" identifier="ava0">

Example:

<Label isDynamic="true" text="Avatar Without Image" visible="true" verticalAlignment="Center" horizontalAlignment="Center" classNames="avatar,attribute_green,attribute_reverse,attribute_bold,attribute_dim" gridItemLocation="3,0,1,2" identifier="ava0">
	<Label.image>
		<Image imageUrl="qx://application/ava_01.png" />
	</Label.image>

Example:

<Label isDynamic="true" text="Avatar Without Image" toolTip="&#10003;" visible="true" verticalAlignment="Center" horizontalAlignment="Center" classNames="avatar,attribute_green,attribute_reverse,attribute_bold,attribute_dim" gridItemLocation="3,0,1,2" identifier="ava0">
	<Label.image>
		<Image imageUrl="qx://application/ava_01.png" />
	</Label.image>

Examples:

 

 

 

 

Contact Us

Privacy Policy

Copyright © 2026 Querix, (UK) Ltd.