Custom form / intellisense

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by Sealed_Class_Singleton
Avatar
Hi,

I'm a newbie to SyntaxEditor and I was wondering if it is possible to display a custom dialog box / form as a response to certain keystrokes (/trigger) instead of giving some intellisense depending on the current state. When the form is closed the constructed text (depending on the answers) could be sended back to the document using insertext.

It is possible and if it is, what is the easiest way to do this ?

BTW do you have an example of an intellisense with more than one attribute and why aren't the tags closed in your example app ?

Thx in advance.

Comments (3)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Our control provides all the user interface components that you need to create IntelliSense but we do not have code to populate the lists. We provide some handy helper methods however really leave it to you to design how to populate them. The reason is that any language can be designed using SyntaxEditor so we have to remain open-ended.

The sample application does show the use of triggers. Look at the editor_Trigger event. You can create a trigger and display a form there I would imagine.

You'd have to write code to close the tags yourself. We have done this without too much trouble in an application that we wrote for another client using SyntaxEditor. You basically use a TokenStream, scan backwards to find the start tag's name and then insert the end tag at the current offset.


Actipro Software Support

Posted 20 years ago by Sealed_Class_Singleton
Avatar
Thx for our quick reply.

Do you have any example of how to find the complete tag (e.g. <a href="foo">text</a> ) whenever I'm somewhere in the string (eg mouseclick or something like that)

In your examples of for instance the HTML languagge you've got some "StartTag" and "EndTag" but they are not associated...

Is it possible to associate in an abstract way a token (e.g. an <X optionally something> and </X> which occurs in sequence on the same nestingslevel of the same state ?)

Kind regards
Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This is why we have two phases in SyntaxEditor. The first phase is the lexical parser. That uses your language definition and groups spans of text into tokens. Then you can programmatically add a semantic parser that can iterate through the tokens using a TokenStream and assign semantic parse data to them. The semantic parse data can be things like what tag name the token is for, etc.

We don't have an example for this, but it's not too hard. The TokenStream is a powerful feature. You can use it in a trigger or in a semantic parser. It lets you iterate through the tokens in the document and derive meaning for the text encompassed by the tokens based on which token key they were assigned.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.