PtPrintSelection()

Display a modal dialog for selecting print options

Synopsis:

int PtPrintSelection( PtWidget_t *parent, 
                      PhPoint_t const *pos,
                      const char *title, 
                      PpPrintContext_t *context,
                      unsigned flags);

Arguments:

parent
A pointer to the parent widget for the dialog. If the parent widget isn't NULL, it's blocked and its cursor is changed to reflect this.

The parent argument is also used to position the dialog, as described below.

pos
A pointer to a PhPoint_t structure that specifies the position of the dialog (see below).
title
The title of the dialog; if this is NULL, a default title of “Select Printer” is used.
context
A pointer to a PpPrintContext_t structure that was created by PpCreatePC(). This pointer must not be NULL. PtPrintSelection() updates the print context.
flags
Flags that enable or disable parts of the user interface (see below). This argument should normally be set to Pt_PRINTSEL_DFLT_LOOK.

Library:

ph

Description:

This convenience function displays a PtPrintSel widget and a button-pane in a modal dialog. It lets you select print options and initiate printing:

PtPrintSelection() dialog

The parent and pos arguments determine where the dialog is to appear:

parent pos Position of dialog
NULL NULL Center of the screen
NULL Non-NULL pos relative to the screen
Non-NULL NULL Center of parent
Non-NULL Non-NULL pos relative to parent

Your application can call PpSetPC() to modify the print context before calling PtPrintSelection(). These modifications are propagated to the PtPrintSel widget. Note that some modified context settings may not be displayed or may be reset (e.g. if the selected printer doesn't support double-sided printing and the Pp_PC_DUPLEX member was set in the context before calling PtPrintSelection()).

The valid flags are those defined for Pt_ARG_PRINT_FLAGS:

Pt_PRINTSEL_FILE_PANE
Enable the Send to file pane.
Pt_PRINTSEL_NO_COPIES
Disable the Copies widget.
Pt_PRINTSEL_NO_PAGE_RANGE
Disable the Print Range toggle button and the From and To fields.
Pt_PRINTSEL_NO_PRINTSELECT
Disable the printer-name combobox. Physical output goes to the default physical printer whose name is shown.
Pt_PRINTSEL_NO_SELECT_RANGE
Disable the Print Selection toggle button.
Pt_PRINTSEL_PREFERENCES
Enable the Preferences button.
Pt_PRINTSEL_SETTINGS_PANE
Enable the Print Pages, Print Order and Copies panes.

The following flag macros are defined in <PtPrintSel.h>:

Pt_PRINTSEL_ALL_PANES
Pt_PRINTSEL_FILE_PANE | Pt_PRINTSEL_SETTINGS_PANE
Pt_PRINTSEL_DFLT_LOOK
Pt_PRINTSEL_FILE_PANE | Pt_PRINTSEL_SETTINGS_PANE | Pt_PRINTSEL_PREFERENCES

The user may click one of these buttons:

Returns:

An integer that indicates which button was pressed:

The Pp_PC_DO_PREVIEW member of the print context is set when the user presses the Preview button. This means that the context can be passed to the printing function, which spawn the print-preview application if necessary.

Examples:

See PpContinueJob().

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhPoint_t, PpPrintContext_t, PpPrintWidget(), PpSetPC(), PtPrintSelect(), PtPrintPropSelect()

PtPrintSel in the Photon Widget Reference

Dialog modules in the Working with Modules chapter, and the Printing chapter of the Photon Programmer's Guide