]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/PageSetupDialog.py
   4 #--------------------------------------------------------------------------- 
   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
) 
  13     dlg 
= wx
.PageSetupDialog(frame
, data
) 
  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
))) 
  23 #--------------------------------------------------------------------------- 
  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. 
  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  
  36 When the dialog has been closed, you need to query the <code>wx.PageSetupDialogData</code> object  
  37 associated with the dialog. 
  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 
  48 if __name__ 
== '__main__': 
  51     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])