Skip to main content
MHase
Associate III
January 28, 2020
Question

Displaying long texts in a small text area.

  • January 28, 2020
  • 4 replies
  • 1344 views

Is it possible that long texts automatically are displayed in a small text area by running endless to the end of the text and starting again at the beginning? Scrolling the text within one textline?

Are there examples in youtube to see the result, and how it has to be used?

This topic has been closed for replies.

4 replies

Martin KJELDSEN
Principal III
January 28, 2020

Hi,

Yes.

textArea.setTypedText(TypedText(T_MYLONGTEXT);
textArea.setWideTextAction(WIDE_TEXT_WORDWRAP);

You can do the same for something like chinese with:

textArea.setWideTextAction(WIDE_TEXT_CHARWRAP);

/Martin

MHase
MHaseAuthor
Associate III
January 28, 2020

Is there also another solution? I don't want the long text in a new line. I would prefer when my text could running through the first line like a treadmill.

Martin KJELDSEN
Principal III
January 28, 2020

That's what WORDWRAP does. It breaks for you.

eng23
Senior
January 28, 2020

Hi @MHase​ 

I've tried the WIDE_TEXT_WORDWRAP but I need in one line too..

So I've implemented a function to rotate the Wildcard buffer, below you can find the function:

void Screen_MultimidiaView::string_rotate_right( char *s )
{
 size_t n = strlen( s );
 
 if ( n > 1 )
 {
 char c = s[n - 1];
 memmove( s + 1, s, n - 1 );
 *s = c;
 }
}
 
void Screen_MultimidiaView::string_rotate_left( char *s )
{
 size_t n = strlen( s );
 
 if ( n > 1 )
 {
 char c = s[0];
 memmove( s, s+1, n - 1 );
 s[n - 1] = c;
 }
}

This function rotate in one character, so for example you can call this function each second.

Regards,

Anderson