Multi paragraph text in .str files



  • On 21/10/2016 at 05:12, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R18 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Hello.

    Can I have a text paragraph as STATICTEXT in a NodeData plugin ?
    I have tried using \n but it doesn't work.

    Thank you.



  • On 24/10/2016 at 01:57, xxxxxxxx wrote:

    Hi,

    in your resource file you'd use a STRING with CUSTOMGUI MULTISTRING. Additionally add the READONLY flag to mimic the static text behavior.
    Like so:

    STRING MY_PARAGRAPH { ANIM OFF; CUSTOMGUI MULTISTRING; WORDWRAP; READONLY; }
    

    Inside of the string you can use the pipe symbol ("|") for newline.



  • On 10/08/2017 at 18:53, xxxxxxxx wrote:

    Hi all,

    Andreas, is still valid the pipe symbol for the newline?

    Thanks in advance
    Renato



  • On 11/08/2017 at 02:17, xxxxxxxx wrote:

    Hi Renato,

    I'm not aware of any changes on our end. But as you are asking, you are probably having problems with it?



  • On 11/08/2017 at 09:21, xxxxxxxx wrote:

    Hi Andreas,

    yes, i'm trying to output some lines to:
    STRING MY_TEXT_INFO { ANIM OFF; CUSTOMGUI MULTISTRING; WORDWRAP; READONLY; }

    adding the Pipe Symbol.. but the output is with pipe instead a newline:

    here the example:
    Grid Name: density - Grid Class: unknown | Grid Name: temperature - Grid Class: unknown | Grid Name: v - Grid Class: unknown |

    would be good to have:
    Grid Name: density - Grid Class: unknown
    Grid Name: temperature - Grid Class: unknown
    Grid Name: v - Grid Class: unknown



  • On 11/08/2017 at 18:07, xxxxxxxx wrote:

    If you create the string in your code, you need to use
    actual newlines.



  • On 11/08/2017 at 19:49, xxxxxxxx wrote:

    Hi Niklas, what do you mean with "actual newline" ?
    I tried to construct my string with '\n' without luck.



  • On 12/08/2017 at 17:59, xxxxxxxx wrote:

    I'm sorry... but maybe too hot in the brain.

    Thanks all for your time :)



  • On 14/08/2017 at 08:49, xxxxxxxx wrote:

    Hi,

    just for future readers, as it might not be completely clear: When setting a multi-line string parameter via code, one needs to use newline '\n' to add additional lines. While in the string file it is the pipe symbol '|'.

    I will add this information also to one of the code examples.



  • On 14/08/2017 at 09:57, xxxxxxxx wrote:

    Thanks Andreas :)



  • On 25/08/2017 at 11:56, xxxxxxxx wrote:

    I was just giving this a try in a c4d_strings.str stringtable. I get the string with the Pipe symbol still in
    the text (using GeLoadString in Python), rather than it being replaced by a newline. Does this only work
    in C++ or in description/dialog stringtables?

    Thanks!



  • On 29/08/2017 at 08:20, xxxxxxxx wrote:

    Hi Niklas,

    indeed GeLoadString() does not care for line wraps, neither in C++ nor in Python.
    A small helper function could look like this:

    static String GeLoadStringUpd(Int32 id)
    {
    	Int32 i;
    	String str = GeLoadString(id);
    	for (i = str.GetLength() - 1; i >= 0; i--)
    	{
    		if (str[i] == '|')
    		{
    			str.Delete(i, 1);
    			str.Insert(i, GeGetLineEnd());
    		}
    	}
    	return str;
    }
    


  • On 30/08/2017 at 02:31, xxxxxxxx wrote:

    for me, \u000d works to create a line break in a str file.


Log in to reply