How do I interact with Squiggles?

SyntaxEditor for WPF Forum

Posted 14 years ago by Todd Davis
Version: 10.1.0523
I am still VERY new to this component, so please bear with me if this is a simple question.

By looking at the quickstart samples, I was able to load a document into the editor, and I have marked certain words with a Squiggle (the words were identified via a regex).

Now that the words are marked, I would like for the user to be able to put the carat on the marked text and interact with it. For the sake of example, let's say that every instance of the word "Dog" has a squiggle. I want the user to either right click the squiggle, or put the carat on the word and press alt+enter, and be presented with a combo-list of breeds, such as Collie, Poodle, Terrier. They can then select a word and have it replaced, or perhaps open a new window with more details about that breed.

So... can anyone point me to an example of how to interact with a squiggle, or maybe give me a fairly vanilla code sample to get me in the right direction?


Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Todd,

First you'd need to interact with the input features of SyntaxEditor to trap whatever event you want to handle, such as an Alt+Enter keypress. If you are designing all this functionality purely from within a language, then you can attach an event sink service to watch for specific events (see "Language Creation Guide / Event Sink Services" documentation topic) such as key presses.

Then in your handler, you'd want to determine if you were in a squiggle. To do that you'd have to get your tagger that is in use and call its methods to determine if you are in an applicable range or not.

Then if you are, you'd take appropriate action such as opening a related dialog or showing a completion list (see samples on how to do that).

Hope that helps!

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.