EnsureVisible method for an offset

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
The 'Outlining' class has an 'EnsureVisible' method to make sure that a particular start/end offset are not hidden by a collapsed node. I'm looking for something similar to this for the 'EditorView'.

I'm currently implementing QuickInfo for an item based on caret position (not the mouse), so the location parameter used by QuickInfo.Show is based on the rectangle returned by the 'SelectedView.GetCharacterBounds' method for the start offset of the current token. The problem I've run into is that the caret can be positioned over a token that has been scrolled out of view. When the QuickInfo is displayed, it can appear all over the screen.

Ideally, I'd like to make sure that the token is visible prior to getting the bounding rectangle and displaying the QuickInfo. I haven't tried, but I'm pretty sure I can come up with a workaround for this. Any tips are appreciated.

The suggestion is that it would be nice to have an 'EnsureVisible' method to the 'EditorView' class that would accept a starting and ending offet (or position) and do its best to ensure that it is visible within the view.

Comments (2)

Posted 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok, the next release now has an EditorView.EnsureVisible method that accepts an offset and also whether you want to expand collapsed outlining nodes that contain the offset.


Actipro Software Support

Posted 20 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
That's perfect... thank you!
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.