| Version: 3.2.5

Public Member Functions | List of all members
wxRichTextPrintout Class Reference
Class List by Category » Rich Text

`#include <wx/richtext/richtextprint.h>`

Inheritance diagram for wxRichTextPrintout:
[legend]

## Detailed Description

This class implements print layout for wxRichTextBuffer.

Instead of using it directly, you should normally use the wxRichTextPrinting class.

##

Library: wxRichText
Category: Rich Text

## Public Member Functions

| wxRichTextPrintout (const wxString &title="Printout")
| Constructor. More...
void | CalculateScaling (wxDC *dc, wxRect &textRect, wxRect &headerRect, wxRect &footerRect)
| Calculates scaling and text, header and footer rectangles. More...
const wxRichTextHeaderFooterData & | GetHeaderFooterData () const
| Returns the header and footer data associated with the printout. More...
virtual void | GetPageInfo (int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
| Gets the page information. More...
wxRichTextBuffer * | GetRichTextBuffer () const
| Returns a pointer to the buffer being rendered. More...
virtual bool | HasPage (int page)
| Returns true if the given page exists in the printout. More...
virtual void | OnPreparePrinting ()
| Prepares for printing, laying out the buffer and calculating pagination. More...
virtual bool | OnPrintPage (int page)
| Does the actual printing for this page. More...
void | SetHeaderFooterData (const wxRichTextHeaderFooterData &data)
| Sets the header and footer data associated with the printout. More...
void | SetMargins (int top=254, int bottom=254, int left=254, int right=254)
| Sets margins in 10ths of millimetre. More...
void | SetRichTextBuffer (wxRichTextBuffer *buffer)
| Sets the buffer to print. More...
Public Member Functions inherited from wxPrintout
| wxPrintout (const wxString &title="Printout")
| Constructor. More...
virtual | ~wxPrintout ()
| Destructor. More...
void | FitThisSizeToPage (const wxSize &imageSize)
| Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page rectangle and the origin is at the top left corner of the page rectangle. More...
void | FitThisSizeToPageMargins (const wxSize &imageSize, const wxPageSetupDialogData &pageSetupData)
| Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the page margins set in the given wxPageSetupDialogData object. More...
void | FitThisSizeToPaper (const wxSize &imageSize)
| Set the user scale and device origin of the wxDC associated with this wxPrintout so that the given image size fits entirely within the paper and the origin is at the top left corner of the paper. More...
wxDC * | GetDC () const
| Returns the device context associated with the printout (given to the printout at start of printing or previewing). More...
wxRect | GetLogicalPageMarginsRect (const wxPageSetupDialogData &pageSetupData) const
| Return the rectangle corresponding to the page margins specified by the given wxPageSetupDialogData object in the associated wxDC's logical coordinates for the current user scale and device origin. More...
wxRect | GetLogicalPageRect () const
| Return the rectangle corresponding to the page in the associated wxDC 's logical coordinates for the current user scale and device origin. More...
wxRect | GetLogicalPaperRect () const
| Return the rectangle corresponding to the paper in the associated wxDC 's logical coordinates for the current user scale and device origin. More...
void | GetPPIPrinter (int *w, int *h) const
| Returns the number of pixels per logical inch of the printer device context. More...
void | GetPPIScreen (int *w, int *h) const
| Returns the number of pixels per logical inch of the screen device context. More...
void | GetPageSizeMM (int *w, int *h) const
| Returns the size of the printer page in millimetres. More...
void | GetPageSizePixels (int *w, int *h) const
| Returns the size of the printer page in pixels, called the page rectangle. More...
wxRect | GetPaperRectPixels () const
| Returns the rectangle that corresponds to the entire paper in pixels, called the paper rectangle. More...
virtual wxString | GetTitle () const
| Returns the title of the printout. More...
virtual bool | IsPreview () const
| Returns true if the printout is currently being used for previewing. More...
wxPrintPreview * | GetPreview () const
| Returns the associated preview object if any. More...
void | MapScreenSizeToDevice ()
| Set the user scale and device origin of the wxDC associated with this wxPrintout so that one screen pixel maps to one device pixel on the DC. More...
void | MapScreenSizeToPage ()
| This sets the user scale of the wxDC associated with this wxPrintout to the same scale as MapScreenSizeToPaper() but sets the logical origin to the top left corner of the page rectangle. More...
void | MapScreenSizeToPageMargins (const wxPageSetupDialogData &pageSetupData)
| This sets the user scale of the wxDC associated with this wxPrintout to the same scale as MapScreenSizeToPageMargins() but sets the logical origin to the top left corner of the page margins specified by the given wxPageSetupDialogData object. More...
void | MapScreenSizeToPaper ()
| Set the user scale and device origin of the wxDC associated with this wxPrintout so that the printed page matches the screen size as closely as possible and the logical origin is in the top left corner of the paper rectangle. More...
void | OffsetLogicalOrigin (wxCoord xoff, wxCoord yoff)
| Shift the device origin by an amount specified in logical coordinates. More...
virtual bool | OnBeginDocument (int startPage, int endPage)
| Called by the framework at the start of document printing. More...
virtual void | OnBeginPrinting ()
| Called by the framework at the start of printing. More...
virtual void | OnEndDocument ()
| Called by the framework at the end of document printing. More...
virtual void | OnEndPrinting ()
| Called by the framework at the end of printing. More...
void | SetLogicalOrigin (wxCoord x, wxCoord y)
| Set the device origin of the associated wxDC so that the current logical point becomes the new logical origin. More...
Public Member Functions inherited from wxObject
| wxObject ()
| Default ctor; initializes to NULL the internal reference data. More...
| wxObject (const wxObject &other)
| Copy ctor. More...
virtual | ~wxObject ()
| Destructor. More...
virtual wxClassInfo * | GetClassInfo () const
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar). More...
wxObjectRefData * | GetRefData () const
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object. More...
bool | IsKindOf (const wxClassInfo *info) const
| Determines whether this class is a subclass of (or the same class as) the given class. More...
bool | IsSameAs (const wxObject &obj) const
| Returns true if this object has the same data pointer as obj. More...
void | Ref (const wxObject &clone)
| Makes this object refer to the data in clone. More...
void | SetRefData (wxObjectRefData *data)
| Sets the wxObject::m_refData pointer. More...
void | UnRef ()
| Decrements the reference count in the associated data, and if it is zero, deletes the data. More...
void | UnShare ()
| This is the same of AllocExclusive() but this method is public. More...
void | operator delete (void *buf)
| The delete operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0)
| The new operator is defined for debugging versions of the library only, when the identifier `__WXDEBUG__` is defined. More...

