]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxPrintDialog.py
Version number update
[wxWidgets.git] / wxPython / demo / wxPrintDialog.py
1 # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2 #
3 # o Updated for wx namespace
4 #
5
6 import wx
7 #---------------------------------------------------------------------------
8
9 def runTest(frame, nb, log):
10 data = wx.PrintDialogData()
11
12 data.EnableSelection(True)
13 data.EnablePrintToFile(True)
14 data.EnablePageNumbers(True)
15 data.SetMinPage(1)
16 data.SetMaxPage(5)
17 data.SetAllPages(True)
18
19 dlg = wx.PrintDialog(frame, data)
20
21 if dlg.ShowModal() == wx.ID_OK:
22 data = dlg.GetPrintDialogData()
23 log.WriteText('GetAllPages: %d\n' % data.GetAllPages())
24
25 dlg.Destroy()
26
27 #---------------------------------------------------------------------------
28
29
30 overview = """\
31 This class represents the print and print setup common dialogs. You may obtain
32 a wxPrinterDC device context from a successfully dismissed print dialog.
33
34 User information is stored in a wxPrintDialogData object that is passed to the
35 dialog at creation time, and it is filled in by the user. As with other dialogs,
36 do not use this data once the dialog is dismissed, and do not destroy the dialog
37 until you have everything you need from it.
38
39 """
40
41
42 if __name__ == '__main__':
43 import sys,os
44 import run
45 run.main(['', os.path.basename(sys.argv[0])])