]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/PageSetupDialog.py
Moved @interface wxNSApplicationDelegate to new header
[wxWidgets.git] / wxPython / demo / PageSetupDialog.py
... / ...
CommitLineData
1
2import wx
3
4#---------------------------------------------------------------------------
5
6def runTest(frame, nb, log):
7 data = wx.PageSetupDialogData()
8 data.SetMarginTopLeft( (15, 15) )
9 data.SetMarginBottomRight( (15, 15) )
10 #data.SetDefaultMinMargins(True)
11 data.SetPaperId(wx.PAPER_LETTER)
12
13 dlg = wx.PageSetupDialog(frame, data)
14
15 if dlg.ShowModal() == wx.ID_OK:
16 data = dlg.GetPageSetupData()
17 tl = data.GetMarginTopLeft()
18 br = data.GetMarginBottomRight()
19 log.WriteText('Margins are: %s %s\n' % (str(tl), str(br)))
20
21 dlg.Destroy()
22
23#---------------------------------------------------------------------------
24
25
26overview = """\
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.
31
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.
35
36When the dialog has been closed, you need to query the <code>wx.PageSetupDialogData</code> object
37associated with the dialog.
38
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
41with the data, and, conversely, do not use the wx.PageSetupDialogData after the
42dialog is destroyed.
43
44
45"""
46
47
48if __name__ == '__main__':
49 import sys,os
50 import run
51 run.main(['', os.path.basename(sys.argv[0])])