.\" This is a wxWidgets manpage page generated from the XML docs .TH wxPrintout 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxPrintout \- Class representing a particular printout .SH DESCRIPTION This class encapsulates the functionality of printing out an application document. A new class must be derived and members overridden to respond to calls such as OnPrintPage and HasPage. Instances of this class are passed to wxPrinter::Print or a wxPrintPreview object to initiate printing or previewing. .SH "PARENTS" wxObject .SH "INCLUDE FILES" wx/print.h .SH MEMBERS .SS wxPrintout (const wxString& title = "Printout") Constructor. Pass an optional title argument - the current filename would be a good idea. This will appear in the printing list (at least in MSW) .SS ~wxPrintout () Destructor. .SS wxDC * GetDC () Returns the device context associated with the printout (given to the printout at start of printing or previewing). This will be a wxPrinterDC if printing under Windows, a wxPostScriptDC if printing on other platforms, and a wxMemoryDC if previewing. .SS void GetPageInfo (int *minPageint *maxPageint *pageFromint *pageTo) Called by the framework to obtain information from the application about minimum and maximum page values that the user can select, and the required page range to be printed. By default this returns 1, 32000 for the page minimum and maximum values, and 1, 1 for the required page range. If minPage is zero, the page number controls in the print dialog will be disabled. .SS void GetPageSizeMM (int *wint *h) Returns the size of the printer page in millimetres. .SS void GetPageSizePixels (int *wint *h) Returns the size of the printer page in pixels. These may not be the same as the values returned from wxDC::GetSize if the printout is being used for previewing, since in this case, a memory device context is used, using a bitmap size reflecting the current preview zoom. The application must take this discrepancy into account if previewing is to be supported. .SS void GetPPIPrinter (int *wint *h) Returns the number of pixels per logical inch of the printer device context. Dividing the printer PPI by the screen PPI can give a suitable scaling factor for drawing text onto the printer. Remember to multiply this by a scaling factor to take the preview DC size into account. .SS void GetPPIScreen (int *wint *h) Returns the number of pixels per logical inch of the screen device context. Dividing the printer PPI by the screen PPI can give a suitable scaling factor for drawing text onto the printer. Remember to multiply this by a scaling factor to take the preview DC size into account. .SS wxString GetTitle () Returns the title of the printout .SS bool HasPage (int pageNum) Should be overridden to return true if the document has this page, or false if not. Returning false signifies the end of the document. By default, HasPage behaves as if the document has only one page. .SS bool IsPreview () Returns true if the printout is currently being used for previewing. .SS bool OnBeginDocument (int startPageint endPage) Called by the framework at the start of document printing. Return false from this function cancels the print job. OnBeginDocument is called once for every copy printed. The base wxPrintout::OnBeginDocument must be called (and the return value checked) from within the overridden function, since it calls wxDC::StartDoc. .SS void OnEndDocument () Called by the framework at the end of document printing. OnEndDocument is called once for every copy printed. The base wxPrintout::OnEndDocument must be called from within the overridden function, since it calls wxDC::EndDoc. .SS void OnBeginPrinting () Called by the framework at the start of printing. OnBeginPrinting is called once for every print job (regardless of how many copies are being printed). .SS void OnEndPrinting () Called by the framework at the end of printing. OnEndPrinting is called once for every print job (regardless of how many copies are being printed). .SS void OnPreparePrinting () Called once by the framework before any other demands are made of the wxPrintout object. This gives the object an opportunity to calculate the number of pages in the document, for example. .SS bool OnPrintPage (int pageNum) Called by the framework when a page should be printed. Returning false cancels the print job. The application can use wxPrintout::GetDC to obtain a device context to draw on. .SH "SEE ALSO" wxObject Printing framework overview wxPrinterDC wxPrintDialog , wxPrinter wxPrintPreview .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.