]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxPageSetupDialog.py
Reworked how stock objects are initialized. They now have an
[wxWidgets.git] / wxPython / demo / wxPageSetupDialog.py
1 # 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2 #
3 # o Updated for wx namespace
4 #
5
6 import wx
7
8 #---------------------------------------------------------------------------
9
10 def 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
30 overview = """\
31 This class represents the page setup common dialog. The page setup dialog is standard
32 from Windows 95 on, replacing the print setup dialog (which is retained in Windows
33 and wxWindows for backward compatibility). On Windows 95 and NT 4.0 and above,
34 the page setup dialog is native to the windowing system, otherwise it is emulated.
35
36 The 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
38 sizes in millimetres.
39
40 When the dialog has been closed, you need to query the <code>wxPageSetupDialogData</code> object
41 associated with the dialog.
42
43 Note that the OK and Cancel buttons do not destroy the dialog; this must be done by
44 the application. As with other dialogs, do not destroy the dialog until you are done
45 with the data, and, conversely, do not use the wxPageSetupDialogData after the
46 dialog is destroyed.
47
48
49 """
50
51
52 if __name__ == '__main__':
53 import sys,os
54 import run
55 run.main(['', os.path.basename(sys.argv[0])])