cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying long texts in a small text area.

MHase
Associate II

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?

4 REPLIES 4
Martin KJELDSEN
Chief III

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
Associate II

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.

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

eng23
Senior

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