]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/wxHtmlWindow.py
Added some test code...
[wxWidgets.git] / utils / wxPython / demo / wxHtmlWindow.py
index c863001ff41a0c95a8835bc8d9f44a03b452159f..9b187a129bddb0199c528c31f0296612043b8ad2 100644 (file)
@@ -36,6 +36,8 @@ class TestHtmlPanel(wxPanel):
         self.html.SetRelatedFrame(frame, "wxPython: (A Demonstration) -- %s")
         self.html.SetRelatedStatusBar(0)
 
+        self.printer = wxHtmlEasyPrinting()
+
         self.box = wxBoxSizer(wxVERTICAL)
         self.box.Add(self.html, 1, wxGROW)
 
@@ -60,6 +62,10 @@ class TestHtmlPanel(wxPanel):
         EVT_BUTTON(self, 1205, self.OnForward)
         subbox.Add(btn, 1, wxGROW | wxALL, 2)
 
+        btn = wxButton(self, 1207, "Print")
+        EVT_BUTTON(self, 1207, self.OnPrint)
+        subbox.Add(btn, 1, wxGROW | wxALL, 2)
+
         btn = wxButton(self, 1206, "View Source")
         EVT_BUTTON(self, 1206, self.OnViewSource)
         subbox.Add(btn, 1, wxGROW | wxALL, 2)
@@ -116,6 +122,9 @@ class TestHtmlPanel(wxPanel):
         dlg.Destroy()
 
 
+    def OnPrint(self, event):
+        self.printer.PrintFile(self.html.GetOpenedPage())
+
 #----------------------------------------------------------------------
 
 def runTest(frame, nb, log):