]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/PrintDialog.py
pop the menu up on mouse down, not up (this is more common behaviour in Windows and...
[wxWidgets.git] / wxPython / demo / PrintDialog.py
CommitLineData
cf694132 1
8fa876ca 2import wx
cf694132
RD
3#---------------------------------------------------------------------------
4
5def runTest(frame, nb, log):
8fa876ca 6 data = wx.PrintDialogData()
1fded56b
RD
7
8 data.EnableSelection(True)
1e4a197e
RD
9 data.EnablePrintToFile(True)
10 data.EnablePageNumbers(True)
1fded56b
RD
11 data.SetMinPage(1)
12 data.SetMaxPage(5)
13 data.SetAllPages(True)
14
8fa876ca
RD
15 dlg = wx.PrintDialog(frame, data)
16
17 if dlg.ShowModal() == wx.ID_OK:
1fded56b
RD
18 data = dlg.GetPrintDialogData()
19 log.WriteText('GetAllPages: %d\n' % data.GetAllPages())
8fa876ca 20
cf694132
RD
21 dlg.Destroy()
22
23#---------------------------------------------------------------------------
24
25
8fa876ca
RD
26overview = """\
27This class represents the print and print setup common dialogs. You may obtain
95bfd958 28a wx.PrinterDC device context from a successfully dismissed print dialog.
cf694132 29
95bfd958 30User information is stored in a wx.PrintDialogData object that is passed to the
8fa876ca
RD
31dialog at creation time, and it is filled in by the user. As with other dialogs,
32do not use this data once the dialog is dismissed, and do not destroy the dialog
33until you have everything you need from it.
cf694132 34
1fded56b 35"""
cf694132
RD
36
37
1fded56b
RD
38if __name__ == '__main__':
39 import sys,os
40 import run
8eca4fef 41 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])