Size

Size specifies the dimensions of the element's background image.

Size of the element's background image is changed in Lycia Theme Designer.

Theme property filter XML code:

<DoStyleAction>

  <SetProperty>

    <PropertyPath>

      <PropertyName>Background</PropertyName>

      <PropertyName>Size</PropertyName>

    </PropertyPath>

    <PropertyValue type="Size" Width="50px" Height="50px" />

  </SetProperty>

</DoStyleAction>

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:

setSize

getSize

Influence and behavior:

Size property will have any effect on the background image only if Background Style is set to "Normal", "Centered", and "Tiled".
Otherwise, the Background Style value will overwrite any size values.

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

 

In Lycia Theme Designer, size of the element's background image is not specified directly to the Size property but to the placeholder called New Size. New Sizeis an optional ui object (=ui.Size) created to hold the dimensions - width and height - of the element's background image:

To specify the size of the element's background image, you must set its width ans height 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>.SetSize() - to change the size 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>.SetSize() to this variable,
  4. apply the background to the form element by the <var>.setBackground() method:

<var>.SetSize() method can be applied only if the <var>.SetBackgroundStyle() method has parameters - "Normal", "Centered", or "Tiled".

Otherwise, it will not change the dimensions of the element's background image.

4gl code sample

MAIN
DEFINE lb ui.Label
DEFINE 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.