Now - certain keystrokes are not being passed to the browser, such as
Tab and alt-left and alt-right (a-z etc. and return work). How can I
those to be passed to the embedded IE browser? Adding
"style=wxWANTS_CHARS" did not make a difference.
Does it have the focus?
Doing SetFocus() has no effect.
A EVT_CHAR(ieObject, lambda evt: self.stdout.write(repr(evt))) prints
out events until I click on the ieObject, at which point keystrokes are
no longer printed (wxWANTS_CHARS or otherwise.)
Now - certain keystrokes are not being passed to the browser, such as
Tab and alt-left and alt-right (a-z etc. and return work). How can I
those to be passed to the embedded IE browser? Adding
"style=wxWANTS_CHARS" did not make a difference.
Does it have the focus?
Doing SetFocus() has no effect.
A EVT_CHAR(ieObject, lambda evt: self.stdout.write(repr(evt))) prints
out events until I click on the ieObject, at which point keystrokes are
no longer printed (wxWANTS_CHARS or otherwise.)
Okay, here's the deal. The ActiveXWrapper is a major hack. (It's been ages since I looked at it and I had forgotten that!)
The ActiveX control is not really a wxWindow, but there is a wxWindow created and the AXControl is placed on top of it and the there is a EVT_SIZE handler that ensures that the AXControl is positioned and sized such that it covers the wxWindow. That lets you use it in sizers and such, but you can't catch events directly from the AXControl, only from the wxWindow underneath it...
A couple things could be done that would improve this. First, we could create a wxWindow that implemented all the COM interfaces needed to be a full AXContainer, then the AXControl could be implemented directly with a wxWindow and we woudln't have to use pywin.mfc.activex.Control. The problem with this is that the win32all packages don't provide all that are needed (last I checked.) The other option is to wrap a wxWindow around the HWND of the AXControl instead of making a new wxWindow for it to sit upon. I don't have time right now to play with this, but if somebody does I'll take patches. There is a function named wxWindow_FromHWND in wxPython that theoretically would help with this, but I've never tried using it. Here's the C++ for it:
wxWindow* wxWindow_FromHWND(unsigned long hWnd) {
wxWindow* win = new wxWindow;
win->SetHWND(hWnd);
win->SubclassWin(hWnd);
return win;
}
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!