cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%E4%BD%9C%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%B0%8D%E6%96%BC%E6%BB%91%E9%BC%A0%E7%9B%92%EF%BC%8C%E8%A9%B2%E6%96%B9%E6%B3%95%E9%80%8F%E9%81%8E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%3C%2FFONT%3E%20%3CSETCLICKENABLE%3E%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CBR%20%2F%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%3C%2FFONT%3E%3C%2FFONT%3E%20%3CSETCLICK%3E%3C%2FSETCLICK%3E%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CBR%20%2F%3E%3C%2FFONT%3E%E3%80%8C%E7%81%AB%E7%81%BD%E3%80%8D%E5%A4%AA%E9%A0%BB%E7%B9%81%E4%BA%86%E3%80%82%3CBR%20%2F%3E%E5%A2%9E%E5%8A%A0%E6%AD%BB%E5%8D%80%E6%99%82%E9%96%93%E6%84%9F%E8%A6%BA%E9%9D%9E%E5%B8%B8%E5%BB%B6%E9%81%B2%E3%80%82%3CBR%20%2F%3E%3CBR%20%2F%3E%E7%95%B6%E9%87%8B%E6%94%BE%E6%8C%89%E9%88%95%E6%99%82%EF%BC%8C%E6%BB%91%E9%BC%A0%E7%89%9B%E4%B9%9F%E6%9C%83%E3%80%8C%E9%96%8B%E7%81%AB%E3%80%8D%E5%97%8E%EF%BC%9F%E6%9C%89%E7%89%B9%E6%AE%8A%E8%A8%AD%E5%AE%9A%E5%97%8E%EF%BC%9F%3C%2FFONT%3E%3C%2FSETCLICKENABLE%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%E5%8F%A6%E4%B8%80%E6%96%B9%E9%9D%A2%EF%BC%9A%E6%98%AF%E5%90%A6%E6%9C%89%E5%83%8F%20IS%20CTRL()%20%E9%80%99%E6%A8%A3%E7%9A%84%E5%87%BD%E6%95%B8%E5%8F%AF%E4%BB%A5%E5%82%B3%E5%9B%9E%E6%BB%91%E9%BC%A0%E6%8C%89%E9%88%95%E7%9A%84%E7%9B%AE%E5%89%8D%E7%8B%80%E6%85%8B%EF%BC%9F%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%3CLINGO-LABS%20id%3D%22lingo-labs-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E8%87%AA%E5%8B%95%E5%8C%96%E5%92%8C%E8%85%B3%E6%9C%AC%E7%B7%A8%E5%AF%AB%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FFONT%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%E4%BD%9C%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800098%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ew%20%3D%20New%20Window(%20%22Mouse%20Messages%22%2C%20%2F%2F%20modified%20from%20scripting%20index%20setClick%0A%09Border%20Box(%20Left(%2020%20)%2C%20Right(%2020%20)%2C%20top(%2020%20)%2C%20bottom(%2020%20)%2C%0A%09%09MouseBox(%20%2F*%20%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%26lt%3B%20handler%20for%20mouse%20events%20*%2F%0A%09%09%09window%3Atb%20%3D%20Text%20Box(%20%22click%20me!%22%2C%20%26lt%3B%3CSETFONTSIZE%3E%3C%2FSETFONTSIZE%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%0A%3CP%3E%3C%2FP%3E%3CDIV%20class%3D%22lia-vid-container%20video-embed-center%20lia-video-unavailable%22%3E%3CDIV%20id%3D%22lia-vid-6362132885112w400h300r408%22%20class%3D%22lia-video-ooyala-player-container%22%3E%3CDIV%20class%3D%22lia-video-status-message%22%3E%E8%A9%B2%E5%BD%B1%E7%89%87%E7%9B%AE%E5%89%8D%E6%AD%A3%E5%9C%A8%E8%99%95%E7%90%86%E4%B8%AD%E3%80%82%E8%AB%8B%E5%B9%BE%E5%88%86%E9%90%98%E5%BE%8C%E9%87%8D%E8%A9%A6%E3%80%82%3C%2FDIV%3E%3C%2FDIV%3E%3CA%20class%3D%22video-embed-link%22%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fvideo%2Fgallerypage%2Fvideo-id%2F6362132885112%22%20target%3D%22_blank%22%3E%EF%BC%88%E5%9C%A8%E6%88%91%E7%9A%84%E5%BD%B1%E7%89%87%E4%B8%AD%E6%9F%A5%E7%9C%8B%EF%BC%89%3C%2FA%3E%3C%2FDIV%3EYou%20might%20want%20to%20ignore%20Moved%20as%20well%20as%20Ticked.%3CP%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%E6%BB%91%E9%BC%A0%E7%9B%92%26lt%3B%20%3CSETCLICK%20example%3D%22%22%20in%3D%22%22%20the%3D%22%22%20scripting%3D%22%22%20index%3D%22%22%20is%3D%22%22%20one%3D%22%22%20of%3D%22%22%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FUncharted%2FThree-JSL-Easter-Eggs%2Fm-p%2F21181%23U21181%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-blog-thread%20lia-fa-icon%20lia-fa-blog%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%E4%B8%89%E5%80%8B%20JSL%20%E5%BE%A9%E6%B4%BB%E7%AF%80%E5%BD%A9%E8%9B%8B%3C%2FA%3E%3C%2FSETCLICK%3E%3C%2FP%3E%3C%2FCODE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-800130%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%E4%BD%9C%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800130%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E8%AC%9D%E8%AC%9D%E3%80%82%E7%B2%BE%E5%BD%A9%E7%9A%84%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%E8%85%B3%E6%9C%AC%E7%B4%A2%E5%BC%95%E4%B8%AD%E6%9C%89%E5%BE%88%E5%A5%BD%E7%9A%84%E8%A8%98%E9%8C%84%20-%20%E6%88%91%E6%80%8E%E9%BA%BC%E8%83%BD%E9%8C%AF%E9%81%8E%E5%AE%83......%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-822405%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%E4%BD%9C%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-822405%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E6%98%AF%E5%90%A6%E6%9C%89%E8%88%87%E6%87%B8%E5%81%9C%E5%9C%A8%20mouseBox%20%E4%B8%8A%E7%9B%B8%E9%97%9C%E7%9A%84%E6%93%8D%E4%BD%9C%20-%20%E5%B0%B1%E5%83%8F%20Hoverlabels%20%E4%B8%80%E6%A8%A3%EF%BC%9F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%E6%88%91%E5%98%97%E8%A9%A6%E5%90%91%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%E5%B7%A5%E5%85%B7%E6%8F%90%E7%A4%BA%3C%2FFONT%3E%E6%B7%BB%E5%8A%A0%20JSL%20%E5%91%BD%E4%BB%A4%20-%20%E4%BD%86%E4%B8%8D%E5%B9%B8%E7%9A%84%E6%98%AF%20%26lt%3B%26lt%3B%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3EsetTooltip%3C%2FFONT%3E%E7%9A%84%E5%8F%83%E6%95%B8%E5%B7%B2%E9%A0%90%E5%85%88%E8%A9%95%E4%BC%B0%E3%80%82%3CBR%20%2F%3E%E7%B7%A8%E8%BC%AF%EF%BC%9A%3CBR%20%2F%3E%E5%B0%87%E6%8C%87%E4%BB%A4%E6%94%BE%E5%85%A5%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3EExpr()%3C%2FFONT%3E%E5%85%A7%E5%8F%AF%E9%98%BB%E6%AD%A2%20JMP%20%E5%9C%A8%E5%BB%BA%E7%AB%8B%E8%A6%96%E7%AA%97%E6%99%82%E8%A9%95%E4%BC%B0%E6%8C%87%E4%BB%A4%E3%80%82%3C%2FP%3E%3CP%3E%E4%B8%8D%E5%B9%B8%E7%9A%84%E6%98%AF%EF%BC%8C%E5%AE%83%E4%B9%9F%E4%B8%8D%E6%9C%83%E5%9C%A8%E4%BB%A5%E5%BE%8C%E5%BE%97%E5%88%B0%E8%A9%95%E4%BC%B0%E3%80%82%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Enew%20window(%22%22%2CMouse%20Box%20(Text%20Box(%22Caption%20when%20mouseover%3F%22)%2C%26lt%3B%3CSETTOOLTIP%3E%3C%2FSETTOOLTIP%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%20%3C%2FCODE%3E%3C%2FP%3E%3CP%3E%3CCODE%20class%3D%22%20language-jsl%22%3EMy%20next%20try%3A%20use%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%26lt%3B%20%E8%A8%AD%E5%AE%9A%E6%8C%89%E9%8D%B5%E5%95%9F%E7%94%A8(1)%3C%2FFONT%3Eand%20use%20a%20key%20on%20the%20keyboard%20to%20trigger%20the%20action.%3CBR%20%2F%3EBut%20the%20Mouse%20Box%20needs%20a%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%26lt%3B%3CSET%20focus%3D%22%22%3E%26lt%3B%20ont%26gt%3B%20-%20%E6%89%80%E4%BB%A5%E4%BC%BC%E4%B9%8E%E4%B8%8D%E6%98%AF%20MouseOver%20%E7%9A%84%E6%AD%A3%E7%A2%BA%E9%81%B8%E6%93%87%E3%80%82%3C%2FSET%3E%3C%2FFONT%3E%3C%2FCODE%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-822727%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E6%BB%91%E9%BC%A0%E7%9B%92%20-%20%E6%8C%89%E9%88%95%E5%90%91%E4%B8%8A%E7%9A%84%E5%8B%95%E4%BD%9C%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-822727%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E6%83%B3%E5%8F%AA%E6%98%AF%E9%81%8A%E6%A8%99%E6%94%B9%E8%AE%8A%E4%BA%86%E3%80%82%E4%B8%8D%E9%81%8E%EF%BC%8C%E9%80%99%E6%98%AF%E5%80%8B%E5%A5%BD%E4%B8%BB%E6%84%8F%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
hogi
Level XII

Mouse box - action for button up?

For Mouse box , the approach via 
<<setClickEnable( 1 ),
<<setClick()

"fires" too often.
Adding a dead time feels extremely laggy.

Does the Mouse ox also "fire" when the button is released? Is there a special setting?

 

On the other hand: is there some function like IS CTRL() which returns the current status of the mouse buttons?

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Mouse box - action for button up?

w = New Window( "Mouse Messages", // modified from scripting index setClick
	Border Box( Left( 20 ), Right( 20 ), top( 20 ), bottom( 20 ),
		MouseBox( /* <<<<<<<< handler for mouse events */
			window:tb = Text Box( "click me!", <<setFontSize( 48 ), <<setwrap( 999 ) ), /* <<<<<< child box does not receive the mouse events */
			<<setClickEnable( 1 ),
			<<setClick( /* button-down, move, button-release handler */
				// the Ticked event happens frequently, and makes it hard to see the Pressed event, so ignore it...
				Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
					If(  event != "Ticked",
						window:tb << settext( event || Char( clickpt ) );
					)
				)
			)
		)
	);
);

You might want to ignore Moved as well as Ticked.

 

MouseBox<<setClick example in the scripting index is one of the Three JSL Easter Eggs 

Craige

View solution in original post

4 REPLIES 4
Craige_Hales
Super User

Re: Mouse box - action for button up?

w = New Window( "Mouse Messages", // modified from scripting index setClick
	Border Box( Left( 20 ), Right( 20 ), top( 20 ), bottom( 20 ),
		MouseBox( /* <<<<<<<< handler for mouse events */
			window:tb = Text Box( "click me!", <<setFontSize( 48 ), <<setwrap( 999 ) ), /* <<<<<< child box does not receive the mouse events */
			<<setClickEnable( 1 ),
			<<setClick( /* button-down, move, button-release handler */
				// the Ticked event happens frequently, and makes it hard to see the Pressed event, so ignore it...
				Function( {this, clickpt, event}, /*Is Alt Key(),Is Control Key(),Is Shift Key() should be captured on "Pressed" */
					If(  event != "Ticked",
						window:tb << settext( event || Char( clickpt ) );
					)
				)
			)
		)
	);
);

You might want to ignore Moved as well as Ticked.

 

MouseBox<<setClick example in the scripting index is one of the Three JSL Easter Eggs 

Craige
hogi
Level XII

Re: Mouse box - action for button up?

Thanks. wonderful  


very well documented in the scripting index - how could I miss it  ...

 

hogi
Level XII

Re: Mouse box - action for button up?

And is there an action associated with hovering over the mouseBox - like with Hoverlabels?

 

I tried to add a JSL command to the Tooltip - but unfortunately the argument of << setTooltip is pre-evaluated.
Edited:
Putting the command inside Expr() stops JMP from evaluating the command while creating the window.

Unfortunately, it also doesn't get evaluated later.

new window("",Mouse Box (Text Box("Caption when mouseover?"),<<setTooltip(Caption ("Hello"); "click to revert" )))

 

My next try: use << setKeyEnabled(1) and use a key on the keyboard to trigger the action.
But the Mouse Box needs a <<set focus - so doesn't seem to be the right choice for a MouseOver.

Craige_Hales
Super User

Re: Mouse box - action for button up?

Just the cursor change, I think. Great idea though.

Craige