CPrintMgrreceives printing task messages and takes care of printing for an XVT-Power++ application. Currently, only views can be printed. The print manager has a queue of printing jobs and contains information about the page(s) to be designated for each job.
CPrintMgrthus includes a set of printing queue methods.
CPrintMgris used internally, but sometimes you might want to access it directly. You can access a global instance of this class through the
CPrintMgrincludes a set of print queue methods and a set of printing methods that are used when you have finished filling the queue and want to send the job to the printer.
DoPrintmethods in the
CViewclasses already take care of all the print queue and print message tasks internally. You don't have to deal with the print manager at all unless you want to do customized printing that is not accommodated in the default
See Also: If you are interested in implementing your own printing mechanisms, see the "Printing" chapter in the XVT Portability Toolkit Guide.
Protected Data Members
The view to print
The XVT Portability Toolkit printing record
The title of the print job
The last page of output
The XVT Portability Toolkit printing window
Constructor and Destructor Methods
virtual void Insert(const CView* theView,
CRect& theRegion, int thePage = LASTPage);
theViewis the view to be inserted.
theRegionis the clipping region, which is relative to the enclosure for the view. Finally,
thePageis the page of the queue on which the view is to be printed. By default, a newly inserted view is printed on the last page. Then the next view is inserted on the page after the last page, which becomes the last page, and so on. In short, each new object is inserted at the end of the page queue and a page is added each time a view is inserted. You can insert a view into the queue several times if you want to print it on several different pages.
virtual int Remove(const CView* theView,
int thePage = ALLPages);
theViewis the view to be removed.
thePageis useful if the view is printed on more than one page. This parameter allows you to specify particular pages from which the view is to be removed. By default, the view is removed from all pages on which it appears.
virtual const RWOrdered GetQueue(int thePage = ALLPages) const;
thePageallows you to get a list of everything that is printed on a particular page.
virtual void ClearQueue(void);
virtual BOOLEAN DoPrint(PRINT_RCD* printRecord,
const CStringRW& theTitle = NULLString);
DoPrintsets up a special method, a static method called
PrintThread. See the description of this method next.
printRecorddescribes the print set-up, and
theTitleis the title of the printing job. You can override this method to specify a different kind of printing or printing set-up.
static BOOLEAN PrintThread(long theData);
PrintThreadsearches the queue and generates all printing events, creates the print window, and basically takes care of all of the actual interface with the XVT Portability Toolkit for printing.
theDatacan be a long or a pointer to any kind of data that is needed during printing.
static WINDOW GetPrintWindow(void);
NULLwhen no printing is being done, but if a printing window is being used, this method returns that window.
GetPrintWindowis especially useful when you want to draw to the print manager's print window. XVT-Power++ already takes care of this task internally, so you will probably never have to call
CPrintMgrobject by calling