]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/PageSetupDialog.py
Correct file format errors
[wxWidgets.git] / wxPython / demo / PageSetupDialog.py
CommitLineData
cf694132 1
8fa876ca 2import wx
cf694132
RD
3
4#---------------------------------------------------------------------------
5
6def runTest(frame, nb, log):
8fa876ca 7 data = wx.PageSetupDialogData()
8b9a4190
RD
8 data.SetMarginTopLeft( (15, 15) )
9 data.SetMarginBottomRight( (15, 15) )
10 #data.SetDefaultMinMargins(True)
8fa876ca 11 data.SetPaperId(wx.PAPER_LETTER)
8b9a4190 12
8fa876ca
RD
13 dlg = wx.PageSetupDialog(frame, data)
14
15 if dlg.ShowModal() == wx.ID_OK:
cf694132
RD
16 data = dlg.GetPageSetupData()
17 tl = data.GetMarginTopLeft()
18 br = data.GetMarginBottomRight()
19 log.WriteText('Margins are: %s %s\n' % (str(tl), str(br)))
8fa876ca 20
cf694132
RD
21 dlg.Destroy()
22
23#---------------------------------------------------------------------------
24
25
1fded56b 26overview = """\
8fa876ca
RD
27This class represents the page setup common dialog. The page setup dialog is standard
28from Windows 95 on, replacing the print setup dialog (which is retained in Windows
29and wxWindows for backward compatibility). On Windows 95 and NT 4.0 and above,
30the page setup dialog is native to the windowing system, otherwise it is emulated.
cf694132 31
8fa876ca
RD
32The page setup dialog contains controls for paper size (A4, A5 etc.), orientation
33(landscape or portrait), and controls for setting left, top, right and bottom margin
34sizes in millimetres.
cf694132 35
95bfd958 36When the dialog has been closed, you need to query the <code>wx.PageSetupDialogData</code> object
8fa876ca 37associated with the dialog.
cf694132 38
8fa876ca
RD
39Note that the OK and Cancel buttons do not destroy the dialog; this must be done by
40the application. As with other dialogs, do not destroy the dialog until you are done
95bfd958 41with the data, and, conversely, do not use the wx.PageSetupDialogData after the
8fa876ca 42dialog is destroyed.
cf694132
RD
43
44
8fa876ca
RD
45"""
46
cf694132 47
1fded56b
RD
48if __name__ == '__main__':
49 import sys,os
50 import run
8eca4fef 51 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])