Edittext

An edittext item is used to place an editable text field where the user can type and edit text. The syntax is:

edittext <name> [ <caption> ] [ text:<string> ] \

                [ fieldWidth:<integer> ] [bold:<boolean> ]

The default alignment of edittext items is #left.

Example:

edittext prefix_txt "Name prefix:" fieldWidth:70

on prefix_txt entered text do ...

...

new_obj = copy master pos:[x,y,z] prefix:prefix_txt.text

...

Parameters

text:

The text string in the edit box.

fieldWidth:

The width in pixels of the edit box. By default, the width is set to be from just after the caption text to the right margin of the rollout.

bold:

If set to true, the text string in the edit box is displayed in bold format, if set to false, in normal, non-bold format. The default value is false.

Properties

<edittext>.text               String

The text in the edit box.

<edittext>.caption            String

The text of the optional caption next to the edit box.

<edittext>.bold               Boolean

If true, the text is displayed in bold format, if false, in normal, non-bold format.

Events

on <edittext> changed <arg> do <expr>

Called each time the user changes the text in the edit box; the <arg> argument contains the new text in the edit box.

on <edittext> entered <arg> do <expr>

Called when the user enters text in the edit box and then presses ENTER or TAB to move the cursor out of the field. The <arg> argument contains the new text in the edit box.

If you enter a string in the edit box and then press ENTER, the on changed handler is called once per character and once for the ENTER. The on entered handler is just called once, for the ENTER.

See also