cancel
Showing results for 
Search instead for 
Did you mean: 

setWideTextAction() not having desired effect

Tuoman
Senior II

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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

View solution in original post

5 REPLIES 5
Martin KJELDSEN
Chief III

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

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

Thanks, just saved me many hours, worked immediately!

Awesome! :) No problem.

arnaljl
Associate III

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

Thanks @Martin KJELDSEN​  ! 🤩

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