Subscribe Bookmark RSS Feed

alter width of texteditbox (JSL)

I have been unsuccessful in being able to adjust the width of a texteditbox from the default of 4 characters. Does anyone know how or if this can be accomplished?
5 REPLIES
This is how I'd do it:



That is, cheat by inserting a long prompt above it, and force the two boxes to be aligned.

[NB: I've just discovered that this works in JMP 8.0.2, but not in JMP 7]
I use the same cheat as David suggested. You can use spaces as the prompt to make it invisible. I also reduce the font size to 3 or 4 so that it has minimal impact on vertical alignment ... this does mean however that you need a very long prompt!

Pity there is not a more elegant way. I keep meaning to write a function to generate the text box based on pixel width - it would then determine how many spaces need to be used to create a prompt of the correct size - still on my to-do list though
aim

Community Trekker

Joined:

Jun 23, 2011

Here is an alternative solution, which works in JMP7 too: use set wrap( ) option and keep Text Edit Box content long (backfill with extra spaces).



style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">New
Window

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"test"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Border
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Left

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">5

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Right

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">5

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> top(

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">5

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
bottom(

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">5

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 2">           

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">V List
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Short
empty:"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text Edit
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">""

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Short:"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text Edit
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"short"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Long:"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text Edit
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"long
style="mso-spacerun: yes">                   
"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Long
empty:"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text Edit
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Repeat

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"
"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">100

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> )
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-spacerun: yes">  

style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//<--long
empty

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Persistent
width:"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 
pw_tb

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Text Edit
Box

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Repeat

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"
"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">100

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 4">                       

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">set
wrap(

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">200

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 4">                       

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">Set
Script( 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 5">                             

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Local

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
{tmp}

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 6">                                   
tmp

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> pw_tb

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> Get
Text()

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 6">                                   
pw_tb

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> Set
Text(

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Trim

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">tmp)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">||

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Repeat

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"
"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">100

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> )
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 5">                             
) 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 4">                       
) 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 3">                 
) 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 2">           
) 

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
)

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">

tsl

Community Trekker

Joined:

Jun 23, 2011

Perhaps a simpler solution is to use the << set width() option, provided you have JMP 9, this doesn't seem to do anything in JMP 8.0.2

New Window("Test",
V List Box(
"Test",
teb = text edit box("Change Me",
<< script(mytext = teb << Get Text),
<< set width(250)
)
)
)
"this doesn't seem to do anything in JMP 8.0.2"

... hence this thread