"other" <other@stopthesanity.org> writes:
I've got an app where I'm trying to use the iewin.IEHtmlWindow
control to display some web pages. Most of these pages have forms
that my users will need to fill out, however, when I try to use the
tab key to move between fields the focus shifts to the enclosing
panel.
I ran into the same problem when trying to use the class myself (I ran
into problems trying to find a reference by searching the mailing list
so I've included copies of the two relevant messages below).
I don't think there's an easy solution (and I haven't found one yet).
The only thing that I've seen code or documentation for implies
manipulating the low level message pumping routine to allow the IE
embedded control the opportunity to handle "pre-translation" of keys
before it gets to the embedding application.
I think this would be easier (although I'm not certain) with a pure
C++ wxWidgets application since you could probably have an easier time
replacing the main message loop with an application aware one. I
don't think there's any way to get hooked into the application message
loop from within Python at a low enough layer to hand the actual Win32
messages off to the embedded IE control for pre-translation.
And yes, for me this seemed to make embedding IE a non-starter for my
application, which was unfortunate. I opted to spin off a separate IE
window to access the pages, but it's definitely a sub-optimal
solution, so I'd love if
-- David
- - - - - - - - - - - - - - - - - - - - - - - - -
Newsgroups: gmane.comp.python.wxpython
···
Subject: Tab traversal in embedded IE webbrowser with MakeActiveXClass
From: David Bolen <db3l@fitlinxx.com>
Date: 08 Mar 2004 12:41:03 -0500
Message-ID: <u3c8j44pc.fsf@fitlinxx.com>
I'm embedding IE under a wxPython application on Windows (wxPython
2.4.1.2) and have run into an issue with special key handling (tab
traversal, backspace to go back a page, etc...) not functioning within
the embedded control.
I've been able to find a handful of questions about this in older list
postings, but without really seeing anyone with an actual solution
shown.
Apparently this is intended behavior for the webbrowser control in
that as an embedded control it doesn't handle keys like tab internally
by default, but instead assumes that tab traversal would be including
the entire webbrowser control as part of a larger sequence of controls
in the container object.
There are some articles in MSDN that discuss how you have to supply
those keys to the underlying control, but obviously they are focused
on MFC or straight C++ applications (which shows a fix involving the
main message pump loop), and I'm not sure if there's a way to translate
that to the wxPython wrapper level.
I think the most appropriate approach for the wxPython wrapper is to
somehow get the IOleInPlaceActiveObject interface and call its
TranslateAccelerator method. Except that the default makepy generated
stuff for the webbrowser control (based on the demo sample code)
doesn't show that interface.
I'm still experimenting, but I was sort of hoping that someone else
somewhere had run into this in the past and had the magic snippet of
code necessary to pass tabs through to the webbrowser. It seems like
it would be a generally desired feature in cases such as that shown in
the demo (which BTW, has the same problem if you browse to a page with
a form).
Thanks.
-- David
Newsgroups: gmane.comp.python.wxpython
Subject: Re: Tab traversal in embedded IE webbrowser with MakeActiveXClass
From: David Bolen <db3l@fitlinxx.com>
Date: 08 Mar 2004 18:17:30 -0500
Message-ID: <uy8qb2ak5.fsf@fitlinxx.com>
Thomas Heller <theller@python.net> writes:
I don't know whether this helps or not, but Henk Punt's venster library
at least contains Python code which does this. IIRC, it's the
test_browser sample.
Thanks. It at least shows me that I'm on the right track, but I'm not
sure it helps much on the wxPython front, since venster has a low level
Win32 message loop at the Python level where he can insert the
translation call off of the Ole interface of the webbrowser control
(e.g., a fairly literal translation of the MSDN article).
I've yet to figure out if I can hook in at that level of message
process in wxPython (since it would be dependent on the lower level
wxWidgets MSW stuff giving the higher level wxWidgets a chance to
respond, which in turn would need to be reflected out to the wxPython
wrappers). Although if that's not possible I may still try forging a
Windows message structure to send to the TranslateAccelerator COM
method.
-- David