Home AESAES File-selector libraryFile-selector library Editable object functionsEditable object functions

8.5 Print dialogs

The following routines were introduced with MagiC (also WDIALOG), and permit the creation and handling of print dialogs:

pdlg_add_printers Adds application's printers
pdlg_add_sub_dialogs Adds application's sub-dialogs
pdlg_close Close window of a print dialog
pdlg_create Initialise print dialog, allocate memory
pdlg_delete Frees memory
pdlg_dflt_settings Initialise memory region with printer settings
pdlg_do Displays modal dialog
pdlg_evnt Manages events for dialog in window
pdlg_free_settings Frees memory used for printer settings
pdlg_get_setsize Gets size of the structure
pdlg_new_settings Returns pointer to initialized printer settings
pdlg_open Opens selection dialog in window
pdlg_remove_printers Removes application's printers
pdlg_remove_sub_dialogs Removes application's sub-dialogs
pdlg_save_default_settings Saves the default settings
pdlg_update Updates window title
pdlg_use_settings Validates and adopt printer settings
pdlg_validate_settings Validates printer settings

Hint: The presence of this call should be checked for using appl_getinfo (opcode 7).

See also:
Display in a window   Display as modal dialog   AES   GEM   WDIALOG   Style guidelines

8.5.1 pdlg_add_printers

Name: »Print dialog - Add private printers« - Add application's own printer descriptions.
 
Opcode: 205 (sub-opcode 0)
 
Syntax: int16_t pdlg_add_printers ( PRN_DIALOG *prn_dialog, DRV_INFO *drv_info );
 
Description: The call pdlg_add_printer permits adding an application's own printer descriptions to the print dialog. The following apply:
 
Parameter Meaning
   
prn_dialog Pointer to management structure
drv_info Pointer to the list of available printers and rastering processes

Note: The driver's index should be set to 0x7fff, so as to differentiate the custom driver from that of the operating system.
 
Return value: The function returns the value 1 if all went well, else the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.1.1 Bindings for pdlg_add_printers

C: int16_t pdlg_add_printers ( PRN_DIALOG *prn_dialog, DRV_INFO *drv_info );
 
Binding:
 
int16_t pdlg_add_printers ( PRN_DIALOG *prn_dialog,
                            DRV_INFO *drv_info )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = drv_info;
   int_in[0] = 0;

   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] drv_info
int_in int_in[0] 0 # Sub-opcode
int_out int_out[0] Return value

8.5.2 pdlg_add_sub_dialogs

Name: »Print dialog - Add private dialogs« - Add sub-dialogs to the printer dialog.
 
Opcode: 205 (sub-opcode 3)
 
Syntax: int16_t pdlg_add_sub_dialogs ( PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialog );
 
Description: The call pdlg_add_sub_dialogs permits adding an application's own sub-dialogs to the printer dialog. The following apply:
 

Parameter Meaning
prn_dialog Pointer to management structure
sub_dialog List of sub-dialogs

This function could be useful to add custom print options such as markers, watermarks or background images, for instance.
 
Return value: The function returns the value 1 if all went well, else the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.2.1 Bindings for pdlg_add_sub_dialogs

C: int16_t pdlg_add_sub_dialogs ( PRN_DIALOG *prn_dialog, PDLG_SUB *sub_dialog );
 
Binding:
 
int16_t pdlg_add_sub_dialogs ( PRN_DIALOG *prn_dialog,
                               PDLG_SUB *sub_dialog )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = sub_dialog;
   int_in[0] = 3;

   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] sub_dialog
int_in int_in[0] 3 # Sub-opcode
int_out int_out[0] Return value

8.5.3 pdlg_close

Name: »Print dialog - Close window« - Close print dialog.
 
Opcode: 203
 
Syntax: int16_t pdlg_close ( PRN_DIALOG *prn_dialog, int16_t *x, int16_t *y );
 
Description: The call pdlg_close closes the window of the print dialog. The following apply:
 

Parameter Meaning
prn_dialog Pointer to management structure
x X-coordinate of the window
y Y-coordinate of the window

The parameters x and y are those of the last position of the print dialog.
 
Return value: The function always returns the value 1.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.3.1 Bindings for pdlg_close

C: int16_t pdlg_close ( PRN_DIALOG *prn_dialog, int16_t *x, int16_t *y );
 
Binding:
 
