On Aug 20, 3:36 pm, Robin Dunn <ro...@alldunn.com> wrote:
> Steve Willis wrote:
> > On Aug 20, 12:33 pm, Robin Dunn <ro...@alldunn.com> wrote:
> >> Steve Willis wrote:
> >>> Hello,
> >>> I'm having an issue with IEHtmlWindow that I suspect is actually a
> >>> problem with the underlying Internet Explorer ActiveX control, but I'm
> >>> hoping someone more knowledgeable can help me. Floating Javascript
> >>> controls don't seem to be displayed when viewed within the
> >>> IEHtmlWindow. For example, the following code will load Google in a
> >>> new window. Note that google.com will typically pop up a list of
> >>> suggestions as you type a search term. This works in Internet
> >>> Explorer, but not in IEHtmlWindow. Any suggestions on how to fix this
> >>> would be very much appreciated.
> >> You might try looking at the events being sent when the popup should be
> >> shown. There may be something that the container needs to do order to
> >> make it possible for, or allow, the popup to be shown.
> >> --
> >> Robin Dunn
> >> Software Craftsmanhttp://wxPython.org
> > Thanks for the advice! Is there a simple way to print all events
> > generated by an ActiveX control? I'm looking at the AddEventSync
> > function in wx.lib.activex, but it appears to require knowledge of the
> > names of events that could be fired.
> Search for IWebBrowser2 at MSDN.
> --
> Robin Dunn
> Software Craftsmanhttp://wxPython.org
I wrote the following program to observe which events are fired from
the ActiveX control while text is entered into the Google search bar.
Remember, my issue is not with Google in particular, but it is a good
example of a website with a floating autocomplete box that updates
itself as text is entered that works in Internet Explorer but not in
IEHtmlWindow. It appears that only the CommandStateChange event is
being fired while characters are entered into the search box. The MSDN
documentation suggests this has to do only with the availability of
buttons in the browser's navigation bar. I don't see an opportunity to
allow anything to happen that is being denied or vetoed elsewhere.
Thanks for the help. Any other thoughts would be greatly appreciated!
Steve
#########################
import wx
import wx.lib.iewin
class HtmlFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, title="IEHtmlWindow Issue",
size=(800, 600))
ie = wx.lib.iewin.IEHtmlWindow(self)
ie.LoadUrl("http://google.com")
ie.AddEventSink(self)
\# Events from the WebBrowser ActiveX object
\#http://msdn.microsoft.com/en-us/library/aa752085(VS.85).aspx
def BeforeNavigate\(\*args\):
"""Fires before navigation occurs in the given object \(on
either a window or frameset element)."""
print 'BeforeNavigate'
def BeforeNavigate2\(\*args\):
"""Fires before navigation occurs in the given object \(on
either a window element or a frameset element)."""
print 'BeforeNavigate2'
def ClientToHostWindow\(\*args\):
"""Fires to request that the client window size is converted
to the host window size."""
print 'ClientToHostWindow'
def CommandStateChange\(\*args\):
"""Fires when the enabled state of a command changes\."""
print 'CommandStateChange'
def DocumentComplete\(\*args\):
"""Fires when a document is completely loaded and
initialized."""
print 'DocumentComplete'
def DownloadBegin\(\*args\):
"""Fires when a navigation operation begins\. """
print 'DownloadBegin'
def DownloadComplete\(\*args\):
"""Fires when a navigation operation finishes, is halted, or
fails."""
print 'DownloadComplete'
def FileDownload\(\*args\):
"""Fires to indicate that a file download is about to occur\.
If a file download dialog box can be displayed, this event fires prior
to the appearance of the dialog box."""
print 'FileDownload'
def NavigateComplete\(\*args\):
"""Fires after a navigation to a link is completed on either a
window element or a frameSet element. """
print 'NavigateComplete'
def NavigateComplete2\(\*args\):
"""Fires after a navigation to a link is completed on a window
element or a frameSet element."""
print 'NavigateComplete2'
def NavigateError\(\*args\):
"""Fires when an error occurs during navigation\."""
print 'NavigateError'
def NewProcess\(\*args\):
"""Creates a new process to handle the navigation\."""
print 'NewProcess'
def NewWindow\(\*args\):
"""Fires when a new window is to be created\."""
print 'NewWindow'
def NewWindow2\(\*args\):
"""Fires when a new window is to be created\."""
print 'NewWindow2'
def NewWindow3\(\*args\):
"""Raised when a new window is to be created\. Extends
NewWindow2 with additional information about the new window."""
print 'NewWindow3'
def PrintTemplateInstantiation\(\*args\):
"""Fires when a print template is instantiated\."""
print 'PrintTemplateInstantiation'
def PrintTemplateTeardown\(\*args\):
"""Fires when a print template is destroyed\."""
print 'PrintTemplateTeardown'
def PrivacyImpactedStateChange\(\*args\):
"""Fired when an event occurs that impacts privacy, or when a
user navigates away from a URL that has impacted privacy."""
print 'PrivacyImpactedStateChange'
def ProgressChange\(\*args\):
"""Fires when the progress of a download operation is updated
on the object."""
print 'ProgressChange'
def RedirectXDomainBlocked\(\*args\):
"""Fired when a cross\-domain redirect request is blocked\."""
print 'RedirectXDomainBlocked'
def SetPhishingFilterStatus\(\*args\):
"""Fires to indicate the progress and status of Microsoft
Phishing Filter analysis of the current webpage."""
print 'SetPhishingFilterStatus'
def SetSecureLockIcon\(\*args\):
"""Fires when there is a change in encryption level\."""
print 'SetSecureLockIcon'
def StatusTextChange\(\*args\):
"""Fires when the status bar text of the object has
changed."""
print 'StatusTextChange'
def ThirdPartyUrlBlocked\(\*args\):
"""Fired when a third\-party URL is blocked\."""
print 'ThirdPartyUrlBlocked'
def TitleChange\(\*args\):
"""Fires when the title of a document in the object becomes
available or changes."""
print 'TitleChange'
def UpdatePageStatus\(\*args\):
"""Not implemented\."""
print 'UpdatePageStatus'
def WindowClosing\(\*args\):
"""Fires when the window of the object is about to be closed
by script."""
print 'WindowClosing'
def WindowSetHeight\(\*args\):
"""Fires when the object changes its height\."""
print 'WindowSetHeight'
def WindowSetLeft\(\*args\):
"""Fires when the object changes its left position\."""
print 'WindowSetLeft'
def WindowSetResizable\(\*args\):
"""Fires to indicate whether the host window should allow
resizing of the object."""
print 'WindowSetResizable'
def WindowSetTop\(\*args\):
"""Fires when the object changes its top position\."""
print 'WindowSetTop'
def WindowSetWidth\(\*args\):
"""Fires when the object changes its width\."""
print 'WindowSetWidth'
def WindowStateChanged\(\*args\):
"""Fires when the visibility state of a content window, such
as the browser window or a tab, changes."""
print 'WindowStateChanged'
app = wx.PySimpleApp()
HtmlFrame().Show()
app.MainLoop()