SquiggleLineIndicator

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Ted Schunk
Avatar
Is there any way a squiggly line can be drawn lower down under the text? I’m allowing the user to highlight expressions and it is possible they may be highlighting overlapping parts of an expression on the same line. For example if the expression is:

x = a + b + c * d

I would like the user to be able to draw a squiggly line under b + c and another squiggly line under a + b + c * d underneath the line for b + c.

Comments (7)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ted,

Absolutely... here's the code to add a Red squiggle line indicator...
editor.Document.Indicators.Add(New SquiggleLineIndicator("RedIndicator", 1, Color.Red), offset, length);


Actipro Software Support

Posted 19 years ago by Ted Schunk
Avatar
Thanks for your quick reply but I think my question was not that clear. I would like
to do something like this

x = a + b + c * d
    ______           <- this is the first squiggly line (it would be closer to the text above)
    ______________   <- this is a second squiggly line underneath the first line.

If you were to draw both lines using:

editor.Document.Indicators.Add(New SquiggleLineIndicator("RedIndicator", 1, Color.Red), 8, 5);
editor.Document.Indicators.Add(New SquiggleLineIndicator("BlueIndicator", 1, Color.Red), 4, 13);

the blue indicator would draw over the red indicator. I need it to be drawn underneath the red indicator.

Thanks

[Modified at 10/01/2005 11:17 AM]
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Oh, that's what the display priority does. So change the "1" in your two code lines so that one is 1 and the other is 2.


Actipro Software Support

Posted 19 years ago by Ted Schunk
Avatar
Thanks but that is not exactly what I'm trying to do. I need the line to be drawn a few pixels lower on the screen so they do not overlap.
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Oh, in that case you'll have to implement your own squiggle line indicator since ours draws it at a fixed y-location. I believe there are other postings in the forum that show a sample span indicator. They might not show a squiggle line but it's easy to implement.


Actipro Software Support

Posted 19 years ago by Ted Schunk
Avatar
I searched the forum and was not able to find any samples. If you know of one would you mind posting here. Thanks.
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sure... here is one... actually you can probably make the code even simpler by inheriting SquiggleIndicator directly and overriding the DrawMarks method with your custom squiggle drawing code.

http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=244#647


Actipro Software Support

The latest build of this product (v24.1.1) 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.