ComboCtrl used for text search (keep focus on TextCtrl)

Hi Jim,

···

On Sun, May 18, 2008 at 11:01 PM, Jim Carroll wrote:

I'm trying to use a ComboCtrl for text-searching... it's
working well except when the pop-up is shown, the
ListCtrlComboPopup (taken from the demo) gets full focus.

I want it to work just like the tooltips in the Scite
text-editor demo. As I continue typing, the contents
of the pop-up change, but the focus stays on the TextCtl
so that i _can_ continue to type.

But with the ComboCtrl, whenever the pop-up is shown, it
takes over full focus in a way that doesn't even let me
do a GetTextCtrl().SetFocus().

My question: How can I keep keyboard focus on the TextCtrl
of an editable ComboCtrl while the pop-up is visible?

Have you taken a look at TextCtrlAutoComplete in the Wiki?

http://wiki.wxpython.org/TextCtrlAutoComplete

It may do the trick for you.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

> My question: How can I keep keyboard focus on the TextCtrl
> of an editable ComboCtrl while the pop-up is visible?

Have you taken a look at TextCtrlAutoComplete in the Wiki?

http://wiki.wxpython.org/TextCtrlAutoComplete

It may do the trick for you.

Andrea.

Hi Andrea, thanks for the suggestion. I'm actually working
on the Mac, and the Mac doesn't have the Popup implemented
that would let me use the TextCtrlAutoComplete. (I can see
in the SVN logs that (perhaps Stefan) put a few days into
getting the popup working on the Mac, but I'm unable to compile
from source successfully on SVN head. :frowning:

I also want the ordinary combo drop-down button to show a 'most
recent' set of values when no searching is going on. I also
love how I can make the results that show up be a horizontally-
scrolling set of columns of results. I think it's much easier
to navigate than a very long vertical list.

It'll work great if I can only change how the drop-down is
displayed, so it doesn't hog the keyboard focus.

If not I'm back to the TextCtrlAutoComplete (that's what I had
originally)

-Jim

Jim Carroll wrote:

My question: How can I keep keyboard focus on the TextCtrl
of an editable ComboCtrl while the pop-up is visible?

Have you taken a look at TextCtrlAutoComplete in the Wiki?

http://wiki.wxpython.org/TextCtrlAutoComplete

It may do the trick for you.

Andrea.

Hi Andrea, thanks for the suggestion. I'm actually working
on the Mac, and the Mac doesn't have the Popup implemented that would let me use the TextCtrlAutoComplete. (I can see
in the SVN logs that (perhaps Stefan) put a few days into getting the popup working on the Mac, but I'm unable to compile
from source successfully on SVN head. :frowning:

I also want the ordinary combo drop-down button to show a 'most recent' set of values when no searching is going on. I also
love how I can make the results that show up be a horizontally-
scrolling set of columns of results. I think it's much easier
to navigate than a very long vertical list.

It'll work great if I can only change how the drop-down is displayed, so it doesn't hog the keyboard focus.

You can see the trick that the StyledTextCtrl uses to do that here: http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/contrib/src/stc/PlatWX.cpp?revision=53169&view=markup

Look at the two implementations of wxSTCListBoxWin (one for use with wxPopupWindow, and one for wxFrame with the wxPOPUP_WINDOW style on Mac.)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!