SyntaxEditor 4.0 Custom Rendering - Need Your Suggestions

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We're currently looking into the possibility of using customizable renderers for SyntaxEditor 4.0 much like our other controls.

Essentially the renderer would give you the ability to custom-draw most areas of the SyntaxEditor control. We would provide a default implementation and then you could override it with your own drawing if you would like.

The only part of the rendering that we would keep internal would be the text area rendering of text, selection, and span indicator highlighting style overrides since we can optimize the drawing of those things by keeping them internal.

We are figuring you'd be able to draw these things in the renderer:
* Indicator margin
* Line number margin
* User margin (to be added in the next 3.1 maintenance release)
* Selection margin
* Text area (background only)
* Word wrap margin
* Scrollbar parts
* EditorView splitters
* Area between EditorViews
* Block next to where scrollbars intersect
* Outlining indicators

For all the margins, they would have a two-phased approach. For instance, a DrawIndicatorMarginBackground method would be called first, followed by a DrawIndicatorMarginDisplayLine method call for each display line that needs drawing.

Does this sound like a good approach? Does anyone have any further suggestions or things we're missing? Let's hear some thoughts.


Actipro Software Support

Comments (12)

Posted 14 years ago by László Mohácsi
Avatar
Just wondering around... could we have events like :

OnBeforeLineDraw (to draw behind the tokens)
OnAfterLineDraw (to draw on the top of text, tokens)
OnDrawToken (to override/modify the painting of a token)

And could it be possible to draw some user regions, like boxing a method into a semi-transparent filled rounded rectangle ? (drawing on the top of it, just like CodeRush does)
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Good call... we've added a pre and post drawing method for each display line. For tokens, we probably won't do that because it will be too expensive CPU-wise and also there are other ways to accomplish that, which are either by using the next two methods or by using span indicators that code the token's range.

We are also going to try and build in some automated features for things like borders and wave lines so you don't need to do it yourself anymore.


Actipro Software Support

Posted 14 years ago by László Mohácsi
Avatar
Sure, forget token drawing then!
Posted 14 years ago by László Mohácsi
Avatar
So we could then implement vertical lines connecting matching brackets?
Or matching tags in XML. (It is like indentation guides, just that it's parse driven)
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sure, that would be possible.


Actipro Software Support

Posted 14 years ago by Jean Versailles
Avatar
Hi,
Can the intellisense popup be resize just like in Visual Studio.Net 2005?


jen0s.

[Modified at 01/19/2006 12:35 PM]
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Could you give an example in VS 2005 of what you mean and in what language, C# or VB?


Actipro Software Support

Posted 14 years ago by NSXDavid
Avatar
Actually, what I would like you to consider is even more flexibility. Allow us to really draw behind or over the surface in a context-specific way. The best example is the tools Developer Express has for VS.NET.

In particular, if you are not already familiar, take a look at Code Rush and Refactor pro. They add some amazing visual aids (of a graphical variety) to your text window. It really shows what's possible in making editors more and more helpful to the programmer.

Code rush: http://devexpress.com/Products/NET/Coderush/
Refactor Pro: http://devexpress.com/Products/NET/Refactor/

Perhaps we can already do a bunch of this that's on the foreground, but not sure.

-- David
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Once we get announce a beta, you can try out what we've done to see if it will work for the sort of features you'd like and we can enhance it if necessary. All our drawing code for 4.0 is now in a renderer class that is extensible.


Actipro Software Support

Posted 14 years ago by Jean Versailles
Avatar
Just a simple suggestion, could you guys provide a way for us as the developer to just upload a schema into Syntax Editor that would automatically provide the IntelliPrompt functionality base on the schema just like Microsoft.

And this would also allow a wavy line indicator to the tokens that are not support or mark the errors with a wavy line.


jen0s.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jean,

Do you mean for XML or for other languages as well. If for XML, that's something we want to do. If for other languages, maybe you could e-mail us a sample schema of what you mean. Thanks!


Actipro Software Support

Posted 14 years ago by Jean Versailles
Avatar
Hi,

I had XML in mind since the structure of other language would be unpredictable.

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

Add Comment

Please log in to a validated account to post comments.