Skip to main content
Tuoman
Senior II
April 15, 2020
Solved

setWideTextAction() not having desired effect

  • April 15, 2020
  • 5 replies
  • 1702 views

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.
Best answer by Martin KJELDSEN

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
April 15, 2020

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
April 15, 2020

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

Thanks, just saved me many hours, worked immediately!

Martin KJELDSEN
Principal III
April 15, 2020

Awesome! :) No problem.

arnaljl
Associate III
November 18, 2020

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

Thanks @Martin KJELDSEN​  ! 🤩

Martin KJELDSEN
Principal III
November 18, 2020

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