Location

Location specifies the place of the area where the background image is placed.

Will have an effect only if backgroundStyle = "Normal".

Location of the element's background image can be changed in Lycia Theme Designer or via ui methods.

Theme property filter XML code:

<DoStyleAction>

  <SetProperty>

    <PropertyPath>

      <PropertyName>Background</PropertyName>

      <PropertyName>Location</PropertyName>

    </PropertyPath>

    <PropertyValue type="Location" XCoord="10px" YCoord="20px" />

  </SetProperty>

</DoStyleAction>

By default, location of the element's background image is taken by default and is absent from the theme XML code. The property value will appear in the theme XML code only once it is specified.

Possible values:

a record of integer values in pixels, em, rem, or qch

Associated containers, widgets and theme elements:

BorderPanel

CoordPanel

GridPanel

GroupBox

StackPanel

ScrollViewer

Tab

TabPage

Table

TreeTable

BlobViewer

Browser

Button

Calendar

Canvas

CheckBox

ComboBox

FunctionField

Label

MenuGroup

MenuCommand

ProgressBar

RadioGroup

Slider

Spinner

TextArea

TextField

Toolbar

ToolbarButton

TimeEditField

WebComponent

Inheritance diagram:

Associated ui methods:

setLocation

getLocation

Influence and behavior:

Location property will have any effect on the background image only if backgroundStyle is set to "Normal".
Otherwise, the backgroundStyle value will overwrite any location coordinates.

Regardless of whether you use Lycia Theme Designer or ui methods to change the location of the element's background image, you can set it in these units:

Below the parameters of the Location property are called coordinates regardless of what units you use and what container(s) you have in your form.

 

In Lycia Theme Designer, location of the element's background image is not specified directly to the Location property but to the placeholder called New Location. New Locationis an optional ui object (=ui.Location) created to hold the coordinates that specify the location of the element's background image:

To specify the location of the element's background image, you must set its x and/or y coordinates in px, em, rem, or qch:

property is not set

(runtime appearance)

property is set

(runtime appearance)

 

At runtime, you can use ui method - <var>.SetLocation() - to change the location of the element's background image.

For this purpose, you must

  1. define a variable of the ui.Background data type,
  2. specify the element's background via <var>.SetBackgroundImage() and <var>.SetBackgroundStyle() methods applied to this variable,
  3. apply <var>.SetLocation() to this variable,
  4. apply the background to the form element by the <var>.setBackground() method:

<var>.SetLocation() method can be applied only together with <var>.SetBackgroundStyle("Normal").

Otherwise, it will have no effect on the location of the element's background image.

4gl code sample

MAIN
DEFINE lb ui.LabelDEFINE bg ui.Background
DEFINE sc ui.SystemColor
OPEN WINDOW w WITH FORM "background_ui" ATTRIBUTE(BORDER)
  LET lb= ui.Label.ForName("lb1")
    CALL bg.SetBackgroundImage("qx://application/querix.png")
    CALL bg.SetBackgroundStyle("Normal")
    CALL bg.SetSize(["50px", "50px"])
    CALL bg.SetLocation(["175px", "100px"])
CALL lb.SetBackground(bg)
CALL fgl_getkey()
END MAIN

default appearance

(in the form)

runtime appearance

Please compare these results to the example program.

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.