self.box.Add(self.canvas, 1, wx.GROW)
subbox = wx.BoxSizer(wx.HORIZONTAL)
btn = wx.Button(self, ID_Setup, "Print Setup")
self.box.Add(self.canvas, 1, wx.GROW)
subbox = wx.BoxSizer(wx.HORIZONTAL)
btn = wx.Button(self, ID_Setup, "Print Setup")
subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
btn = wx.Button(self, ID_Preview, "Print Preview")
subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
btn = wx.Button(self, ID_Preview, "Print Preview")
subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
btn = wx.Button(self, ID_Print, "Print")
subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
btn = wx.Button(self, ID_Print, "Print")
subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
self.box.Add(subbox, 0, wx.GROW)
subbox.Add(btn, 1, wx.GROW | wx.ALL, 2)
self.box.Add(subbox, 0, wx.GROW)
- printerDialog = wx.PrintDialog(self)
- printerDialog.GetPrintDialogData().SetPrintData(self.printData)
+ data = wx.PrintDialogData(self.printData)
+ printerDialog = wx.PrintDialog(self, data)
printerDialog.GetPrintDialogData().SetSetupDialog(True)
printerDialog.ShowModal();
self.printData = printerDialog.GetPrintDialogData().GetPrintData()
printerDialog.GetPrintDialogData().SetSetupDialog(True)
printerDialog.ShowModal();
self.printData = printerDialog.GetPrintDialogData().GetPrintData()
def OnPrintPreview(self, event):
self.log.WriteText("OnPrintPreview\n")
def OnPrintPreview(self, event):
self.log.WriteText("OnPrintPreview\n")
printout = MyPrintout(self.canvas, self.log)
printout2 = MyPrintout(self.canvas, self.log)
printout = MyPrintout(self.canvas, self.log)
printout2 = MyPrintout(self.canvas, self.log)
if not self.preview.Ok():
self.log.WriteText("Houston, we have a problem...\n")
if not self.preview.Ok():
self.log.WriteText("Houston, we have a problem...\n")
printer = wx.Printer(pdd)
printout = MyPrintout(self.canvas, self.log)
printer = wx.Printer(pdd)
printout = MyPrintout(self.canvas, self.log)
wx.MessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wx.OK)
else:
self.printData = printer.GetPrintDialogData().GetPrintData()
wx.MessageBox("There was a problem printing.\nPerhaps your current printer is not set correctly?", "Printing", wx.OK)
else:
self.printData = printer.GetPrintDialogData().GetPrintData()