Alternating background colors for adjoining sections

SyntaxEditor for Windows Forms Forum

Posted 10 years ago by Han S
Avatar
Hi,
Thanks for the great samples and documentation. See here: (http://img11.imageshack.us/img11/8372/74218329.jpg) to see what I'm trying to replicate. Basically, the language includes multiple "sections", each with their own language and background color. So far, I've been able to use child languages with their own background color and language to implement this.

I'm having trouble with the alternating backgrounds. How do I create alternating background colors for adjoining sections? Ideally I'd like to stick with the xml definition- it's working perfectly for me so far.
Han

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Han,

Doing alternation will be pretty tricky. Probably the only way to do that would be to use the document line background color feature, and you'd have to manage what to update and when on your own. There isn't any built in way to do alternation like that.


Actipro Software Support

Posted 10 years ago by Han S
Avatar
Thanks for the quick reply!
Here you have an example of how to do alternating rows- might that be applicable for me? (http://blog.actiprosoftware.com/post/2009/11/30/Call-for-early-SyntaxEditor-for-WPF-20092-testers.aspx)
By "managing what I update and when" do you mean that I have to re-parse the document and set the line background color manually? Can I get a call-back from your parser on text changes that tells me where child languages start and stop?
Hanno
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hanno,

Well that blog post shows the WPF version of SyntaxEditor. The WPF version is where we are prototyping our next-generation SyntaxEditor platform out. In that version is has a very flexible adornments mechanism that calls back to you so you can decide what to render where.

In SyntaxEditor for WinForms, you can set things like span indicators and document line background colors. But you have to maintain them manually. So when text changes occur you'll have to adjust them as needed.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.