Edit field

Control "Edit field" is intended to enter a text string or a number from the keypad in the GUI. The value entered is transmitted to the controller in the corresponding field RemoteXY structure. Input field supports the input arbitrary text, integer and float values.

Transmitting data

DataTypeValue
For text string
The entered text stringchar[x]The entered text string is UTF-8 ends in a zero, a string allocated x bytes
For float
The entered numeric valuefloat (32 bit)The entered numeric value
For integer
The entered numeric valueint16_t (signed 16 bit)The entered numeric value

Description

"Input field" control allows to enter any text information or numerical information to the GUI screen. Input field supports three modes of input: arbitrary text value, the integer value, the float value.

When entering text, the number of bytes allocated for the string specified in the element settings. Use UTF8 encoding, that some characters allocated 2 bytes per character.

When entering float numbers you must specify the count of decimal which displayed in the edit field.

Support of type input value is performed on the step of putting value by providing the user the appropriate keyboard for input.

The edit field can contain the clear button for reset the entered value. Supported alignment of the entered text to the left, right and center.

Settings

PropertyValue
Variable nameVariable name in RemoteXY structure C++ rules
ColorEdit field color
Input typeSpecifies the type of value. Available values: text string, float, integer.
LengthThe count of bytes allocated for the string. The system automatically adds 1 byte for the terminating zero. The property is set only for the text string. Please note that UTF8 encoding some characters occupy 2 bytes.
DecimalsThe count of decimal places displayed in the edit field. The property is set only for float values.
AlignThe horizontal alignment of the text into edit field. Available values: left, center, right.
Show backgroundShow background of display edit field .
Clear buttonShow cleaning button of edit field .

Examples of Arduino IDE

To check the string entered into the edit field equal of a defined string, you can use the following code:


  if (strcmp (RemoteXY.edit_1, "OK")==0) {
    // TODO entered “OK”

  }

An example of how to transform the input string to a numeric data type, if used for data input arbitrary text:

For integer:


int value = atoi (RemoteXY.edit_1);

For float:


float value = atof (RemoteXY.edit_1);