EnsureVisible method for an offset

SyntaxEditor for Windows Forms Forum

Posted 15 years ago by Boyd - Automated Software Testing Consultant / 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 15 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 15 years ago by Boyd - Automated Software Testing Consultant / Developer, Patterson Consulting, LLC
Avatar
That's perfect... thank you!
The latest build of this product (v2018.1 build 0342) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.