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