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);
Description:
This function displays a modal dialog allowing the user to select print options and initiate printing. The dialog is parented off the parent widget, which may be NULL; if non-NULL, that parent widget is blocked and its cursor is changed to reflect this.
The dialog is positioned according to the pos parameter: if NULL, the dialog is centered on the screen; if parent is NULL, the dialog is placed at the absolute coordinates of pos; otherwise it's placed at the relative offset of pos within parent.
The title of the dialog is given by title; if this is NULL a default title of "Select Printer" is used.
The context parameter is a Print Context that was created by the PpPrintCreatePC() function. This context must be supplied and is filled in with details of the selected printer:
- At the start of this function, the print context is examined and any fields modified at or below the INITIAL_PC level are propagated into the PtPrintSel.
- The context is updated (at the INTERACTIVE_PC level) with any changes made to the widget by the user.
The flags parameter is used to enable or disable parts of the user interface. Valid flags are:
- Pt_PRINTSEL_ALL_PANES
- If this flag is set, all the panes of the print selector are displayed; if cleared, the Print Range and Copies panes aren't displayed.
- Pt_PRINTSEL_PROP_APP
- If set, the Properties button is enabled.
- Pt_PRINTSEL_NO_PAGE_RANGE
- If this flag is set, you can't specify a range of pages to print.
- Pt_PRINTSEL_NO_SELECT_RANGE
- If this is set, the Selection button in the Page Range pane is disabled.
- Pt_PRINTSEL_NO_COPIES
- If this flag is set, the Number of Copies field is disabled.
- Pt_PRINTSEL_NO_COLLATE
- If this is set, the Collate Method buttons are disabled.
- Pt_PRINTSEL_DFLT_LOOK
- Use the default look (equivalent to Pt_PRINTSEL_ALL_PANES | Pt_PRINTSEL_PROP_APP | Pt_PRINTSEL_NO_SELECT_RANGE)
You can OR the flags together to obtain a suitable mask.
The user may click one of these buttons:
- Print-initiate printing
- Preview-view the material to be printed
- Cancel-cancel the operation
Returns:
An integer that indicates which button was pressed:
- Pt_PRINTSEL_PRINT
- Pt_PRINTSEL_PREVIEW
- Pt_PRINTSEL_CANCEL
The do_preview member of the print context is also set to indicate whether Print or Preview was selected. This means that the context can be passed to the printing function, which will spawn the print-preview application if necessary.
Examples:
See PpPrintStart().
Classification:
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | No |
See also:
PpPrintClose(), PpPrintCreatePC(), PpPrintGetPC(), PpPrintNewPage(), PpPrintOpen(), PpPrintReleasePC(), PpPrintSetPC(), PpPrintStart(), PpPrintStop(), PpPrintWidget()
