missing Shift-TAB char events (was: [wxPython] EVT_CHAR Problem)

I am building a custom text control that has fields within it. I have
set up the base control to use the style wxTE_PROCESS_TAB,
and have an EVT_CHAR routine that is coded to have the TAB key step
through the cells of the custom control until it hits the right-most one,
and then do normal tab traversal processing, and to do the converse
on Shift-TAB. The former logic works properly. However, the OnChar()
routine never gets called for the Shift-TAB events; instead, my
ON_KILL_FOCUS routine gets called, and focus immediately shifts
to the previous control in the tab order of the panel.

I searched the archives for a reference to this problem, and found the
following exchange, with no further followup:

Running windows 2000, python20, wxPython2.2.

The "self" is a wxPanel.

> > I am having a very strange problem trying to process shift-tab on
> > a wxTextCtrl field.
> >
> > I use the following:
> >
> > editbox = wxTextCtrl(self, myID, "Default",wxPoint(x,y),
> > wxSize( size,19),

wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB)

> >
> > EVT_CHAR(editbox, self.EvtChar)
> > EVT_TEXT_ENTER(editbox, myID, self.EvtEnter)
> >
> > Pressing TAB will trigger the event however pressing Shift-TAB will
> > not. There is only on[e] wxTextCtrl
>
> What is self and what is your platform and versions?
>
> --
> Robin Dunn
> Software Craftsman
> robin@AllDunn.com Java give you jitters?
> http://wxPython.org Relax with wxPython!

I assume the underlying problem is that wxTE_PROCESS_TAB
isn't set up to intercept the Shift-TAB events before doing normal
processing of them. Is this true? Is there any way around this?

(winNT, win98, win2K, wxPython 2.3.2.1, Python 2.2.1)

Thanks in advance,
Will Sadkin
Parlance Corporation
wsadkin@nameconnector.com

···

On Wed, 16 May 2001 14:00:09 -0700, Michael Hubbard wrote:

I assume the underlying problem is that wxTE_PROCESS_TAB
isn't set up to intercept the Shift-TAB events before doing normal processing of them. Is this true? Is there any way around this?

You can see the same problem with non-controls as well. You don't even get a KeyDown for the tab part of the Shift-tab, it is always used for navigation. The only way to get around it I know of is to not have a parent (or other ancestor) window with the wxTAB_TRAVERSAL style set, but then you'd have to handle all of the tab traversal yourself.

You may want to bring this up on wx-dev and/or enter a bug report about it, but I doubt that anything will be done in the short term (before 2.5) because it would take major surgery to make any changes there.

···

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