Display additional Information at IndicatorTag at any time

SyntaxEditor for WPF Forum

Posted 6 years ago by Karsten Mauersberger
Version: 18.1.0671
Avatar

Hi,

i started working with your product some days ago. Works very fine so far. I am not a c# pro yet so maybe i didn't found the best solution for my problem.

 

I would like to display a status (int) for a special line. So i created a CustomIndicatorTag and added content to it. The number is displayed, perfect. But now i would like to display the number allways not only when the mouse is hovering over. Is this possible?

My second idea was to create an adorner on this element. Now i have the problem that the indicator margin is to small to display the adorner. Can i enlarge it somehow?

 

Or is there a complete different solution for my problem?

 

I hope you can point me to the right direction.

Comments (3)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Karsten,

If you want to always show the number without any pointer interaction, I might recommend a custom editor view margin instead.  We have a nice QuickStart sample showing this named "Editor View Margins - Custom".  In that sample we show the number of characters on each line.  But you could alter that concept to show your number instead on appropriate lines.


Actipro Software Support

Posted 6 years ago by Karsten Mauersberger
Avatar

Hi,

 

thank you for the tip. I like it very much.

 

Sadly, i don't know how to go on. Because the indicator already does know the number, i thought to go thruogh the indicators (that are needed) and read out the tag.

Now i have to problems. I am not able to read out the indicators i tried to cast them but i am struggeling with it.

        private void OnCustomDraw(object sender, CustomDrawElementCustomDrawEventArgs e)
        {

            // Find the previous indicator 
            var tagRanges = view.SyntaxEditor.Document.IndicatorManager.GetInstances<ActualLoopIndicatorTagger, ActualLoopIndicatorTag>();

            foreach (var tagRange in tagRanges)
            {
                //get ActualLoopIndicatorTag.Tag here?
            }
            return;

 

Second Problem for me is that i don't know how to get this method executed on the change of the indicator margin. at the moment it reacts only on the change of the view.

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi,

Oh ok, if you need to also use/display indicators then perhaps it is best to just make the indicator margin wider as you said.  You can put this in your app's Resources to increase the margin width:

<Style TargetType="editor:EditorIndicatorMargin">
	<Setter Property="Width" Value="100" />
</Style>


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.