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%EB%A7%88%EC%9A%B0%EC%8A%A4%20%EB%B0%95%EC%8A%A4%20-%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%EB%88%84%EB%A5%B4%EB%A9%B4%20%EB%8F%99%EC%9E%91%ED%95%98%EB%82%98%EC%9A%94%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800088%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%EB%A7%88%EC%9A%B0%EC%8A%A4%20%EB%B0%95%EC%8A%A4%EC%9D%98%20%EA%B2%BD%EC%9A%B0%20%EC%A0%91%EA%B7%BC%20%EB%B0%A9%EC%8B%9D%EC%9D%80%20%EB%8B%A4%EC%9D%8C%EA%B3%BC%20%EA%B0%99%EC%8A%B5%EB%8B%88%EB%8B%A4.%3CBR%20%2F%3E%20%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%22%ED%99%94%EC%9E%AC%22%EA%B0%80%20%EB%84%88%EB%AC%B4%20%EC%9E%90%EC%A3%BC%20%EB%B0%9C%EC%83%9D%ED%95%A9%EB%8B%88%EB%8B%A4.%3CBR%20%2F%3E%20%EB%8C%80%EA%B8%B0%EC%8B%9C%EA%B0%84%EC%9D%84%20%EC%B6%94%EA%B0%80%ED%95%98%EB%A9%B4%20%EB%A7%A4%EC%9A%B0%20%EC%A7%80%EC%97%B0%EB%90%98%EB%8A%94%20%EB%8A%90%EB%82%8C%EC%9D%B4%20%EB%93%AD%EB%8B%88%EB%8B%A4.%3CBR%20%2F%3E%3CBR%20%2F%3E%20%EB%A7%88%EC%9A%B0%EC%8A%A4%20%ED%99%A9%EC%86%8C%EB%8F%84%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%EB%86%93%EC%9C%BC%EB%A9%B4%20%22%EB%B0%9C%EC%82%AC%22%EB%90%98%EB%82%98%EC%9A%94%3F%20%ED%8A%B9%EB%B3%84%ED%95%9C%20%EC%84%A4%EC%A0%95%EC%9D%B4%20%EC%9E%88%EB%82%98%EC%9A%94%3F%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%EB%B0%98%EB%A9%B4%EC%97%90%3A%20%EB%A7%88%EC%9A%B0%EC%8A%A4%20%EB%B2%84%ED%8A%BC%EC%9D%98%20%ED%98%84%EC%9E%AC%20%EC%83%81%ED%83%9C%EB%A5%BC%20%EB%B0%98%ED%99%98%ED%95%98%EB%8A%94%20IS%20CTRL()%EA%B3%BC%20%EA%B0%99%EC%9D%80%20%ED%95%A8%EC%88%98%EA%B0%80%20%EC%9E%88%EC%8A%B5%EB%8B%88%EA%B9%8C%3F%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%EC%9E%90%EB%8F%99%ED%99%94%20%EB%B0%8F%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8C%85%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%3ERe%3A%20%EB%A7%88%EC%9A%B0%EC%8A%A4%20%EC%83%81%EC%9E%90%20-%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%EB%88%84%EB%A5%B4%EB%A9%B4%20%EB%8F%99%EC%9E%91%ED%95%98%EB%82%98%EC%9A%94%3F%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%EC%9D%B4%20%EC%98%81%EC%83%81%EC%9D%80%20%ED%98%84%EC%9E%AC%20%EC%B2%98%EB%A6%AC%20%EC%A4%91%EC%9E%85%EB%8B%88%EB%8B%A4.%20%EB%AA%87%20%EB%B6%84%20%ED%9B%84%EC%97%90%20%EB%8B%A4%EC%8B%9C%20%EC%8B%9C%EB%8F%84%ED%95%B4%20%EC%A3%BC%EC%84%B8%EC%9A%94.%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(%EB%82%B4%20%EB%8F%99%EC%98%81%EC%83%81%EC%97%90%EC%84%9C%20%EB%B3%B4%EA%B8%B0)%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%EB%A7%88%EC%9A%B0%EC%8A%A4%EB%B0%95%EC%8A%A4%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%20JSL%20%EC%9D%B4%EC%8A%A4%ED%84%B0%20%EC%97%90%EA%B7%B8%203%EA%B0%9C%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%3ERe%3A%20%EB%A7%88%EC%9A%B0%EC%8A%A4%20%EC%83%81%EC%9E%90%20-%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%EB%88%8C%EB%A0%80%EC%9D%84%20%EB%95%8C%EC%9D%98%20%EB%8F%99%EC%9E%91%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-800130%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%EA%B3%A0%EB%A7%99%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%ED%9B%8C%EB%A5%AD%ED%95%A9%EB%8B%88%EB%8B%A4%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%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8C%85%20%EC%9D%B8%EB%8D%B1%EC%8A%A4%EC%97%90%20%EC%95%84%EC%A3%BC%20%EC%9E%98%20%EA%B8%B0%EB%A1%9D%EB%90%98%EC%96%B4%20%EC%9E%88%EC%96%B4%EC%9A%94.%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EB%86%93%EC%B9%A0%20%EC%88%98%20%EC%9E%88%EA%B2%A0%EC%96%B4%EC%9A%94...%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%3ERe%3A%20%EB%A7%88%EC%9A%B0%EC%8A%A4%20%EC%83%81%EC%9E%90%20-%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%EB%88%8C%EB%A0%80%EC%9D%84%20%EB%95%8C%EC%9D%98%20%EB%8F%99%EC%9E%91%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-822405%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%EB%A7%88%EC%9A%B0%EC%8A%A4%EB%B0%95%EC%8A%A4%20%EC%9C%84%EC%97%90%20%EB%A7%88%EC%9A%B0%EC%8A%A4%EB%A5%BC%20%EC%98%AC%EB%A6%AC%EB%A9%B4%20Hoverlabels%EC%B2%98%EB%9F%BC%20%EB%8F%99%EC%9E%91%EC%9D%B4%20%EC%9E%88%EB%82%98%EC%9A%94%3F%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3E%ED%88%B4%ED%8C%81%3C%2FFONT%3E%20%EC%97%90%20JSL%20%EB%AA%85%EB%A0%B9%EC%9D%84%20%EC%B6%94%EA%B0%80%ED%95%98%EB%A0%A4%EA%B3%A0%20%ED%96%88%EC%8A%B5%EB%8B%88%EB%8B%A4.%20%ED%95%98%EC%A7%80%EB%A7%8C%20%EB%B6%88%ED%96%89%ED%9E%88%EB%8F%84%20%26lt%3B%26lt%3B%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3EsetTooltip%3C%2FFONT%3E%20%EC%9D%98%20%EC%9D%B8%EC%88%98%EA%B0%80%20%EB%AF%B8%EB%A6%AC%20%ED%8F%89%EA%B0%80%EB%90%A9%EB%8B%88%EB%8B%A4.%3CBR%20%2F%3E%20%ED%8E%B8%EC%A7%91%EB%90%A8%3A%3CBR%20%2F%3E%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3EExpr()%3C%2FFONT%3E%20%EB%82%B4%EB%B6%80%EC%97%90%20%EB%AA%85%EB%A0%B9%EC%9D%84%20%EB%84%A3%EC%9C%BC%EB%A9%B4%20JMP%EA%B0%80%20%EC%B0%BD%EC%9D%84%20%EC%83%9D%EC%84%B1%ED%95%98%EB%8A%94%20%EB%8F%99%EC%95%88%20%EB%AA%85%EB%A0%B9%EC%9D%84%20%ED%8F%89%EA%B0%80%ED%95%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4.%3C%2FP%3E%3CP%3E%EB%B6%88%ED%96%89%ED%9E%88%EB%8F%84%20%EB%82%98%EC%A4%91%EC%97%90%20%ED%8F%89%EA%B0%80%EB%90%98%EC%A7%80%EB%8F%84%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4.%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%20setKeyEnabled(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-%20MouseOver%EC%97%90%20%EC%A0%81%ED%95%A9%ED%95%9C%20%EC%84%A0%ED%83%9D%EC%9D%B4%20%EC%95%84%EB%8B%8C%20%EA%B2%83%20%EA%B0%99%EC%8A%B5%EB%8B%88%EB%8B%A4.%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%3ERe%3A%20%EB%A7%88%EC%9A%B0%EC%8A%A4%20%EC%83%81%EC%9E%90%20-%20%EB%B2%84%ED%8A%BC%EC%9D%84%20%EB%88%8C%EB%A0%80%EC%9D%84%20%EB%95%8C%EC%9D%98%20%EB%8F%99%EC%9E%91%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-822727%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%EC%BB%A4%EC%84%9C%EB%A7%8C%20%EB%B0%94%EA%BE%B8%EB%8A%94%20%EA%B2%83%20%EA%B0%99%EC%95%84%EC%9A%94.%20%EC%A2%8B%EC%9D%80%20%EC%95%84%EC%9D%B4%EB%94%94%EC%96%B4%EB%84%A4%EC%9A%94.%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