Jump to content
Sign in to follow this  
Bon

insert linebreak in control Text

Recommended Posts

Can someone explain to me how I can insert line breaks into control text?

So I have a line in a script looks like

ctrlSetText [_idc, "Text which is just too long to fit in the dialog appropriately, best would be to insert a line break some words before...."]; 

I tried the following:

Changed the textbox type to CT_STRUCTURED_TEXT as it is written here in the biki. Then tried both

_control ctrlSetStructuredText parseText "First line<br/>Second line"

as well as I tried

_control ctrlSetStructuredText composeText["First Line", linebreak, "Second line"];

but did not succedd yet. Any help would be appreciated.

In both cases the text is not shown. Its no syntax errors (all arguments and parameters are of the needed type), so it must be just the wrong way.

Share this post


Link to post
Share on other sites

\n\n

Adds breaks to codes like that. I've used it in mission intro's before...hope that helps!

Share this post


Link to post
Share on other sites

\n does not work with ctrlSetText. But thanks.

Share this post


Link to post
Share on other sites

Well, as much as I understood it SHOULD work with <br/> when the text is of Structured Text type. But that I already tried as I mentioned above, unfortunately without success.

Share this post


Link to post
Share on other sites

This code should work on a structured text type. Are you sure you have one?

Share this post


Link to post
Share on other sites
Well, as much as I understood it SHOULD work with <br/> when the text is of Structured Text type. But that I already tried as I mentioned above, unfortunately without success.

You didn't answer my question, did you try changing the text to anything else without the line break just to see if that works?

Share this post


Link to post
Share on other sites

Add this to your control:

style = ST_MULTI;
lineSpacing = 1;

Share this post


Link to post
Share on other sites

@Deadfast: Sorry, I read "with" instead of "without", was just too late for me yesterday.

@Clayman:

That did the trick.

Vielen Dank nach Bremen. :yay:

Share this post


Link to post
Share on other sites

_control ctrlSetStructuredText parseText "First line<br/>Second line"

How do you define what _control is in a script? I try the idc and get an error.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×