TextEdit

The TextEdit item type defines a multi-line edit field for data input or display.

Example


This figure shows an example of a multi-line edit field defined by the TextEdit item type.

Figure 1. TextEdit

Properties

case, color, colorCondition, comment, defaultValue, fontPitch, hidden, include, justify ,noEntry, notNull, required, sample, scrollbars, sizePolicy, stretch, style, tabIndex, tag, Validate Like, wantTabs, wantNoReturns

Usage

This kind of form field allows the user to enter a long text on multiple lines.

By default, when the focus is in a TextEdit field, the TAB key moves to the next field, while the RETURN key adds a newline (ASCII 10) character in the text. To control the user input when the TAB and RETURN keys are pressed, you can specify the wantTabs and wantNoReturns properties. When you specify wantTabs, the TAB key is consumed by the TextEdit field, and a TAB character is added to the text. The user can still jump out of the field with the Shift-TAB combination. When you specify wantNoReturns, the RETURN key is not consumed by the TextEdit field, and the action corresponding to the RETURN key is triggered. The user can still enter a newline character with Shift-RETURN or Control-RETURN.

You can use the scrollbars property to define vertical and/or horizontal scrollbars. By default, this attribute is set to Vertical. The stretch property can be used to force the TextEdit field to stretch when the parent container is re-sized. Values can be NONE, X, Y or BOTH. By default, this attribute is set to NONE. Note that using either the SCROLLBARS or the STRETCH attribute will automatically set the SCROLL attribute. For more details about size limitation, see the scroll property.

Some front-ends support different text formats which can be controlled by a style property. You can for example display and input HTML content in a TextEdit.

Since Genero 2.20, a TextEdit can also be used to edit rich text format. Depending on the front-end, different formatting options are available (bold, font size, and so on) and can be controlled using either an integrated toolbox or via local actions. In this case, the value of the field will be an HTML representation of the text and its decoration.

Note: Each front-end uses its underlying technology to provide this feature and the html representation may vary between front-ends (GDC uses Qt QTexEdit, GWC/Ajax and GWC/HTML uses the browser capabilities, GWC/SL uses Silverlight capabilities). They are most of the time compatible but not every time, and the html representation may change depending on the version (Qt upgrade for GDC, Silverlight upgrade for GWC/SL, browser update for GWC/Ajax or HTML5).
Note: When using rich text, FGL_DIALOG_SETCURSOR() and FGL_DIALOG_SETSELECTION() functions must be called carefully. The rich text format, having a corresponding cursor position / selection between displayed text and html representation, may make it difficult.