int16_t pdlg_close ( PRN_DIALOG *prn_dialog, int16_t *x,
                     int16_t *y )
{
   int_out[1] = -1;
   int_out[2] = -1;

   addr_in[0] = prn_dialog;
   crys_if (203);

   *x = int_out[1];
   *y = int_out[2];

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 203 # Function opcode
control+2 control[1] 0 # Entry in int_in
control+4 control[2] 3 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
int_out int_out[0] Return value
int_out+2 int_out[1] x
int_out+4 int_out[2] y

8.5.4 pdlg_create

Name: »Print dialog - Create« - Initialize the print dialog.
 
Opcode: 200
 
Syntax: PRN_DIALOG *pdlg_create ( int16_t dialog_flags );
 
Description: The call pdlg_create initializes the print dialog and allocates memory for it. The following apply:
 
Parameter Meaning
   
dialog_flags Diverse flags:
PDLG_3D (1) = Display selection in 3D-look

On calling the function a scan will be made for the printer drivers present and memory will be allocated for the resource.
 
Return value: The function returns a pointer to a PRN_DIALOG structure.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.4.1 Bindings for pdlg_create

C: PRN_DIALOG *pdlg_create ( int16_t dialog_flags );
 
Binding:
 
PRN_DIALOG *pdlg_create ( int16_t dialog_flags )
{
   int_in[0] = dialog_flags;
   crys_if (200);

   return ( addr_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 200 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 0 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 1 # Entry in addr_out
int_in int_in[0] dialog_flags
addr_out addr_out[0] Return value

8.5.5 pdlg_delete

Name: »Print dialog - Delete« - Release the memory of the print dialog.
 
Opcode: 201
 
Syntax: int16_t pdlg_delete ( PRN_DIALOG *prn_dialog );
 
Description: The call pdlg_delete frees the memory used for the print dialog. The following applies:
 

Parameter Meaning
prn_dialog Pointer to management structure
Return value: The function always returns the value 1.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.5.1 Bindings for pdlg_delete

C: int16_t pdlg_delete ( PRN_DIALOG *prn_dialog );
 
Binding:
 
int16_t pdlg_delete ( PRN_DIALOG *prn_dialog )
{
   addr_in[0] = prn_dialog;
   crys_if (201);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 201 # Function opcode
control+2 control[1] 0 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
int_out int_out[0] Return value

8.5.6 pdlg_dflt_settings

Name: »Print dialog - Default settings« - Default initialization.
 
Opcode: 205 (sub-opcode 7)
 
Syntax: int16_t pdlg_dflt_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Description: The call pdlg_dflt_settings takes on the initialization of the default printer settings in memory. The following apply:
 

Parameter Meaning
prn_dialog Pointer to management structure
settings Printer settings

Structure length from PRN_SETTINGS can be found with pdlg_get_setsize.
 
Return value: The function always returns the value 1.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.6.1 Bindings for pdlg_dflt_settings

C: int16_t pdlg_dflt_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Binding:
 
int16_t pdlg_dflt_settings ( PRN_DIALOG *prn_dialog,
                             PRN_SETTINGS *settings )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = settings;

   int_in[0] = 7;
   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] settings
int_in int_in[0] 7 # Sub-opcode
int_out int_out[0] Return value

8.5.7 pdlg_do

Name: »Print dialog - Do« - Open a print dialog.
 
Opcode: 207
 
Syntax: int16_t pdlg_do ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags );
 
Description: The call pdlg_do opens a modal print dialog. The following apply:
 
Parameter Meaning
   
prn_dialog Pointer to management structure
settings Printer settings
document_name Document name
option_flags Diverse flags:
0x0000 = Display settings dialog
0x0001 = Display print dialog
0x0010 = Always offer No. of copies
0x0020 = Always offer landscape format
0x0040 = Always offer scaling
0x0100 = Offer option for even and odd pages

The function only returns to the caller when one of the exit buttons has been activated ('Cancel', 'OK').
 
Return value: The function returns the value of the selected button (1 = Cancel, 2 = OK), or the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.7.1 Bindings for pdlg_do

C: int16_t pdlg_do ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags );
 
Binding:
 
int16_t pdlg_do ( PRN_DIALOG *prn_dialog,
                  PRN_SETTINGS *settings,
                  int8_t *document_name,
                  int16_t option_flags )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = settings;
   addr_in[2] = document_name;

   int_in[0] = option_flags;
   crys_if (207);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 207 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 3 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] settings
addr_in+8 addr_in[2] document_name
int_in int_in[0] option_flags
int_out int_out[0] Return value

