Class XbpPrintDialog() Foundation
Class function of the XbpPrintDialog class.
Objects of the XbpPrintDialog class are used to configure printers and print jobs within an Xbase++ applications. It implements the functionality to display a modal dialog window that enables the user to configure a print job's properties, such as the printer to print on or whether collation is to be used when printing.
Instance variables in this group serve two purposes: they configure certain options before the printer dialog window is displayed and receive the result of what a user has selected when the window is closed.
// The example demonstrates the steps required for
// print job configuration.
#include "Gra.ch"
#include "Xbp.ch"
#pragma Library( "XppUI2.lib" )
PROCEDURE Main
LOCAL oPrinter, oPS, oDlg, aSize
oDlg := XbpPrintDialog():new()
// Default output goes to file
oDlg:enablePrintToFile := .T.
oDlg:printToFile := .T.
oDlg:create()
// Obtain configured printer object
oPrinter := oDlg:display()
oDlg:destroy()
IF oPrinter <> NIL
// Create a new presentation space
oPS := XbpPresSpace():new()
// Size of printable region on paper
aSize := oPrinter:paperSize()
aSize := { aSize[5] - aSize[3], ;
aSize[6] - aSize[4] }
oPS:create( oPrinter, aSize, GRA_PU_LOMETRIC )
// Tiny print job
oPrinter:startDoc()
GraStringAt( oPS, { 0, aSize[2]-50 }, "Hello World" )
oPrinter:endDoc()
// Housekeeping
oPrinter:destroy()
oPS:destroy()
ENDIF
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.