cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
djhanson
Level V

Caption Box - Text Wrap Possible?

Is there any way to control (expand) the Caption() box text wrap?  

I'm guessing not from the Scripting Guide.  It would be a nice feature if ever possible.  It's kind of annoying to have a line wrap where you don't want it to wrap, and if set wrap() could ever be employed, then one could choose the line break where they wanted using a normal line break escape.

 

thanks, DJ

3 REPLIES 3
txnelson
Super User

Re: Caption Box - Text Wrap Possible?

You can use the Carriage Return Line Feed escape sequence to wrap to the next line

explan.PNG

explan.PNG

Names Default To Here( 1 );
Caption(
	{100, 200},
	"explan\!nation",
	Font( "Arial Black" ),
	Font Size( 16 ),
	Text Color( "blue" ),
	Back Color( "yellow" ),
	Spoken( 1 )
);

 

Jim
marie_gaudard
Level III

Re: Caption Box - Text Wrap Possible?

Hi DJ!  I'm not sure, but is this what you are looking for?  It uses one of the escape sequences for quoted strings. (See the section  JSL Building Blocks > JSL Syntax Rules in the Scripting Guide.)  --Marie

 

Names Default To Here( 1 );
Caption(
	{100, 200},
	"This is a \!Nvery \!Nvery \!Nlong sentence.",
	Font( "Arial Black" ),
	Font Size( 16 ),
	Spoken(0)
);
pmroz
Super User

Re: Caption Box - Text Wrap Possible?

I don't think that's what @djhanson is looking for.  They want to control where the wrap occurs, rather than force the wrap with embedded CR/LFs.

For example:

caption("The quick brown fox jumped over the lazy dog.  Hello world hello world");

produces this:

caption1.png

You could use a text box to control the wrap.  Not quite the same as caption() though.

nw = new window("Caption",
	tb = textbox("The quick brown fox jumped over the lazy dog.  Hello world hello world")
);
tb << set wrap(500);
wait(4);
nw << close window();

caption2.png