Subscribe Bookmark RSS Feed

Enabling closure of multiple outline boxes

matteo_patelmo

Community Trekker

Joined:

Dec 23, 2015

Hello, I'd like to reproduce in one script of mine the behavior of most JMP platforms, where the user can close multiple outline boxes by keeping the control key down. 

 

For example, in the following, I'd like the user to be able to close "1" and "2" together when pressing "ctrl".

 

new window("ex", Outline Box("Main", outline box("1",vlist box()), outline box("2",vlistbox())));

 

I cannot find a suggestion in the scripting index for this.

 

thanks
Matteo

 

thanks
Matteo

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Apparently there is a partial implementation of what you want.  The script below allows the Outline Boxes to honor the CNTL feature

names default to here( 1 );
New Window( "test",
	V List Box(
		Outline Box( "testit", Table Box( String Col Box( "test one", {"a", "b"} ) ) ),
		Outline Box( "testit", Table Box( String Col Box( "test two", {"c", "d"} ) ) )
	)
);
Jim
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Jim's reply makes me realise that I've probably been a little hasty (though that might depend on exactly the behaviour you want). So, just to be clear (on a Mac) holding the CTRL key and left clicking on the disclosure icon of the 'Main' outline node created by the code in the original question produces this context menu:

 

Screen Shot 2017-01-24 at 10.31.56.png

 

which already has an option to do what my 'setMenuScript()' does. This context menu also appears with a right click (with no CTRL key)

4 REPLIES
ian_jmp

Staff

Joined:

Jun 23, 2011

Not quite what you asked for, but, FYI, you can do this kind of thing:

Names Default To Here( 1 );
nw = New Window( "ex", 
		obMain = Outline Box( "Main", 
				 Outline Box( "1", V List Box() ), 
				 Outline Box( "2", V List Box() )
				 )
			 );
obMain << setMenuScript(
						{
						"Close All", 
						obs = nw << xpath( "//OutlineBox");
						for(i=1, i<=NItems(obs), i++, obs[i] << close(1)),
						"Open All",
						obs = nw << xpath( "//OutlineBox");
						for(i=1, i<=NItems(obs), i++, obs[i] << close(0));
						}
						);

Looking at 'Is Control Key' in 'Help > Scripting Index' it looks like the modifier keys are intended for graphics boxes.

matteo_patelmo

Community Trekker

Joined:

Dec 23, 2015

Thanks Ian,

as you wrote, this is not exactly what I was looking for, but your idea could be a workaround, I will try it!

 

Still, I'm a bit surprised that broadcasting a command to similar display boxes within a display tree is not feasibile with a built-in function. I hope this can be implemented in JMP 14!

 

thanks
Matteo

 

 

 

 

txnelson

Super User

Joined:

Jun 22, 2012

Solution

Apparently there is a partial implementation of what you want.  The script below allows the Outline Boxes to honor the CNTL feature

names default to here( 1 );
New Window( "test",
	V List Box(
		Outline Box( "testit", Table Box( String Col Box( "test one", {"a", "b"} ) ) ),
		Outline Box( "testit", Table Box( String Col Box( "test two", {"c", "d"} ) ) )
	)
);
Jim
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

Jim's reply makes me realise that I've probably been a little hasty (though that might depend on exactly the behaviour you want). So, just to be clear (on a Mac) holding the CTRL key and left clicking on the disclosure icon of the 'Main' outline node created by the code in the original question produces this context menu:

 

Screen Shot 2017-01-24 at 10.31.56.png

 

which already has an option to do what my 'setMenuScript()' does. This context menu also appears with a right click (with no CTRL key)