]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/PageSetupDialog.py
Give BitmapButton its own demo, get rid of ErrorDialogs
[wxWidgets.git] / wxPython / demo / PageSetupDialog.py
1
2 import wx
3
4 #---------------------------------------------------------------------------
5
6 def 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
26 overview = """\
27 This class represents the page setup common dialog. The page setup dialog is standard
28 from Windows 95 on, replacing the print setup dialog (which is retained in Windows
29 and wxWindows for backward compatibility). On Windows 95 and NT 4.0 and above,
30 the page setup dialog is native to the windowing system, otherwise it is emulated.
31
32 The 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
34 sizes in millimetres.
35
36 When the dialog has been closed, you need to query the <code>wx.PageSetupDialogData</code> object
37 associated with the dialog.
38
39 Note that the OK and Cancel buttons do not destroy the dialog; this must be done by
40 the application. As with other dialogs, do not destroy the dialog until you are done
41 with the data, and, conversely, do not use the wx.PageSetupDialogData after the
42 dialog is destroyed.
43
44
45 """
46
47
48 if __name__ == '__main__':
49 import sys,os
50 import run
51 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])