]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/ActiveX_IEHtmlWindow.py
added wxSizerFlags::Shaped() and FixedMinSize() methods
[wxWidgets.git] / wxPython / demo / ActiveX_IEHtmlWindow.py
index b3bc40fbf767f34162b7a96b6e03b69ef582c323..bd4749db927b725cd6bcb7dc4d7baa077b8ad78d 100644 (file)
@@ -10,9 +10,9 @@ if wx.Platform == '__WXMSW__':
 
 #----------------------------------------------------------------------
 
-class TestPanel(wx.Window):
+class TestPanel(wx.Panel):
     def __init__(self, parent, log, frame=None):
-        wx.Window.__init__(
+        wx.Panel.__init__(
             self, parent, -1,
             style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE
             )
@@ -105,7 +105,7 @@ class TestPanel(wx.Window):
         self.ie.Navigate(url)
 
     def OnLocationKey(self, evt):
-        if evt.KeyCode() == wx.WXK_RETURN:
+        if evt.GetKeyCode() == wx.WXK_RETURN:
             URL = self.location.GetValue()
             self.location.Append(URL)
             self.ie.Navigate(URL)
@@ -160,7 +160,9 @@ class TestPanel(wx.Window):
 
     def OnNewWindow2(self, evt):
         self.logEvt(evt)
-##        evt.Veto()   # TODO
+        # Veto the new window.  Cancel is defined as an "out" param
+        # for this event.  See iewin.py
+        evt.Cancel = True   
 
     def OnProgressChange(self, evt):
         self.logEvt(evt)
@@ -189,10 +191,10 @@ def runTest(frame, nb, log):
         win = TestPanel(nb, log, frame)
         return win
     else:
-        dlg = wx.MessageDialog(frame, 'This demo only works on Windows.',
-                          'Sorry', wx.OK | wx.ICON_INFORMATION)
-        dlg.ShowModal()
-        dlg.Destroy()
+        from Main import MessagePanel
+        win = MessagePanel(nb, 'This demo only works on Microsoft Windows.',
+                           'Sorry', wx.ICON_WARNING)
+        return win