I've implemented dropdown bar support for my language. The bar displays the
right entiries, and I've hooked the OnItemChosen() method to move the caret
in the text view to the right place when an item is clicked.
However, after an item is chosen in the dropdown bar, the focus remains on
the bar - the bar item is still highlighted. The bar in VC++ doesn't do
this: focus goes back to the edit window.
So I tried SendExplicitFocus() on the IVsTextView to focus the edit window
again. However, while this does sort of solve the problem (the cursor
re-appears in the edit window), the dropdown bar remains highlighted and the
edit window doesn't really have focus: moving the mouse wheel doesn't scroll
it, for example.
So what's the right way to re-assign focus after an item on the dropdown bar
is selected?
I'm having the same exact problem. When I call SendExplicitFocus, the cursor
jumps to the editor but I can not type anything.
JC
> I've implemented dropdown bar support for my language. The bar displays the
> right entiries, and I've hooked the OnItemChosen() method to move the caret
[quoted text clipped - 12 lines]
> So what's the right way to re-assign focus after an item on the dropdown bar
> is selected?
Simon Marlow - 27 Aug 2004 13:17 GMT
I found a solution: calling IVsTextManager::NavigateToLineAndColumn() instead
of IVsTextView:SetCaretPos() does the right thing. Not only does it move
the caret, but it highlights the selection, scrolls the window if necessary,
and does the right thing with the focus.
Cheers,
Simon
> I'm having the same exact problem. When I call SendExplicitFocus, the cursor
> jumps to the editor but I can not type anything.
[quoted text clipped - 22 lines]
> bar
> > is selected?