|
Synopsis
|
Parameters
Parameters |
Description |
modulName |
Module in which the panel to be printed is located |
panelName |
panel to be printed |
spec |
Default = "" and means print with child panels (is printed like a screenshot), "panelOnly" = prints the panel without child panels (without screenshot of the child panels). |
options |
With the options parameter the available printing options can be defined. Following constants (values) are available:
The background options dialog is used to define wether the background color should be replaced with white or should not be changed. |
Return value
The function printPanel() returns 0 or in the event of errors, -1. |
Description
The function printPanel() prints out a panel panelName in a module modulName. |
|
The associated data point elements of the internal _Ui data point are:
|
EXAMPLE In the following example, the available printers are first queried with the function getPrinterNames(). A panel will be printed on an available printer. The printer settings are selected through the internal UI data point. Instead of a dpSet() a dpSetWait() should be used, as otherwise the UI may not get the new hotlink in case of a new printPanel() call and the old/previous values are taken over from the DP. |
main() { dyn_string name, share; getPrinterNames(name, share);
/* Function to query the names of the available printers */ DebugN(name); DebugN(share); /*use a printer that is saved in this variable */
int PDruck;
/* Set the printer settings. The settings of the UI data point with the number 4, are set. The panel is printed on the third available printer. The landscape format is not used, the background is white and scaling is not used */
dpSetWait("_Ui_4.Print.PrinterName:_original.._value", share[3], "_Ui_4.Print.Landscape", FALSE, "_Ui_4.Print.Background", FALSE, "_Ui_4.Print.Scale", 0, "_Ui_4.Print.FitToPage", FALSE);
string modulName = myModuleName(); /* the current module is used*/ string panelName = "print_panel"; /* A panel called "print_panel" is printed */ int options = PPO_NO_DIALOGS; //No dialog is used PDruck = printPanel(modulName,panelName,"panelOnly", options); /* The panel "print_panel" in the current module, is printed, the print settings window is not shown */ DebugN("Function successful if value=0",PDruck ); } |
The following example shows how to print a panel using the printer settings window. A panel called "print_panel" will be printed in the current module.
Example The following example prints the current panel in the current module on the default printer without special options.
Example Prints a panel from the panel topology (with naviModule, mainModule and infoModule).
|
Member of
Graphics |
Availability
UI |
See also
V 3.11 SP1
Copyright ETM professional control GmbH 2013 All Rights Reserved