]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/wxPageSetupDialog.py
reSWIGged
[wxWidgets.git] / wxPython / demo / wxPageSetupDialog.py
... / ...
CommitLineData
1# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2#
3# o Updated for wx namespace
4#
5
6import wx
7
8#---------------------------------------------------------------------------
9
10def runTest(frame, nb, log):
11 data = wx.PageSetupDialogData()
12 data.SetMarginTopLeft( (15, 15) )
13 data.SetMarginBottomRight( (15, 15) )
14 #data.SetDefaultMinMargins(True)
15 data.SetPaperId(wx.PAPER_LETTER)
16
17 dlg = wx.PageSetupDialog(frame, data)
18
19 if dlg.ShowModal() == wx.ID_OK:
20 data = dlg.GetPageSetupData()
21 tl = data.GetMarginTopLeft()
22 br = data.GetMarginBottomRight()
23 log.WriteText('Margins are: %s %s\n' % (str(tl), str(br)))
24
25 dlg.Destroy()
26
27#---------------------------------------------------------------------------
28
29
30overview = """\
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.
35
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.
39
40When the dialog has been closed, you need to query the <code>wxPageSetupDialogData</code> object
41associated with the dialog.
42
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.
47
48
49"""
50
51
52if __name__ == '__main__':
53 import sys,os
54 import run
55 run.main(['', os.path.basename(sys.argv[0])])