allowNewLines

Form and theme XML code

Possible and default values

Associated containers, widgets and theme elements

Associated 4gl syntax and ui methods

Influence and behavior

allowNewLines enables multiple-line display to a widget.

Form XML code:

<Label ... allowNewlines="true"/>
By default, the property is set to false and is absent from the form XML code. The property value will appear in the form XML code only once the property value is set to true.

Theme property filter XML code:

<ElementFilter ElementName="Label">

  ...

      <SetProperty>

        <PropertyPath>

          <PropertyName>AllowNewlines</PropertyName>

        </PropertyPath>

      </SetProperty>

  ...

</ElementFilter>

Possible values:

true, false

Default value:

false

Associated containers, widgets and theme elements:

Button

Label

TableColumn

ToolbarButton

Associated 4gl syntax:

DISPLAY

Associated ui methods:

setAllowNewLines

getAllowNewLines

Influence and behavior:

With DISPLAY, allowNewLines specifies whether the text will be displayed in a single or multiple lines if it is too long to fit in the widget:

lycia form designer

For the 1st label (identifier=lb1), allowNewLines=true:

For the 2nd label (identifier=lb2), allowNewLines=false:

4gl code sample

MAIN
DEFINE lb1, lb2 STRING
OPEN WINDOW w WITH FORM "allownewlines" ATTRIBUTE(BORDER)
DISPLAY "allowNewLines = true" TO lb1
DISPLAY "allowNewLines = false" TO lb2
CALL fgl_getkey()
END MAIN

runtime behavior

(with the user theme applied)

When set to true, allowNewLines will split both the text displayed at runtime (as above) and the text set in the .fm2 form for the text property:

lycia form designer

runtime behavior

(with the user theme applied)

 

At runtime, you can use ui method - setAllowNewLines() - to specify the application behavior at runtime:

LET widget_var = ui.<widget>.ForName("widget_id1")

CALL widget_var.setAllowNewLines(...)

4gl code sample

DEFINE lb_1, lb_2 ui.Label
...
LET lb_1 = ui.Label.ForName("lb1")
LET lb_2 = ui.Label.ForName("lb2")
CALL lb_1.setAllowNewLines(0)
CALL lb_2.setAllowNewLines(1)
CALL lb_1.setText("allowNewLines enables multiple-line display")
CALL lb_2.setText("allowNewLines enables multiple-line display")

runtime behavior

(with the user theme applied)

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.