Posted 19 years ago by Ajay Nair
Avatar
When mouse is hovered over a collapsed node in the editor, the editor by default displays a quickinfo
tooltip consisting of the top few lines of the text within the node. How can I make the editor display
more lines or the entire text of the collapsed node within the quickinfo?

Comments (5)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You could set the text to display in the tip by handling the TokenMouseHover event and looking for the IsCollapsedNode property set to true in the event args. Then set the event arg's ToolTipText property.


Actipro Software Support

Posted 19 years ago by Ajay Nair
Avatar
How do I get the complete listing of the collapsed node's text in the TokenMouseHover event ?
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Something like this should work:
syntaxEditor.Document.Outlining.RootNode.FindNodeRecursive(offset).Text;
Make sure you HTML escape it though since the quick info tip uses markup tags and the <, >, and & characters need to be escaped.

[Modified at 07/12/2005 06:03 PM]


Actipro Software Support

Posted 19 years ago by Ajay Nair
Avatar
Thanks that was helpful but now the quickinfo display does not show newlines. This is what I have :
Private Sub editor_TokenMouseHover(ByVal sender As System.Object, ByVal e As ActiproSoftware.SyntaxEditor.TokenMouseEventArgs) Handles editor.TokenMouseHover
If e.IsCollapsedNode = True Then
Dim node As OutliningNode = editor.Document.Outlining.RootNode.FindNodeRecursive(e.Token.StartOffset)
e.ToolTipText = System.Web.HttpUtility.HtmlEncode(node.Text)
end if

Whereas the partial display that the quickinfo currently displays (without my changes) displays correctly
with newlines - so what do I need to do to fix that ?
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ahh yes, you need to replace the "\n" character with "<br/>". Since the formatter uses a markup like HTML, you need to specify the line breaks using a tag.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.