Results 1 to 10 of 10

Thread: insert linebreak in control Text

  1. #1

    insert linebreak in control Text

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

    So I have a line in a script looks like

    Code:
    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
    Code:
    _control ctrlSetStructuredText parseText "First line<br/>Second line"
    as well as I tried
    Code:
    _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.

  2. #2
    Code:
    \n\n
    Adds breaks to codes like that. I've used it in mission intro's before...hope that helps!

    A2: US Marines v1.2 | Force Recon v1.2
    I keep having people ask me if I'm going to 'port' my work from A2 to A3. I'm not going to 'port' anything. Will I be making new original work? Possibly.

  3. #3
    Gunnery Sergeant Bon's Avatar
    Join Date
    Jun 4 2009
    Location
    Germany
    Posts
    556
    Author of the Thread
    \n does not work with ctrlSetText. But thanks.

  4. #4
    Does it work without the <br/> tag?

  5. #5
    Gunnery Sergeant Bon's Avatar
    Join Date
    Jun 4 2009
    Location
    Germany
    Posts
    556
    Author of the Thread
    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.

  6. #6
    This code should work on a structured text type. Are you sure you have one?
    #include "signatur.h"
    "I'm not slacking of. My addon is 'pboing'!"

    Blog about the RTE | Pastebin with SQF support

  7. #7
    Quote Originally Posted by Bon View Post
    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?

  8. #8
    Add this to your control:
    Code:
    style = ST_MULTI;
    lineSpacing = 1;


    >> Carpe Noctem <<

  9. #9
    Gunnery Sergeant Bon's Avatar
    Join Date
    Jun 4 2009
    Location
    Germany
    Posts
    556
    Author of the Thread
    @Deadfast: Sorry, I read "with" instead of "without", was just too late for me yesterday.

    @Clayman:
    That did the trick.

    Vielen Dank nach Bremen.

  10. #10
    Quote Originally Posted by Bon View Post
    Code:
    _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.
    hackers come in my server, make people dance

    Click to see my Rig!
    Spoiler:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •