cancel
Showing results for 
Search instead for 
Did you mean: 

How can I achieve an edit widget like used in windows. For example, there is a cursor (with flash or not) when I'm inputing, and I can change it's postion by touch.

xchen.1480
Associate II
 
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Martin KJELDSEN
Chief III

Hi,

That may be a bit too complex to go into details about. I think, if you learned more about TouchGFX you could achieve this easily on your own.

What did you try so far? A hint: To place a cursor correctly you need to figure out the width of each character and figure out if the user presses the input field where to place the "cursor" and keep a state so that the user can delete or insert new characters at that point (Insert Unicode chars in the middle of a buffer).

/Martin

Hi,

​

Thank you for your reply.

​

I'm working to do a HMI with keypad, can modify some value by press key. So it is needed to show a cursor.

I have experience on emWin, and know I should get the width and coordinate of characters displayed in TextArea.

That's my one mind, the other is achieve an new edit widget, but it must be more complex.

​

It is the exact problem that how can I get the width and coordinate. I saw the manual but didn't find how to do.

That's better if you can give a little piece of code.

​

Thank you.