SpanIndicator tooltips

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Oliver Mellet
Avatar
Is there a built-in way of showing a tooltip for a given span indicator, like assigning text to the indicator instance? Right now I have to keep a collection of indicators and text ranges, and then search the collection to see if any mouse hovers fall into one of those ranges.

Comments (5)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This is something we've recognized as needing work for a while. We're open to any suggestions you might have.

One thought we've had is, in the event that requests QuickInfo, would you like it to also include the collection of indicators that span the point where the mouse hovers?


Actipro Software Support

Posted 19 years ago by Oliver Mellet
Avatar
Sorry it's taken so long to reply, I never got the email saying my post had been replied to. Anyway, your suggestion sounds great; having the collection of spans for a quickinfo request would be an ideal solution.
Posted 19 years ago by GLarson
Avatar
This sounds close, but what I need is a tooltip for the glyph only. Thanks.

Greg
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok, I'll add it to the TODO list.


Actipro Software Support

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We were looking over old posts and just for anyone who is interested in providing tooltips for span indicators, here is our recommended way using the current version.

Handle the TokenMouseHover event and in that make a call GetSpanIndicatorsForOffset to get the span indicators at the token offset passed by the event arguments.

So something like this would give you an array of span indicators at the token's start offset:
SpanIndicator[] indicators =
    editor.Document.Indicators.GetSpanIndicatorsForOffset(e.Token.StartOffset);
From that you can see if there are any that should display a tooltip and if so, return the appropriate tooltip text.


Actipro Software Support

The latest build of this product (v24.1.0) was released 26 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.