Skip to main content
Tuoman
Senior II
Apr 15, 2020 6:33 AM UTC
Solved

setWideTextAction() not having desired effect

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!

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Apr 15, 2020 6:55 AM UTC

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

5 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Apr 15, 2020 6:55 AM UTC

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

Tuoman
TuomanAuthor
Senior II
Apr 15, 2020 7:02 AM UTC

Oh right, didn't realize that it will cut the text.

Thanks, just saved me many hours, worked immediately!

Martin KJELDSEN
Principal III
Apr 15, 2020 7:08 AM UTC

Awesome! :) No problem.

arnaljl
Associate III
Nov 18, 2020 1:04 AM UTC

Good grief, I fell in this trap too ! :grimacing_face:

​

Thanks @Martin KJELDSEN​  ! 🤩

Martin KJELDSEN
Principal III
Nov 18, 2020 7:40 AM UTC

Haha. No problem. If there's a trap, then there's probably something to be improved.