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.

Class methods
Creates an instance of the XbpPrintDialog class.
Life cycle
Requests system resources for an XbpPrintDialog object.
Reconfigures the XbpPrintDialog object after :create() has been executed.
Releases the system resources of the XbpPrintDialog object.
Enables the collation option.
Enables the "Print marked range" option.
Enables the "Number of Copies" option.
Enables the "Print to File" option.
Defines the mode to display the dialog in.
Defines the range of pages to be printed.
The class of the printer object returned by :display().
Configuration and results

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.

Use collation when printing.
Specifies the number of copies to print.
Specifies the range of pages to print selected by the user.
Defines the range of pages to print.
Indicates if output is re-directed to a file.
Displays the printer dialog window and configures an XbpPrinter object.
Configuring a print job

// The example demonstrates the steps required for 
// print job configuration. 

 #include "" 
 #include "" 

 #pragma Library( "XppUI2.lib" ) 

    LOCAL oPrinter, oPS, oDlg, aSize 

    oDlg := XbpPrintDialog():new() 

    // Default output goes to file 
    oDlg:enablePrintToFile := .T. 
    oDlg:printToFile       := .T. 

    // Obtain configured printer object 
    oPrinter := oDlg:display() 

    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 
       GraStringAt( oPS, { 0, aSize[2]-50 }, "Hello World" ) 

       // Housekeeping 

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.