41 views
in GUI Development by
Please,

which widget / template is better to get a numerical value from the user?

If I understood right the purpose of a "ValueDisplay" is an output widget to show a numerical value and a "TextEditor" is an input template to get a string from the user.

But if I need to show a numerical value (integer,decimals,units,max,min) and allow the user to modify this? How could I mix a "textEditor" and a "ValueDisplay" to get ascii data from the user and format it as a numerical value (integer or float)? What would be the proper and easiest way?
Thank you in advance.

1 Answer

0 votes
by

Hello,

What would be the proper and easiest way?

to input text use Text Editor component. Process the resulting string thereupon. What exact does this processing include, depends on the input format. If the string is a simple number, use one of the parse_float(), parse_int64(), parse_int32() etc. functions to convert the string in a number.

If the input contains units, etc. you have to split the text in the fragment containing the number a fragment containing the unit. Then evaluate the unit. See also string data type for description of diverse functions to search in the string and split it.

To output the values you could use the Display Value. Then you have to take care of the unit. Or you implement the opposite operation to the described above where number and unit are composed to a string. Then display the string in a Text view.

I hope it helps you further.

Best regards

Paul Banach

by
Thank you for your explanation Paul!

Maybe my question was not very well focused. My need is to output a numerical value stored in the filesystem of the underlying hardware and in addition to allow the user to edit this value in the same component. So the widget needs to be an output and input at the same time.

Best Regards.

Javier.
by
Hello Javier,

in such case use the Text Editor Component.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...