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
CitizenNo3
Level II

JSL MouseBox doesn't save to Journal JMP 17 vs JMP 16

 

Hello, 

 

I am using a scrip that saves a report in a journal and have noticed a change between JMP 16 and JMP 17 that breaks some of its functionality. If I save a window to the journal in JMP 16, the MouseBox interactions work just like they did in the JMP window, but in JMP 17 I've found that MouseBox doesn't save to the journal at all. Is this an intended change? Any ideas on possible workarounds or better way to be saving the report?

 

I put together a simple test script to compare between JMP 16 and JMP 17 and verified the behavior. I don't have access to JMP 18 yet, but I'm guessing it would be the same as JMP 17. I'm using JMP 16 Pro, but I know it also works in JMP 16.

 

JMP versions:

JMP Pro 16.0.0

JMP 17.2.0

names default to here (1);

NewWin = New Window ("mouse box test",
	mb = MouseBox(
	tb = text box("click me"),
		<<set Click Enable (1),
		<<Set Click(
			Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
				//{DEFAULT LOCAL}, //this would set the namespace to local, which broke some functions
				If( event == "Released" | event == "Canceled",
					this << setCursor( "Hand" ) /* switch back to hand immediately */
				,
					this << setCursor( "Finger" ) /* change cursor during drawing */
				);
				If( event == "Pressed",
					(this << child) << set text ("clicked!");
				)
			)
		)
	),
);
NewWin << journal;
4 REPLIES 4
jthi
Super User

Re: JSL MouseBox doesn't save to Journal JMP 17 vs JMP 16

Do you need to utilize Mouse Box()? Button Box() could be easier option

Names Default To Here(1);
New Window("Example", Button Box("Press Me", Print("Pressed.")));

Also this small change might prevent the mouse box from breaking and will keep it in journal but I'm not sure if you can build it this way (create window as journal window)

jthi_0-1715924659837.png

 

-Jarmo
CitizenNo3
Level II

Re: JSL MouseBox doesn't save to Journal JMP 17 vs JMP 16

I'm using MouseBox() so that an image can be interacted with, not just text like in my simple example. Clicking on any of the images in the grid opens up a larger version of the image and gives some additional options. I suppose I could embed the same code into a Button Box(), but it would take up space on an already dense report.

jthi
Super User

Re: JSL MouseBox doesn't save to Journal JMP 17 vs JMP 16

ah... half of my message was left out (property tree is there but no script example)! It seems like you can keep the mouse box if you initialize your window as journal window (<< Journal)

Names Default To Here(1);

nw = New Window("mouse box test", << journal, /*Type("Journal")*/
	mb = MouseBox(
	tb = text box("click me"),
		<<set Click Enable (1),
		<<Set Click(
			Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
				//{DEFAULT LOCAL}, //this would set the namespace to local, which broke some functions
				If( event == "Released" | event == "Canceled",
					this << setCursor( "Hand" ) /* switch back to hand immediately */
				,
					this << setCursor( "Finger" ) /* change cursor during drawing */
				);
				If( event == "Pressed",
					(this << child) << set text ("clicked!");
				)
			)
		)
	)
);
-Jarmo
CitizenNo3
Level II

Re: JSL MouseBox doesn't save to Journal JMP 17 vs JMP 16

Thanks for your follow up Jarmo, 

 

I've been playing around with this off and on, to clarify in the small chance that someone else has this issue, while opening the new window as a journal window does indeed initially work as expected, actually saving then re-opening the journal strips it of any Mouse Box instance again. I have found that opening a previously saved Journal from JMP 16 with a working Mouse Box, then saving with JMP 17 strips the Mouse Box as well. This seems to be a change to how Journals are handled in JMP 17.

I slightly modified my demo script to contain an image

 

names default to here (1);

NewWin = New Window ("mouse box test",
	mb = MouseBox(
	tb = pb = Picture Box( Open( "$SAMPLE_IMAGES/tile.jpg", jpg ) ),
		<<set Click Enable (1),
		<<Set Click(
			Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
				//{DEFAULT LOCAL}, //this would set the namespace to local, which broke some functions
				If( event == "Released" | event == "Canceled",
					this << setCursor( "Hand" ) /* switch back to hand immediately */
				,
					this << setCursor( "Finger" ) /* change cursor during drawing */
				);
				If( event == "Pressed",
					(this << child) << Set Image( Open( "$SAMPLE_IMAGES/windmap.png", jpg ) );
				)
			)
		)
	),
);
NewWin << journal;