Spinning Syntax possible?

SyntaxEditor for Windows Forms Forum

Posted 8 years ago by Igotcha

I am looking for a text control which supports the so called "Spinning Syntax".

The syntax consists of only 3 characters "{", "|" and "}". Here is an example:

{Hello|Hi|Hey} this is a {{simple|stupid} example|test}

I am looking for the following features / possibilities of such a control:
  • identifies / handles matching brackets, checks if the syntax is correct (count of opening brackets = count of closing brackets)
  • opening and closing bracket colored with a fix color
  • text within the "{" and "}" colored, based on the "spin level". As you can see in my example, nested "spin sets" are possible, they need to be colored in different colors for e.g. 5 levels. E.g. in my example "Hello|Hi|Hey" and "example|test" = blue, "simple|stupid" = green
  • if you click with the mouse within a spin set, the spin set is highlighted (selected)
Here is an example of my application, implemented with the standard richtext control so far: Example Screenshot


[Modified at 08/19/2011 07:17 PM]

[Modified at 08/19/2011 07:35 PM]

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Yes I believe our control would handle all of your requests and be a good fit.

Basically you could make a dynamic language that had a different lexical state for each spin group level that could nest within each other. Each lexical state could style its words different colors to achieve your spin level coloring, and open/close braces could always be red.

You could handle the ViewMouseDown event to watch for clicks and then just set the selection for the view programmatically.

Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.