X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8fa876ca9ec87e90605808bfcab4d4226965dbad..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/demo/TablePrint.py diff --git a/wxPython/demo/TablePrint.py b/wxPython/demo/TablePrint.py index c0e60c7c8b..73818dda8a 100644 --- a/wxPython/demo/TablePrint.py +++ b/wxPython/demo/TablePrint.py @@ -1,17 +1,5 @@ -# 11/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Updated for wx namespace -# o Color preview example generates deprecation warnings. -# -# 11/26/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o Note: wx.NamedColour must remain because printout.py requiress it. -# o printout.py is generating a snootful of errors all related to the -# requirement for tuples on the base DC calls now -# import os - import wx import wx.lib.printout as printout @@ -20,6 +8,7 @@ import wx.lib.printout as printout buttonDefs = { 814 : ('PreviewWide', 'Preview print of a wide table'), 815 : ('PreviewNarrow', 'Preview print of a narrow table with color highlights'), + 816 : ('PreviewText', 'Preview print of a text file'), 818 : ('OnPreviewMatrix', 'Preview print of a narrow column grid without a table header'), 817 : ('PreviewLine', 'Preview print to demonstrate the use of line breaks'), 819 : ('PrintWide', 'Direct print (no preview) of a wide table'), @@ -87,7 +76,7 @@ class TablePanel(wx.Panel): prt.SetHeader("wx.Windows Applications") prt.SetFooter() - prt.SetFooter("Date: ", type = "Date", align=wx.ALIGN_RIGHT, indent = -2, colour = wx.NamedColour('RED')) + prt.SetFooter("Date: ", type = "Date", align=wx.ALIGN_RIGHT, indent = -1, colour = wx.NamedColour('RED')) prt.Preview() def PreviewNarrow(self): @@ -117,7 +106,7 @@ class TablePanel(wx.Panel): prt.label_font_colour = wx.NamedColour('WHITE') prt.SetHeader("wxWindows Applications", colour = wx.NamedColour('RED')) - prt.SetHeader("Printed: ", type = "Date & Time", align=wx.ALIGN_RIGHT, indent = -2, colour = wx.NamedColour('BLUE')) + prt.SetHeader("Printed: ", type = "Date & Time", align=wx.ALIGN_RIGHT, indent = -1, colour = wx.NamedColour('BLUE')) prt.SetFooter("Page No", colour = wx.NamedColour('RED'), type ="Num") prt.Preview() @@ -161,6 +150,17 @@ class TablePanel(wx.Panel): prt.SetFooter() prt.Preview() + def PreviewText(self): + prt = printout.PrintTable(self.frame) + prt.SetHeader("PROCLAMATION") + file = open('data/proclamation.txt') + data = [] + for txt in file: + data.append(txt.strip()) + file.close() + prt.data = data + prt.Preview() + def PrintWide(self): self.ReadData() prt = printout.PrintTable(self.frame) @@ -218,5 +218,5 @@ when the framework allows for it. if __name__ == '__main__': import sys,os import run - run.main(['', os.path.basename(sys.argv[0])]) + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])