.. 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.RichTextPrintout:
==========================================================================================================================================
|phoenix_title| **wx.richtext.RichTextPrintout**
==========================================================================================================================================
This class implements print layout for :ref:`wx.richtext.RichTextBuffer`.
Instead of using it directly, you should normally use the :ref:`wx.richtext.RichTextPrinting` class.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
RichTextPrintout:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.richtext.RichTextPrintout.__init__` Constructor.
:meth:`~wx.richtext.RichTextPrintout.CalculateScaling` Calculates scaling and text, header and footer rectangles.
:meth:`~wx.richtext.RichTextPrintout.GetHeaderFooterData` Returns the header and footer data associated with the printout.
:meth:`~wx.richtext.RichTextPrintout.GetPageInfo` Gets the page information.
:meth:`~wx.richtext.RichTextPrintout.GetRichTextBuffer` Returns a pointer to the buffer being rendered.
:meth:`~wx.richtext.RichTextPrintout.HasPage` Returns ``True`` if the given page exists in the printout.
:meth:`~wx.richtext.RichTextPrintout.OnPreparePrinting` Prepares for printing, laying out the buffer and calculating pagination.
:meth:`~wx.richtext.RichTextPrintout.OnPrintPage` Does the actual printing for this page.
:meth:`~wx.richtext.RichTextPrintout.SetHeaderFooterData` Sets the header and footer data associated with the printout.
:meth:`~wx.richtext.RichTextPrintout.SetMargins` Sets margins in 10ths of millimetre.
:meth:`~wx.richtext.RichTextPrintout.SetRichTextBuffer` Sets the buffer to print.
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.richtext.RichTextPrintout.HeaderFooterData` See :meth:`~wx.richtext.RichTextPrintout.GetHeaderFooterData` and :meth:`~wx.richtext.RichTextPrintout.SetHeaderFooterData`
:attr:`~wx.richtext.RichTextPrintout.RichTextBuffer` See :meth:`~wx.richtext.RichTextPrintout.GetRichTextBuffer` and :meth:`~wx.richtext.RichTextPrintout.SetRichTextBuffer`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.richtext.RichTextPrintout(Printout)
**Possible constructors**::
RichTextPrintout(title: str="Printout") -> None
This class implements print layout for RichTextBuffer.
.. method:: __init__(self, title: str="Printout")
Constructor.
:param `title`:
:type `title`: string
:rtype: `None`
.. method:: CalculateScaling(self, dc : DC, textRect : Rect, headerRect : Rect, footerRect : Rect)
Calculates scaling and text, header and footer rectangles.
:param `dc`:
:type `dc`: wx.DC
:param `textRect`:
:type `textRect`: wx.Rect
:param `headerRect`:
:type `headerRect`: wx.Rect
:param `footerRect`:
:type `footerRect`: wx.Rect
:rtype: `None`
.. method:: GetHeaderFooterData(self)
Returns the header and footer data associated with the printout.
:rtype: :ref:`wx.richtext.RichTextHeaderFooterData`
.. method:: GetPageInfo(self)
Gets the page information.
:rtype: :ref:`Tuple[int, int, int, int]`
.. method:: GetRichTextBuffer(self)
Returns a pointer to the buffer being rendered.
:rtype: :ref:`wx.richtext.RichTextBuffer`
.. method:: HasPage(self, page : int)
Returns ``True`` if the given page exists in the printout.
:param `page`:
:type `page`: int
:rtype: `bool`
.. method:: OnPreparePrinting(self)
Prepares for printing, laying out the buffer and calculating pagination.
:rtype: `None`
.. method:: OnPrintPage(self, page : int)
Does the actual printing for this page.
:param `page`:
:type `page`: int
:rtype: `bool`
.. method:: SetHeaderFooterData(self, data : RichTextHeaderFooterData)
Sets the header and footer data associated with the printout.
:param `data`:
:type `data`: wx.richtext.RichTextHeaderFooterData
:rtype: `None`
.. method:: SetMargins(self, top: int=254, bottom: int=254, left: int=254, right: int=254)
Sets margins in 10ths of millimetre.
Defaults to 1 inch for margins.
:param `top`:
:type `top`: int
:param `bottom`:
:type `bottom`: int
:param `left`:
:type `left`: int
:param `right`:
:type `right`: int
:rtype: `None`
.. method:: SetRichTextBuffer(self, buffer : RichTextBuffer)
Sets the buffer to print.
:ref:`wx.richtext.RichTextPrintout` does not manage this pointer; it should be managed by the calling code, such as :ref:`wx.richtext.RichTextPrinting`.
:param `buffer`:
:type `buffer`: wx.richtext.RichTextBuffer
:rtype: `None`
.. attribute:: HeaderFooterData
See :meth:`~wx.richtext.RichTextPrintout.GetHeaderFooterData` and :meth:`~wx.richtext.RichTextPrintout.SetHeaderFooterData`
.. attribute:: RichTextBuffer
See :meth:`~wx.richtext.RichTextPrintout.GetRichTextBuffer` and :meth:`~wx.richtext.RichTextPrintout.SetRichTextBuffer`