2020-04-14 11:33 PM
Hi,
I try to use setWideTextAction() to wrap my long text into new lines as it goes over screen.
However, setWideTextAction does not seem to do anything.
What I have done:
-disable Auto-size and set text area size within screen limits (to generate code below)
-set Ellipsis character for this typography to *
-use code:
textPopup.setPosition(29, 0, 180, 160);
textPopup.setColor(touchgfx::Color::getColorFrom24BitRGB(207, 207, 207));
textPopup.setLinespacing(0);
textPopup.setTypedText(touchgfx::TypedText(T_SINGLEUSEID228));
textPopup.setWideTextAction(WIDE_TEXT_CHARWRAP);
textPopup.invalidate();
textPopup.resizeToCurrentText();
textPopup.resizeHeightToCurrentText();
textPopup.invalidate();
There is no ellipsis character, no newlines, the text just prints over the borders like it was not there.
How to use this?
Thanks!
Solved! Go to Solution.
2020-04-14 11:55 PM
You've just resized to Current Text, so naturally there won't be any wrapping. The textarea is now as long as the text and requires no wrapping.
/Martin
2020-04-14 11:55 PM
You've just resized to Current Text, so naturally there won't be any wrapping. The textarea is now as long as the text and requires no wrapping.
/Martin
2020-04-15 12:02 AM
Oh right, didn't realize that it will cut the text.
Thanks, just saved me many hours, worked immediately!
2020-04-15 12:08 AM
Awesome! :) No problem.
2020-11-17 05:04 PM
Good grief, I fell in this trap too ! :grimacing_face:
Thanks @Martin KJELDSEN ! 🤩
2020-11-17 11:40 PM
Haha. No problem. If there's a trap, then there's probably something to be improved.