Possible to automatically highlight a substring within a text edit box?Hi. I'm wondering if anyone knows of a method where my script can automatically highlight a substring within a text edit box? I'd like the user to be able to
1. Click on the text within the TEB at a specific location.
2. A "<< Set Text Changed" function would return the location of the cursor in the text field using a yet-to-be-determined command.
3. The script looks around the cursor location for predefined delimiters in the text.
4. Finally it highlights the text between the delimiters.
I briefly explored using a MouseBox wrapper, but at first blush there doesn't appear to be any easy way for JMP to associate mouse position with the underlying text. Plus, even if I could figure that out, there doesn't appear to be any way to have JMP highlight substrings within a text edit box (none that I could find at least).
Perhaps there's another type of display box I could employ to do this?
JMP Pro 16.2
macOS Big Sur 11.6.5
Any help is appreciated. Thanks.
GraphicsScriptingRe: Possible to automatically highlight a substring within a text edit box?You can use a text edit box to allow users to click on the text. If you double-click on a word the entire word will be selected.
Re: Possible to automatically highlight a substring within a text edit box?I'm aware of this feature, but text boxes do not allow the user to manually select the text within them, nor do they have any way to execute a function when clicking on them. I'm looking for something where the user can click on, say, a single word in the text string, and a function will automatically select the entire word.
Re: Possible to automatically highlight a substring within a text edit box?Textboxes can use a simple markup for bold, italic and underlining. Look in the scripting index at text boxes, for markup.
Names Default To Here( 1 );
example_text =
"This is <B>bold</B> text. This is <I>italic</I> text. This is <U>underlined</U> text.
This is <B><I><U>bold, italic, underlined</U></I></B> text.";
win = New Window( "Example", tb = Text Box( example_text ) );
tb << markup;
