allowNewLines

 

allowNewLines enables multiple-lines display to a widget as well as specifies the application behavior after pressing the Enter key at runtime.

 

in Lycia Form Designer

in Lycia Theme Designer

 

 

Form XML code:

 

<element_name 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:

 

<DoStyleAction>

  <SetProperty>

    <PropertyPath>

      <PropertyName>AllowNewLines</PropertyName>

    </PropertyPath>

  </SetProperty>

</DoStyleAction>

 

Possible values: true, false

 

Default value: false

 

Associated containers, widgets and theme elements:

Button

CheckBox

Label

 

RadioButton

RadioButtonListItem

TextArea

ToolbarButton

 

Associated ui methods:

SetAllowNewLines 

GetAllowNewLines 

 

Associated 4gl syntax:

DISPLAY 

INPUT 

 

Influence and behavior:

 

 

 

 

With DISPLAY, allowNewLines specifies whether a text within widgets will be automatically split into several lines in case the text string is too long to fit the widget width, i.e. whether the text will be displayed in a single or multiple lines (in screenshots here and below, text appearance is set by the user theme):

 

lycia form designer

For the first textArea (identifier=f1), allowNewLines=true:

 

 

For the first textArea (identifier=f1), allowNewLines=false:

 

 

4gl code

MAIN

DEFINE f1, f2 STRING

OPEN WINDOW w WITH FORM "allownewlines" ATTRIBUTE(BORDER)

  DISPLAY "With DISPLAY, allowNewLines specifies whether the text will be displayed in a single or multiple lines." TO f1

  DISPLAY "With DISPLAY, allowNewLines specifies whether the text will be displayed in a single or multiple lines." TO f2

 

CALL fgl_getkey()

END MAIN

 

runtime appearance

 

 

The same behavior is applied to the initial text set in the form as the value for the text property:

 

lycia form designer

For the first textArea (identifier=f1), allowNewLines=true:

 

 

For the first textArea (identifier=f1), allowNewLines=false:

 

 

runtime appearance

 

 

 

 

 

 

 

With INPUT, if allowNewLines is set to false, then after the Enter key is pressed, the application will move to another form element at runtime. Otherwise, a newline symbol will be created inside the current field:

 

lycia form designer

For the first textArea (identifier=f1), allowNewLines=true:

 

 

For the first textArea (identifier=f1), allowNewLines=false:

 

 

4gl code

MAIN

DEFINE f1, f2 STRING

 

OPEN WINDOW w WITH FORM "allownewlines" ATTRIBUTE(BORDER)

 

MENU

  COMMAND "input"

    INPUT BY NAME f1 WITHOUT DEFAULTS

    INPUT BY NAME f2 WITHOUT DEFAULTS

  COMMAND "exit"

    EXIT MENU

END MENU

 

END MAIN

 

runtime appearance before pressing Enter

runtime appearance after pressing Enter

 

 

 

 

 

At runtime, you can use ui methods to specify the application behavior at runtime:

 

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

CALL widget_var.setAllowNewLines(...)

DISPLAY widget_var.getAllowNewLines()

 

4gl code sample

DEFINE ta_1, ta_2 ui.TextArea

...

LET ta_1 = ui.TextArea.ForName("f1")

LET ta_2 = ui.TextArea.ForName("f2")

...

CALL ta_1.setAllowNewLines(0)

CALL ta_2.setAllowNewLines(1)

DISPLAY ta_1.getAllowNewLines()

DISPLAY ta_2.getAllowNewLines()

 

runtime behavior for DISPLAY

 

runtime behavior for INPUT

 

The examples above were taken from the example program.

 

 

Example programs:

CVS server: client.querix.com

CVS repository: /lycia_doc_examples

User: client

Project: form_properties

Program: allowNewLines