Added support for selecting a printer and it's options. This opens the printer dialog and lets you select a printer, number of copies, collation, page ranges etc etc.

Interface: PrintOptions

Simple Read/Write Properties
Collate boolean - collate copies
Copies integer - number of copies, default 1
FromPage integer - print from this page on, default 1
ToPage integer - stop printing on this page
MinPage integer - set a minimum page number, default 1
MaxPage integer - set a maximum page number. User input is validated against MinPage and MaxPage
PrintToFile boolean - the Print To File checkbox

Complex Read/Write Properties
Options integer - A flags system which is the sum of the following four numbers:
    1 - Show Print To File checkbox
    2 - Allow page number inputs (must have MinPage and MaxPage set)
    4 - Enables the 'Selection' option. This is to print the selected text on the calling program, prob not overly useful in a scripting context.
    8 - Generates a warning message if the user tries to send a job to an uninstalled printer
So setting Options to 5 is option 1 and option 4. Use 15 to enable all, default is 0 (all options disabled)

Read Only Properties
PrintRange integer - Specifies the selected print range. Choice of:
    0 for All Pages (default)
    1 for Pages from FromPage to ToPage
    2 for the 'Selection' option
PrinterName string - returns the name of the selected printer
PrinterIndex integer - returns the position in the list of printers of the selected printer where -1 means no printer selected and 0 is the top printer in the list.

To use in KiX code, it's the same as the other dialogs (scroll up) with the object call changed to
 Code:
$oDialog = CreateObject('cjDialogs.PrintOptions')
and the property calls changed as required.

enjoy,

cj




Attachments
cjDialogs.zip (239 downloads)
Description: v1.03 - added PrintOptions interface