.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.richtext.RichTextPrinting:
==========================================================================================================================================
|phoenix_title| **wx.richtext.RichTextPrinting**
==========================================================================================================================================
This class provides a simple interface for performing :ref:`wx.richtext.RichTextBuffer` printing and previewing.
It uses :ref:`wx.richtext.RichTextPrintout` for layout and rendering.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
RichTextPrinting:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextPrinting.__init__` Constructor.
:meth:`~wx.richtext.RichTextPrinting.GetFooterText` A convenience function to get the footer text.
:meth:`~wx.richtext.RichTextPrinting.GetHeaderFooterData` Returns the internal :ref:`wx.richtext.RichTextHeaderFooterData` object.
:meth:`~wx.richtext.RichTextPrinting.GetHeaderText` A convenience function to get the header text.
:meth:`~wx.richtext.RichTextPrinting.GetPageSetupData` Returns a pointer to the internal page setup data.
:meth:`~wx.richtext.RichTextPrinting.GetParentWindow` Returns the parent window to be used for the preview window and printing wait dialog.
:meth:`~wx.richtext.RichTextPrinting.GetPreviewRect` Returns the dimensions to be used for the preview window.
:meth:`~wx.richtext.RichTextPrinting.GetPrintData` Returns a pointer to the internal print data.
:meth:`~wx.richtext.RichTextPrinting.GetTitle` Returns the title of the preview window or printing wait caption.
:meth:`~wx.richtext.RichTextPrinting.PageSetup` Shows the page setup dialog.
:meth:`~wx.richtext.RichTextPrinting.PreviewBuffer` Shows a preview window for the given buffer.
:meth:`~wx.richtext.RichTextPrinting.PreviewFile` Shows a preview window for the given file.
:meth:`~wx.richtext.RichTextPrinting.PrintBuffer` Prints the given buffer.
:meth:`~wx.richtext.RichTextPrinting.PrintFile` Prints the given file.
:meth:`~wx.richtext.RichTextPrinting.SetFooterText` A convenience function to set the footer text.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterData` Sets the internal :ref:`wx.richtext.RichTextHeaderFooterData` object.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterFont` Sets the :ref:`wx.richtext.RichTextHeaderFooterData` font.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterTextColour` Sets the :ref:`wx.richtext.RichTextHeaderFooterData` text colour.
:meth:`~wx.richtext.RichTextPrinting.SetHeaderText` A convenience function to set the header text.
:meth:`~wx.richtext.RichTextPrinting.SetPageSetupData` Sets the page setup data.
:meth:`~wx.richtext.RichTextPrinting.SetParentWindow` Sets the parent window to be used for the preview window and printing wait dialog.
:meth:`~wx.richtext.RichTextPrinting.SetPreviewRect` Sets the dimensions to be used for the preview window.
:meth:`~wx.richtext.RichTextPrinting.SetPrintData` Sets the print data.
:meth:`~wx.richtext.RichTextPrinting.SetShowOnFirstPage` Pass ``True`` to show the header and footer on the first page.
:meth:`~wx.richtext.RichTextPrinting.SetTitle` Pass the title of the preview window or printing wait caption.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextPrinting.FooterText` See :meth:`~wx.richtext.RichTextPrinting.GetFooterText` and :meth:`~wx.richtext.RichTextPrinting.SetFooterText`
:attr:`~wx.richtext.RichTextPrinting.HeaderFooterData` See :meth:`~wx.richtext.RichTextPrinting.GetHeaderFooterData` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterData`
:attr:`~wx.richtext.RichTextPrinting.HeaderText` See :meth:`~wx.richtext.RichTextPrinting.GetHeaderText` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderText`
:attr:`~wx.richtext.RichTextPrinting.PageSetupData` See :meth:`~wx.richtext.RichTextPrinting.GetPageSetupData` and :meth:`~wx.richtext.RichTextPrinting.SetPageSetupData`
:attr:`~wx.richtext.RichTextPrinting.ParentWindow` See :meth:`~wx.richtext.RichTextPrinting.GetParentWindow` and :meth:`~wx.richtext.RichTextPrinting.SetParentWindow`
:attr:`~wx.richtext.RichTextPrinting.PreviewRect` See :meth:`~wx.richtext.RichTextPrinting.GetPreviewRect` and :meth:`~wx.richtext.RichTextPrinting.SetPreviewRect`
:attr:`~wx.richtext.RichTextPrinting.PrintData` See :meth:`~wx.richtext.RichTextPrinting.GetPrintData` and :meth:`~wx.richtext.RichTextPrinting.SetPrintData`
:attr:`~wx.richtext.RichTextPrinting.Title` See :meth:`~wx.richtext.RichTextPrinting.GetTitle` and :meth:`~wx.richtext.RichTextPrinting.SetTitle`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.richtext.RichTextPrinting(Object)
**Possible constructors**::
RichTextPrinting(name: str="Printing", parentWindow:
Optional[Window]=None) -> None
This class provides a simple interface for performing RichTextBuffer
printing and previewing.
.. method:: __init__(self, name: str="Printing", parentWindow: Optional[Window]=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.
:param `name`:
:type `name`: string
:param `parentWindow`:
:type `parentWindow`: wx.Window
:rtype: `None`
.. method:: GetFooterText(self, page: RichTextOddEvenPage=RICHTEXT_PAGE_EVEN, location: RichTextPageLocation=RICHTEXT_PAGE_CENTRE)
A convenience function to get the footer text.
See :ref:`wx.richtext.RichTextHeaderFooterData` for details.
:param `page`:
:type `page`: wx.richtext.RichTextOddEvenPage
:param `location`:
:type `location`: wx.richtext.RichTextPageLocation
:rtype: `str`
.. method:: GetHeaderFooterData(self)
Returns the internal :ref:`wx.richtext.RichTextHeaderFooterData` object.
:rtype: :ref:`wx.richtext.RichTextHeaderFooterData`
.. method:: GetHeaderText(self, page: RichTextOddEvenPage=RICHTEXT_PAGE_EVEN, location: RichTextPageLocation=RICHTEXT_PAGE_CENTRE)
A convenience function to get the header text.
See :ref:`wx.richtext.RichTextHeaderFooterData` for details.
:param `page`:
:type `page`: wx.richtext.RichTextOddEvenPage
:param `location`:
:type `location`: wx.richtext.RichTextPageLocation
:rtype: `str`
.. method:: GetPageSetupData(self)
Returns a pointer to the internal page setup data.
:rtype: `PageSetupDialogData`
.. method:: GetParentWindow(self)
Returns the parent window to be used for the preview window and printing wait dialog.
:rtype: `Window`
.. method:: GetPreviewRect(self)
Returns the dimensions to be used for the preview window.
:rtype: `Rect`
.. method:: GetPrintData(self)
Returns a pointer to the internal print data.
:rtype: `PrintData`
.. method:: GetTitle(self)
Returns the title of the preview window or printing wait caption.
:rtype: `str`
.. method:: PageSetup(self)
Shows the page setup dialog.
:rtype: `None`
.. method:: PreviewBuffer(self, buffer : RichTextBuffer)
Shows a preview window for the given buffer.
The function takes its own copy of `buffer`.
:param `buffer`:
:type `buffer`: wx.richtext.RichTextBuffer
:rtype: `bool`
.. method:: PreviewFile(self, richTextFile : str)
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.
:param `richTextFile`:
:type `richTextFile`: string
:rtype: `bool`
.. method:: PrintBuffer(self, buffer : RichTextBuffer, showPrintDialog: bool=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.
:param `buffer`:
:type `buffer`: wx.richtext.RichTextBuffer
:param `showPrintDialog`:
:type `showPrintDialog`: bool
:rtype: `bool`
.. method:: PrintFile(self, richTextFile : str, showPrintDialog: bool=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.
:param `richTextFile`:
:type `richTextFile`: string
:param `showPrintDialog`:
:type `showPrintDialog`: bool
:rtype: `bool`
.. method:: SetFooterText(self, text : str, page: RichTextOddEvenPage=RICHTEXT_PAGE_ALL, location: RichTextPageLocation=RICHTEXT_PAGE_CENTRE)
A convenience function to set the footer text.
See :ref:`wx.richtext.RichTextHeaderFooterData` for details.
:param `text`:
:type `text`: string
:param `page`:
:type `page`: wx.richtext.RichTextOddEvenPage
:param `location`:
:type `location`: wx.richtext.RichTextPageLocation
:rtype: `None`
.. method:: SetHeaderFooterData(self, data : RichTextHeaderFooterData)
Sets the internal :ref:`wx.richtext.RichTextHeaderFooterData` object.
:param `data`:
:type `data`: wx.richtext.RichTextHeaderFooterData
:rtype: `None`
.. method:: SetHeaderFooterFont(self, font : Font)
Sets the :ref:`wx.richtext.RichTextHeaderFooterData` font.
:param `font`:
:type `font`: wx.Font
:rtype: `None`
.. method:: SetHeaderFooterTextColour(self, colour : Colour)
Sets the :ref:`wx.richtext.RichTextHeaderFooterData` text colour.
:param `colour`:
:type `colour`: wx.Colour
:rtype: `None`
.. method:: SetHeaderText(self, text : str, page: RichTextOddEvenPage=RICHTEXT_PAGE_ALL, location: RichTextPageLocation=RICHTEXT_PAGE_CENTRE)
A convenience function to set the header text.
See :ref:`wx.richtext.RichTextHeaderFooterData` for details.
:param `text`:
:type `text`: string
:param `page`:
:type `page`: wx.richtext.RichTextOddEvenPage
:param `location`:
:type `location`: wx.richtext.RichTextPageLocation
:rtype: `None`
.. method:: SetPageSetupData(self, pageSetupData : PageSetupDialogData)
Sets the page setup data.
:param `pageSetupData`:
:type `pageSetupData`: wx.PageSetupDialogData
:rtype: `None`
.. method:: SetParentWindow(self, parent : Window)
Sets the parent window to be used for the preview window and printing wait dialog.
:param `parent`:
:type `parent`: wx.Window
:rtype: `None`
.. method:: SetPreviewRect(self, rect : Rect)
Sets the dimensions to be used for the preview window.
:param `rect`:
:type `rect`: wx.Rect
:rtype: `None`
.. method:: SetPrintData(self, printData : PrintData)
Sets the print data.
:param `printData`:
:type `printData`: wx.PrintData
:rtype: `None`
.. method:: SetShowOnFirstPage(self, show : bool)
Pass ``True`` to show the header and footer on the first page.
:param `show`:
:type `show`: bool
:rtype: `None`
.. method:: SetTitle(self, title : str)
Pass the title of the preview window or printing wait caption.
:param `title`:
:type `title`: string
:rtype: `None`
.. attribute:: FooterText
See :meth:`~wx.richtext.RichTextPrinting.GetFooterText` and :meth:`~wx.richtext.RichTextPrinting.SetFooterText`
.. attribute:: HeaderFooterData
See :meth:`~wx.richtext.RichTextPrinting.GetHeaderFooterData` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderFooterData`
.. attribute:: HeaderText
See :meth:`~wx.richtext.RichTextPrinting.GetHeaderText` and :meth:`~wx.richtext.RichTextPrinting.SetHeaderText`
.. attribute:: PageSetupData
See :meth:`~wx.richtext.RichTextPrinting.GetPageSetupData` and :meth:`~wx.richtext.RichTextPrinting.SetPageSetupData`
.. attribute:: ParentWindow
See :meth:`~wx.richtext.RichTextPrinting.GetParentWindow` and :meth:`~wx.richtext.RichTextPrinting.SetParentWindow`
.. attribute:: PreviewRect
See :meth:`~wx.richtext.RichTextPrinting.GetPreviewRect` and :meth:`~wx.richtext.RichTextPrinting.SetPreviewRect`
.. attribute:: PrintData
See :meth:`~wx.richtext.RichTextPrinting.GetPrintData` and :meth:`~wx.richtext.RichTextPrinting.SetPrintData`
.. attribute:: Title
See :meth:`~wx.richtext.RichTextPrinting.GetTitle` and :meth:`~wx.richtext.RichTextPrinting.SetTitle`