8.5.8 pdlg_evnt

Name: »Print dialog - Handle event« - Event processing of the print dialog.
 
Opcode: 206
 
Syntax: int16_t pdlg_evnt ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, int16_t *button );
 
Description: The call pdlg_evnt takes on the event management for a print dialog. The following apply:
 

Parameter Meaning
prn_dialog Pointer to management structure
settings Printer settings
events Pointer to EVNT structure
button Selected button (or 0)
  PDLG_CANCEL (1) = Cancel
  PDLG_OK (2)     = OK

The funcfunc evaluat and internally calls wdlg_evnt. If the dialog was confirmed, then the new printer settings are returned in settings.
 
Return value: The function returns the value 0 if one of the EXIT buttons was clicked on, else the value 1.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.8.1 Bindings for pdlg_evnt

C: int16_t pdlg_evnt ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, EVNT *events, int16_t *button );
 
Binding:
 
int16_t pdlg_evnt ( PRN_DIALOG *prn_dialog,
                    PRN_SETTINGS *settings,
                    EVNT *events, int16_t *button )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = settings;
   addr_in[2] = events;

   crys_if (206);

   *button = int_out[1];
   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 206 # Function opcode
control+2 control[1] 0 # Entry in int_in
control+4 control[2] 2 # Entry in int_out
control+6 control[3] 3 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] settings
addr_in+8 addr_in[2] events
int_out int_out[0] Return value
int_out+2 int_out[1] button

8.5.9 pdlg_free_settings

Name: »Print dialog - Free settings« - Release memory.
 
Opcode: 205 (sub-opcode 6)
 
Syntax: int16_t pdlg_free_settings ( PRN_SETTINGS *settings );
 
Description: The call pdlg_free_setting frees the memory that was reserved by the call pdlg_new_settings. The following applies:
 

Parameter Meaning
settings Printer settings
Return value: The function returns the value 1 if all went well, else the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.9.1 Bindings for pdlg_free_settings

C: int16_t pdlg_free_settings ( PRN_SETTINGS *settings );
 
Binding:
 
int16_t pdlg_free_settings ( PRN_SETTINGS *settings )
{
   addr_in[0] = settings;
   int_in[0] = 6;
   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] settings
int_in int_in[0] 6 # Sub-opcode
int_out int_out[0] Return value

8.5.10 pdlg_get_setsize

Name: »Print dialog - Get setting structure size« - Obtain the length of the PRN_SETTINGS structure.
 
Opcode: 204 (sub-opcode 0)
 
Syntax: int32_t pdlg_get_setsize ( void );
 
Description: The call pdlg_get_setsize returns the length of the PRN_SETTINGS structure.
 
Return value: The function returns the length of the structure in bytes.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.10.1 Bindings for pdlg_get_setsize

C: int32_t pdlg_get_setsize ( void );
 
Binding:
 
