Phoenix Logo

phoenix_title wx.richtext.RichTextPrinting

This class provides a simple interface for performing wx.richtext.RichTextBuffer printing and previewing.

It uses wx.richtext.RichTextPrintout for layout and rendering.


class_hierarchy Class Hierarchy

Inheritance diagram for class RichTextPrinting:


method_summary Methods Summary

__init__ Constructor.
GetFooterText A convenience function to get the footer text.
GetHeaderFooterData Returns the internal wx.richtext.RichTextHeaderFooterData object.
GetHeaderText A convenience function to get the header text.
GetPageSetupData Returns a pointer to the internal page setup data.
GetParentWindow Returns the parent window to be used for the preview window and printing wait dialog.
GetPreviewRect Returns the dimensions to be used for the preview window.
GetPrintData Returns a pointer to the internal print data.
GetTitle Returns the title of the preview window or printing wait caption.
PageSetup Shows the page setup dialog.
PreviewBuffer Shows a preview window for the given buffer.
PreviewFile Shows a preview window for the given file.
PrintBuffer Prints the given buffer.
PrintFile Prints the given file.
SetFooterText A convenience function to set the footer text.
SetHeaderFooterData Sets the internal wx.richtext.RichTextHeaderFooterData object.
SetHeaderFooterFont Sets the wx.richtext.RichTextHeaderFooterData font.
SetHeaderFooterTextColour Sets the wx.richtext.RichTextHeaderFooterData text colour.
SetHeaderText A convenience function to set the header text.
SetPageSetupData Sets the page setup data.
SetParentWindow Sets the parent window to be used for the preview window and printing wait dialog.
SetPreviewRect Sets the dimensions to be used for the preview window.
SetPrintData Sets the print data.
SetShowOnFirstPage Pass True to show the header and footer on the first page.
SetTitle Pass the title of the preview window or printing wait caption.

api Class API



class wx.richtext.RichTextPrinting(Object)

Possible constructors:

RichTextPrinting(name="Printing", parentWindow=None)

This class provides a simple interface for performing RichTextBuffer printing and previewing.


Methods



__init__(self, name="Printing", parentWindow=None)

Constructor.

Optionally pass a title to be used in the preview frame and printing wait dialog, and also a parent window for these windows.

Parameters:
  • name (string) –
  • parentWindow (wx.Window) –


GetFooterText(self, page=RICHTEXT_PAGE_EVEN, location=RICHTEXT_PAGE_CENTRE)

A convenience function to get the footer text.

See wx.richtext.RichTextHeaderFooterData for details.

Parameters:
Return type:

string



GetHeaderFooterData(self)

Returns the internal wx.richtext.RichTextHeaderFooterData object.

Return type: wx.richtext.RichTextHeaderFooterData


GetHeaderText(self, page=RICHTEXT_PAGE_EVEN, location=RICHTEXT_PAGE_CENTRE)

A convenience function to get the header text.

See wx.richtext.RichTextHeaderFooterData for details.

Parameters:
Return type:

string



GetPageSetupData(self)

Returns a pointer to the internal page setup data.

Return type:PageSetupDialogData


GetParentWindow(self)

Returns the parent window to be used for the preview window and printing wait dialog.

Return type:Window


GetPreviewRect(self)

Returns the dimensions to be used for the preview window.

Return type:Rect


GetPrintData(self)

Returns a pointer to the internal print data.

Return type:PrintData


GetTitle(self)

Returns the title of the preview window or printing wait caption.

Return type:string


PageSetup(self)

Shows the page setup dialog.



PreviewBuffer(self, buffer)

Shows a preview window for the given buffer.

The function takes its own copy of buffer.

Parameters:buffer (wx.richtext.RichTextBuffer) –
Return type:bool


PreviewFile(self, richTextFile)

Shows a preview window for the given file.

richTextFile can be a text file or XML file, or other file depending on the available file handlers.

Parameters:richTextFile (string) –
Return type:bool


PrintBuffer(self, buffer, showPrintDialog=True)

Prints the given buffer.

The function takes its own copy of buffer. showPrintDialog can be True to show the print dialog, or False to print quietly.

Parameters:
Return type:

bool



PrintFile(self, richTextFile, showPrintDialog=True)

Prints the given file.

richTextFile can be a text file or XML file, or other file depending on the available file handlers. showPrintDialog can be True to show the print dialog, or False to print quietly.

Parameters:
  • richTextFile (string) –
  • showPrintDialog (bool) –
Return type:

bool



SetFooterText(self, text, page=RICHTEXT_PAGE_ALL, location=RICHTEXT_PAGE_CENTRE)

A convenience function to set the footer text.

See wx.richtext.RichTextHeaderFooterData for details.

Parameters:


SetHeaderFooterData(self, data)

Sets the internal wx.richtext.RichTextHeaderFooterData object.

Parameters:data (wx.richtext.RichTextHeaderFooterData) –


SetHeaderFooterFont(self, font)

Sets the wx.richtext.RichTextHeaderFooterData font.

Parameters:font (wx.Font) –


SetHeaderFooterTextColour(self, colour)

Sets the wx.richtext.RichTextHeaderFooterData text colour.

Parameters:colour (wx.Colour) –


SetHeaderText(self, text, page=RICHTEXT_PAGE_ALL, location=RICHTEXT_PAGE_CENTRE)

A convenience function to set the header text.

See wx.richtext.RichTextHeaderFooterData for details.

Parameters:


SetPageSetupData(self, pageSetupData)

Sets the page setup data.

Parameters:pageSetupData (wx.PageSetupDialogData) –


SetParentWindow(self, parent)

Sets the parent window to be used for the preview window and printing wait dialog.

Parameters:parent (wx.Window) –


SetPreviewRect(self, rect)

Sets the dimensions to be used for the preview window.

Parameters:rect (wx.Rect) –


SetPrintData(self, printData)

Sets the print data.

Parameters:printData (wx.PrintData) –


SetShowOnFirstPage(self, show)

Pass True to show the header and footer on the first page.

Parameters:show (bool) –


SetTitle(self, title)

Pass the title of the preview window or printing wait caption.

Parameters:title (string) –

Properties



FooterText

See GetFooterText and SetFooterText



HeaderFooterData

See GetHeaderFooterData and SetHeaderFooterData



HeaderText

See GetHeaderText and SetHeaderText



PageSetupData

See GetPageSetupData and SetPageSetupData



ParentWindow

See GetParentWindow and SetParentWindow



PreviewRect

See GetPreviewRect and SetPreviewRect



PrintData

See GetPrintData and SetPrintData



Title

See GetTitle and SetTitle