I have just upgraded to wxPython 2.3.3.1, for Python2.1, WinNT.
I have a control derived from a wxTextCtrl that has the wxTE_PROCESS_TAB
style,
and that tries to control its insertion point and selection very carefully.
However, the tab key now does something altogether unexpected when that tab
traversal on the panel goes to the control.
I get the expected EVT_SET_FOCUS event, at which point, I call
self.GetInsertionPoint()
and self.GetSelection(). These indicate that there is nothing selected, and
that
the insertion point is set to location 0. However, the control then
mysteriously
selects ALL of the text in the control.
I tried to explicitly call self.SetInsertionPoint() and self.SetSelection()
to try to prevent this, and I *even tried refraining from calling
event.Skip()
in my EVT_SET_FOCUS handler* -- to no avail; on tabbing to the control, the
entire
contents remain selected.
If I then unfocus the window, by, say clicking on another window that when
raised,
partially obscures the panel, I see the selection disappear, and on
reselecting
the window, the same EVT_SET_FOCUS handler fires, and the stuff I asked to
be
selected in the EVT_SET_FOCUS handler is properly selected.
So, what gives with the TAB key processing? I do not get an EVT_CHAR for
the
TAB event that took me to the control, so I'm not sure what default event
handling
the underlying wxTextCtrl is doing that changes the selection after the
EVT_SET_FOCUS event happens. Is there any way to prevent this behavior?
Thanks in advance,
/Will Sadkin