int32_t pdlg_get_setsize ( void )
{
   int_in[0] = 0;
   crys_if (204);

   return ( int_out[0..1] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 204 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 2 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] 0 # Sub-opcode
int_out int_out[0..1] Return value

8.5.11 pdlg_new_settings

Name: »Print dialog - New default settings« - Set default printer settings.
 
Opcode: 205 (sub-opcode 5)
 
Syntax: PRN_SETTINGS *pdlg_new_settings ( PRN_DIALOG *prn_dialog );
 
Description: The call pdlg_new_settings returns a pointer to the initialized printer settings. The following applies:
 

Parameter Meaning
prn_dialog Pointer to management structure
Return value: The function returns a pointer to a PRN_SETTINGS structure in which the current printer settings are stored.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.11.1 Bindings for pdlg_new_settings

C: PRN_SETTINGS *pdlg_new_settings ( PRN_DIALOG *prn_dialog );
 
Binding:
 
PRN_SETTINGS *pdlg_new_settings ( PRN_DIALOG *prn_dialog )
{
   addr_in[0] = prn_dialog;
   int_in[0] = 5;
   crys_if (205);

   return ( addr_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 0 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 1 # Entry in addr_out
addr_in addr_in[0] prn_dialog
int_in int_in[0] 5 # Sub-opcode
addr_out addr_out[0] Return value

8.5.12 pdlg_open

Name: »Print Dialog - Open Window« - Druckdialog im Fenster öffnen.
 
Opcode: 202
 
Syntax: int16_t pdlg_open ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags, int16_t x, int16_t y );
 
Description: The call pdlg_open opens a window with the print dialog. The following apply:
 
Parameter Meaning
   
prn_dialog Pointer to management structure
settings Printer settings
document_name Document name
option_flags Diverse flags:
0x0000 = Display settings dialog
0x0001 = Display print dialog
0x0010 = Always offer No. of copies
0x0020 = lways offer landscape format
0x0040 = Always offer scaling
0x0100 = Offer option for even and odd pages
x X-coordinates of the window, or -1 (centred)
y Y-coordinates of the window, or -1 (centred)

Note: The structure settings contains the printer setting that should be saved with each document. If no setting exists yet for a document, it can either be created with pdlg_new_settings, or the application can call Malloc and subsequently pdlg_dflt_settings to initialize the memory.
 
In the parameter option_flags one can decide, amongst others, whether the dialog should be displayed as a settings or a print dialog. With further flags one can also determine whether scaling, copy options and landscape printing should be offered even if a driver does not support them, so that the application has to output the page rotated, for instance.
 
Return value: The function returns the ID of the created window, or the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.12.1 Bindings for pdlg_open

C: int16_t pdlg_open ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings, int8_t *document_name, int16_t option_flags, int16_t x, int16_t y );
 
Binding:
 
int16_t pdlg_open ( PRN_DIALOG *prn_dialog,
                    PRN_SETTINGS *settings,
                    int8_t *document_name,
                    int16_t option_flags,
                    int16_t x, int16_t y)
{
   addr_in[0] = prn_dialog;
   addr_in[1] = settings;
   addr_in[2] = document_name;

   int_in[0] = option_flags;
   int_in[1] = x;
   int_in[2] = y;
   crys_if (202);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 202 # Function opcode
control+2 control[1] 3 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 3 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] settings
addr_in+8 addr_in[2] document_name
int_in int_in[0] option_flags
int_in+2 int_in[1] x
int_in+4 int_in[2] y
int_out int_out[0] Return value

8.5.13 pdlg_remove_printers

Name: »Print dialog - Remove private printers« - Remove application's printers from the list.
 
Opcode: 205 (sub-opcode 1)
 
Syntax: int16_t pdlg_remove_printers ( PRN_DIALOG *prn_dialog );
 
Description: The call pdlg_remove_printers removes the application's printers registered with pdlg_add_printers. The following applies:
 

Parameter Meaning
prn_dialog Pointer to management structure

The function must be called before pdlg_delete.
 
Return value: The function always returns the value 1.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.13.1 Bindings for pdlg_remove_printers

C: int16_t pdlg_remove_printers ( PRN_DIALOG *prn_dialog );
 
Binding:
 
int16_t pdlg_remove_printers ( PRN_DIALOG *prn_dialog )
{
   addr_in[0] = prn_dialog_dialog;
   int_in[0] = 1;
   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
int_in int_in[0] 1 # Sub-opcode
int_out int_out[0] Return value

8.5.14 pdlg_remove_sub_dialogs

Name: »Print dialog - Remove private dialogs« - Remove sub-dialogs from the print dialog.
 
Opcode: 205 (sub-opcode 4)
 
Syntax: int16_t pdlg_remove_sub_dialogs ( PRN_DIALOG *prn_dialog );
 
Description: The call pdlg_remove_sub_dialogs removes the application's own sub-dialogs from the print dialog. The following applies:
 

Parameter Meaning
prn_dialog Pointer to management structure
Return value: The function always returns the value 1.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.14.1 Bindings for pdlg_remove_sub_dialogs

C: int16_t pdlg_remove_sub_dialogs ( PRN_DIALOG *prn_dialog );
 
Binding:
 
int16_t pdlg_remove_sub_dialogs ( PRN_DIALOG *prn_dialog )
{
   addr_in[0] = prn_dialog;
   int_in[0] = 4;
   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
int_in int_in[0] 4 # Sub-opcode
int_out int_out[0] Return value

8.5.15 pdlg_save_default_settings

Name: »Print dialog - Save default settings«
 
Opcode: 205 (sub-opcode 10)
 
Syntax: int16_t pdlg_save_default_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Description: The call pdlg_save_default_settings saves the default printer settings that were set with pdlg_new_settings. The following apply:
 

Parameter Meaning
prn_dialog Pointer to management structure
settings Pointer to printer settings
Return value: The function returns the value 1 if all went well, else the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.15.1 Bindings for pdlg_save_default_settings

C: int16_t pdlg_save_default_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Binding:
 
int16_t pdlg_save_default_settings ( PRN_DIALOG *prn_dialog,
                                     PRN_SETTINGS *settings )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = settings;

   int_in[0] = 10;

   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] settings
int_in int_in[0] 10 # Sub-opcode
int_out int_out[0] Return value

8.5.16 pdlg_update

Name: »Print Dialog - Update Window« - neuen Fensternamen setzen.
 
Opcode: 205 (sub-opcode 2)
 
Syntax: int16_t pdlg_update ( PRN_DIALOG *prn_dialog, int8_t *document_name );
 
Description: »Print dialog - Update window« - Set new window title.
 

Parameter Meaning
prn_dialog Pointer to management structure
document_name New document name

Note: The function should be called if a window-dialog is lying in the background and the user tops a new document window (brings it to the front).
 
Return value: The function returns the value 1 if it operates correctly, else the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.16.1 Bindings for pdlg_update

C: int16_t pdlg_update ( PRN_DIALOG *prn_dialog, int8_t *document_name );
 
Binding:
 
int16_t pdlg_update ( PRN_DIALOG *prn_dialog,
                      int8_t *document_name )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = 0;              /* Reserved (must be 0!) */
   addr_in[2] = document_name;

   int_in[0] = 2;
   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 3 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] 0
addr_in+8 addr_in[2] document_name
int_in int_in[0] 2 # Sub-opcode
int_out int_out[0] Return value

8.5.17 pdlg_use_settings

Name: »Print dialog - Use settings« - Use validated settings.
 
Opcode: 205 (sub-opcode 9)
 
Syntax: int16_t pdlg_use_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Description: The call pdlg_use_settings serves to validate the printer settings that were set with pdlg_new_settings before adopting them for use. The following apply:
 

Parameter Meaning
prn_dialog Pointer to management structure
settings Printer settings

This function should be called if a program wants to print immediately and it is not possible to call pdlg_do or pdlg_open and pdlg_evnt (e.g. Calamus print dialogs). The passed printer settings will be validated (and saved for old drivers).
 
Return value: The function returns the value 1 if it operates correctly, else the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.17.1 Bindings for pdlg_use_settings

C: int16_t pdlg_use_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Binding:
 
int16_t pdlg_use_settings ( PRN_DIALOG *prn_dialog,
                            PRN_SETTINGS *settings )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = settings;

   int_in[0] = 9;
   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] settings
