Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To specify a text input field create a <field> tag <field> tag and use the type attribute the type attribute with a value of text. The txt and id attributes of text. The txt and id attributes are not supported here. The variable attribute The variable attribute specifies the variable that should be replaced with the text taken from the input field.

Data

The data consists of two items, a description and the spec. The <spec> tag The <spec> tag uses four attributes. The label text is specified with txt and/or id as with txt and/or id as described above. In addition, the width of the input field as it appears on the panel can be set with the size attributethe size attribute. The value must be an integer and sets the field width based on the average character width of the active font. If this is not specified, then you will end up with a very narrow field that is practically unusable.

The fourth attribute set is attribute set is optional. It takes a text string to pre-fill the input field.

Example

The following example creates a text input field with a label and description. The width of the input field will be enough to accommodate 15 characters. The field will be pre-set with the text 'some text' when the UI is first presented.

Code Block
languagexml
<field type="text" variable="textInput">
  <description txt="A description for a text input field"
      id="description.text"/>
  <spec txt="Enter some text:" id="text.label" size="15" set="some text"/>
</field>