2022-10-05 05:30 AM
2022-10-11 07:35 AM
Hello heyo,
I'm not sure what you want to do. Can you be a more specific in your question ?
If you just want to add a cursor to your text, I'm going to say to simply use the vertical line symbol ( | ) at the end of you text like this :
I'm using the keyboard widget shared in this post and I only modified the TextArea to add the vertical bar like this :
/Osman
2022-10-11 10:03 AM
@Osman SOYKURT I want that my cursor position changes when I touch anywhere in the text. If I touch in the middle of the text it appears in the middle in the text and then I can edit text. And I want to ask another question. Is it possible to know a coordinate of writeable text?
2022-10-11 09:21 PM
@Osman SOYKURT also I use textArea.setWideTextAction(WIDE_TEXT_WORDWRAP_ELLIPSIS_AFTER_SPACE); function. Is it possible to know when text goes to next line?
2022-10-12 01:02 AM
We don't have a particular trigger for that in our API, but this is easily doable with an handleTickEvent() function combined with a getTextHeight() function. You first get the text heigh of your text when your application starts and then compare the the current height with the original height
Something like this :
getTextHeight
void Screen1View::setupScreen()
{
originalSize = textArea1.getTextHeight();
}
void Screen1View::handleTickEvent()
{
currentSize = textArea1.getTextHeight();
if (currentSize > originalSize)
{
// Added one line
originalSize = currentSize;
}
else if (currentSize < originalSize)
{
// Removed one line
originalSize = currentSize;
}
else if (currentSize == originalSize)
{
// still same line number
}
}
/Osman
2022-10-12 01:21 AM
@Osman SOYKURT This function "textArea1.getHeight() " returns defined textArea1 height, so its always be the same and does not change.
2022-10-12 02:49 AM
2022-10-12 02:51 AM
And btw, if your TextArea is "autosized" then a getHeight() won't be the same if you change if you add lines.
2022-10-12 02:54 AM
I saw that @Yoann KLEIN was helping you on this post. The provided solution is not working ?
/Osman
2022-10-12 03:02 AM
@Osman SOYKURT Thanks.