int_in int_in[0] 9 # Sub-opcode
int_out int_out[0] Return value

8.5.18 pdlg_validate_settings

Name: »Print dialog - Validate settings« - Validates the printer settings.
 
Opcode: 205 (sub-opcode 8)
 
Syntax: int16_t pdlg_validate_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Description: The call pdlg_validate_settings validates the printer settings that were set with pdlg_new_settings. The following apply:
 

Parameter Meaning
prn_dialog Pointer to management structure
settings Printer settings

Note: Faulty structure contents will be corrected by the function if necessary.
 
Return value: The function returns the value 1 if it operates correctly, else the value 0 in case of error.
 
Availability: The presence of this function can be checked with appl_getinfo (opcode 7).
 
Group: Print dialogs
 
See also: Binding   WDIALOG
 

8.5.18.1 Bindings for pdlg_validate_settings

C: int16_t pdlg_validate_settings ( PRN_DIALOG *prn_dialog, PRN_SETTINGS *settings );
 
Binding:
 
int16_t pdlg_validate_settings ( PRN_DIALOG *prn_dialog,
                                 PRN_SETTINGS *settings )
{
   addr_in[0] = prn_dialog;
   addr_in[1] = settings;

   int_in[0] = 8;
   crys_if (205);

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 205 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
addr_in addr_in[0] prn_dialog
addr_in+4 addr_in[1] settings
int_in int_in[0] 8 # Sub-opcode
int_out int_out[0] Return value

8.5.19 Print selection in a window

Program start:  
. pdlg_create()
.  
Calling the print dialog: pdlg_open()
.  
Event loop: pdlg_evnt()
.  
Closing of the print dialog: pdlg_close()
.  
. pdlg_delete()
Program end:  

8.5.20 Print selection as a dialog

Program start:  
. pdlg_create()
.  
Calling the print dialog: pdlg_do()
.  
. pdlg_delete()
Program end:  

Home AESAES File-selector libraryFile-selector library Editable object functionsEditable object functions