## Additional Inherited Members

Protected Member Functions inherited from wxObject
void | AllocExclusive ()
| Ensure that this object's data is not shared with any other object. More...
virtual wxObjectRefData * | CreateRefData () const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and returns it. More...
virtual wxObjectRefData * | CloneRefData (const wxObjectRefData *data) const
| Creates a new instance of the wxObjectRefData-derived class specific to this object and initializes it copying data. More...
Protected Attributes inherited from wxObject
wxObjectRefData * | m_refData
| Pointer to an object which is the object's reference-counted data. More...

## Constructor & Destructor Documentation

## ◆ wxRichTextPrintout()

wxRichTextPrintout::wxRichTextPrintout | ( | const wxString & | title = `"Printout"` | ) |

Constructor.

## Member Function Documentation

## ◆ CalculateScaling()

void wxRichTextPrintout::CalculateScaling | ( | wxDC * | dc,
|  | wxRect & | textRect,
|  | wxRect & | headerRect,
|  | wxRect & | footerRect
| ) |  |

Calculates scaling and text, header and footer rectangles.

## ◆ GetHeaderFooterData()

const wxRichTextHeaderFooterData& wxRichTextPrintout::GetHeaderFooterData | ( |  | ) | const

Returns the header and footer data associated with the printout.

## ◆ GetPageInfo()

virtual void wxRichTextPrintout::GetPageInfo | ( | int * | minPage,
|  | int * | maxPage,
|  | int * | selPageFrom,
|  | int * | selPageTo
| ) |  |

virtual

Gets the page information.

Reimplemented from wxPrintout.

## ◆ GetRichTextBuffer()

wxRichTextBuffer* wxRichTextPrintout::GetRichTextBuffer | ( |  | ) | const

Returns a pointer to the buffer being rendered.

## ◆ HasPage()

virtual bool wxRichTextPrintout::HasPage | ( | int | page | ) |

virtual

Returns true if the given page exists in the printout.

Reimplemented from wxPrintout.

## ◆ OnPreparePrinting()

virtual void wxRichTextPrintout::OnPreparePrinting | ( |  | ) |

virtual

Prepares for printing, laying out the buffer and calculating pagination.

Reimplemented from wxPrintout.

## ◆ OnPrintPage()

virtual bool wxRichTextPrintout::OnPrintPage | ( | int | page | ) |

virtual

Does the actual printing for this page.

Implements wxPrintout.

## ◆ SetHeaderFooterData()

void wxRichTextPrintout::SetHeaderFooterData | ( | const wxRichTextHeaderFooterData & | data | ) |

Sets the header and footer data associated with the printout.

## ◆ SetMargins()

void wxRichTextPrintout::SetMargins | ( | int | top = `254`,
|  | int | bottom = `254`,
|  | int | left = `254`,
|  | int | right = `254`
| ) |  |

Sets margins in 10ths of millimetre.

Defaults to 1 inch for margins.

## ◆ SetRichTextBuffer()

void wxRichTextPrintout::SetRichTextBuffer | ( | wxRichTextBuffer * | buffer | ) |

Sets the buffer to print.

wxRichTextPrintout does not manage this pointer; it should be managed by the calling code, such as wxRichTextPrinting.