Working with page setup properties

The wx.PageSetupDialogData class has several properties having to do with page setup. Table 17.4 shows properties that control the display of the dialog box itself. Unless otherwise specified, all of these properties default to True.

Table 17.4 Dialog control properties of wx.PageSetupDialogData

Property

Description

GetDefaultMinMargins() SetDefaultMinMargins(flag)

If this property is True and you are on the MS Windows system, the page setup will use the current properties of the default printer as the default minimum margin size. Otherwise, it will use a system default.

Table 17.4 Dialog control properties of wx.PageSetupDialogData (continued)

Property

Description

GetDefaultInfo() SetDefaultlnfo(flag)

If this property is True and you are on an MS Windows system, the page setup dialog will not be shown. Instead all the defaults for the current printer will be put into the data object.

EnableHelp(flag) GetEnableHelp()

If True, the help portion of the dialog is enabled.

EnableMargins(flag) GetEnableMargins()

If True, the portion of the dialog dedicated to sizing the margins is enabled.

EnableOrientation(flag) GetEnableOrientation()

If True, the portion of the dialog for changing the orientation of the paper is enabled.

EnablePaper(flag) GetEnablePaper()

If True, the portion of the dialog which allows the user to change the paper type is enabled.

EnablePrinter(flag) GetEnablePrinter()

If True, the button allowing the user to setup a printer is enabled.

Table 17.5 displays the additional properties of the wx.PageSetupDialogData class that control the margin and paper size for the page.

Table 17.5 Margin and size properties of wx.PageSetupDialogData

Property

Description

GetMarginTopLeft() SetMarginTopLeft(pt)

The getter returns a wx.Point where the x value Is the current left margin, and the y value is the current top margin. The setter allows you to change these values with a wx.Point or Python tuple.

GetMarginBottomRight() SetMarginBottomRight(pt)

The getter returns a wx.Point where the x value is the current right margin, and the y value is the current bottom margin. The setter allows you to change these values with a wx.Point or Python tuple.

GetMinMarginTopLeft() SetMinMarginTopLeft(pt)

As in GetMarginTopLeft(), only the value is the minimum allowable value for the left and top margins.

GetMinMarginBottomRight() SetMinMarginBottomRight(pt)

As in GetMarginBottomRight(), only the value is the minimum allowable value for the right and bottom margins.

GetPaperId() SetPaperld(id)

Returns the wxPython identifier for the current paper type. The same as the property of wx.PrinterData.

GetPaperSize() SetPaperSize(size)

The getter returns a wx.Size instance with the horizontal and vertical paper size. The unit is millimeters.

GetPrintData() SetPrintData(printData)

The getter returns the wx.PrintData instance associated with the current print session.

Now that we've described all of the data dialogs, we'll focus on printing something on the printer.

Was this article helpful?

0 0

Post a comment