Posted 20 years ago
by Boyd
-
Sr. Software Developer,
Patterson Consulting, LLC
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.
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.