JSL Check Box Set SizeHello JMP folk,
Is it possible to change the size of a Check Box by script? Looking through the documentation I set the max size before changing the Height & Width but I have still not been able to increase the checkbox size. Have not found any other topics on this in the forum.
windowMain = New Window( "test",
//Header
Outline Box( "",
H List Box(
Check Box( "", << Set Max Size(30,30), << Set Width(30), << Set Height(30), << SetAll(1)),
)
)
);
Re: JSL Check Box Set SizeYep, MouseBox can do all of that. Mouseboxes can also hold data for you to use in a callback function. Below is a small example of using icons as buttons, but you could also use pictures.
Icon Mouse Box = Function( {icon, data},
MouseBox(
Icon Box( icon ),
<<SET user="" data="https://community.jmp.com/"> "nominal", "someOtherData" => 1] ),
Icon Mouse Box( "Ordinal", ["type" => "ordinal", "someOtherData" => 2] ),
Icon Mouse Box( "Continuous", ["type" => "continuous", "someOtherData" => 3] )
)
),
Text Box(), //Spacing
txt = Text Box( "Nothing selected" ),
<<PADDING></PADDING></SET>
Here's an aimated GIF of the above script in action:

The best real-life example I have of using icons with MouseBox is in my Built-In JMP Icons add-in. It has several mouse boxes within icons in them, with selection and hover actions.
My Word Import Tool, Add-In Manager and JMP User Community add-ins show a few more use cases for using mouse box, but the code in those is a bit more complex.
Re: JSL Check Box Set SizeUsing custom image icons as control boxes for users. (Check boxes, Click box, etc.) Add event functionality for clicking on an image / logos.
Re: JSL Check Box Set SizeA MouseBox can hold any display box. Can you give me a better idea of what you are trying to do with the image?
Re: JSL Check Box Set SizeNow that is a great approach, do you know if a Mouse Box can encapsulate an image? Thank you for your detailed reply.
Re: JSL Check Box Set SizeI'm not sure how complex of a solution you are looking for, but I am a big fan of using the MouseBox display to create my own custom displays. Below is a function that allows you to create a custom check box where you can set the width of the text. It uses MouseBox to capture the click while your mouse is over the text to emulate the behavior of a native check box.
Custom Check Box = Function( {text, width},
H List Box( Align( "center" ),
Check Box( "" ),
Mouse Box(
H List Box(
Spacer Box( Size( 5, 0 ) ), // for good alignment
Text Box( text,
<<SET width=""></SET>
Here's a screenshot of the resulting window:

Re: JSL Check Box Set SizeI didn't see a way to change the size of the box. If you want to put some large text next to it you could do that. I don't think you can change the size of text within the checkbox display box (so i left it an empty string), but a textbox() can be adjusted.
windowMain = New Window( "test",
//Header
Outline Box( "", H List Box( cb = Check Box( "" ), tb = Text Box( "text" ) ) )
);
tb << set font size( 30 );