.TH wxPrintPreview 3erl "wx 2.2.2.1" "wxWidgets team." "Erlang Module Definition" .SH NAME wxPrintPreview \- Functions for wxPrintPreview class .SH DESCRIPTION .LP Objects of this class manage the print preview process\&. The object is passed a \fIwxPrintout\fR\& object, and the \fIwxPrintPreview\fR\& object itself is passed to a \fIwxPreviewFrame\fR\& object\&. Previewing is started by initializing and showing the preview frame\&. Unlike \fIwxPrinter:print/4\fR\&, flow of control returns to the application immediately after the frame is shown\&. .LP Note: The preview shown is only exact on Windows\&. On other platforms, the \fIwxDC\fR\& used for preview is different from what is used for printing and the results may be significantly different, depending on how is the output created\&. In particular, printing code relying on \fIwxDC:getTextExtent/3\fR\& heavily (for example, \fIwxHtmlEasyPrinting\fR\& and other wxHTML classes do) is affected\&. It is recommended to use native preview functionality on platforms that offer it (macOS, GTK+)\&. .LP See: Overview printing, \fIwxPrinterDC\fR\& (not implemented in wx), \fIwxPrintDialog\fR\&, \fIwxPrintout\fR\&, \fIwxPrinter\fR\&, \fIwxPreviewCanvas\fR\&, \fIwxPreviewControlBar\fR\&, \fIwxPreviewFrame\fR\& .LP wxWidgets docs: wxPrintPreview .SH DATA TYPES .nf \fBwxPrintPreview()\fR\& = wx:wx_object() .br .fi .SH EXPORTS .LP .nf .B new(Printout) -> wxPrintPreview() .br .fi .br .RS .LP Types: .RS 3 Printout = wxPrintout:wxPrintout() .br .RE .RE .LP .nf .B new(Printout, Options :: [Option]) -> wxPrintPreview() .br .fi .br .RS .LP Types: .RS 3 Printout = wxPrintout:wxPrintout() .br Option = .br {printoutForPrinting, wxPrintout:wxPrintout()} | .br {data, wxPrintDialogData:wxPrintDialogData()} .br .RE .RE .RS .LP Constructor\&. .LP Pass a printout object, an optional printout object to be used for actual printing, and the address of an optional block of printer data, which will be copied to the print preview object\&'s print data\&. .LP If \fIprintoutForPrinting\fR\& is non-NULL, a \fI"Print\&.\&.\&."\fR\& button will be placed on the preview frame so that the user can print directly from the preview interface\&. .LP Remark: Do not explicitly delete the printout objects once this constructor has been called, since they will be deleted in the \fIwxPrintPreview\fR\& destructor\&. The same does not apply to the \fIdata\fR\& argument\&. .LP Use \fIisOk/1\fR\& to check whether the \fIwxPrintPreview\fR\& object was created correctly\&. .RE .LP .nf .B new(Printout, PrintoutForPrinting, Data) -> wxPrintPreview() .br .fi .br .RS .LP Types: .RS 3 Printout = PrintoutForPrinting = wxPrintout:wxPrintout() .br Data = wxPrintData:wxPrintData() .br .RE .RE .RS .RE .LP .nf .B destroy(This :: wxPrintPreview()) -> ok .br .fi .br .RS .LP Destructor\&. .LP Deletes both print preview objects, so do not destroy these objects in your application\&. .RE .LP .nf .B getCanvas(This) -> wxPreviewCanvas:wxPreviewCanvas() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Gets the preview window used for displaying the print preview image\&. .RE .LP .nf .B getCurrentPage(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Gets the page currently being previewed\&. .RE .LP .nf .B getFrame(This) -> wxFrame:wxFrame() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Gets the frame used for displaying the print preview canvas and control bar\&. .RE .LP .nf .B getMaxPage(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Returns the maximum page number\&. .RE .LP .nf .B getMinPage(This) -> integer() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Returns the minimum page number\&. .RE .LP .nf .B getPrintout(This) -> wxPrintout:wxPrintout() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Gets the preview printout object associated with the \fIwxPrintPreview\fR\& object\&. .RE .LP .nf .B getPrintoutForPrinting(This) -> wxPrintout:wxPrintout() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Gets the printout object to be used for printing from within the preview interface, or NULL if none exists\&. .RE .LP .nf .B isOk(This) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br .RE .RE .RS .LP Returns true if the \fIwxPrintPreview\fR\& is valid, false otherwise\&. .LP It could return false if there was a problem initializing the printer device context (current printer not set, for example)\&. .RE .LP .nf .B paintPage(This, Canvas, Dc) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br Canvas = wxPreviewCanvas:wxPreviewCanvas() .br Dc = wxDC:wxDC() .br .RE .RE .RS .LP This refreshes the preview window with the preview image\&. .LP It must be called from the preview window\&'s OnPaint member\&. .LP The implementation simply blits the preview bitmap onto the canvas, creating a new preview bitmap if none exists\&. .RE .LP .nf .B print(This, Prompt) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br Prompt = boolean() .br .RE .RE .RS .LP Invokes the print process using the second \fIwxPrintout\fR\& object supplied in the \fIwxPrintPreview\fR\& constructor\&. .LP Will normally be called by the \fIPrint\fR\&\&.\&.\&. panel item on the preview frame\&'s control bar\&. .LP Returns false in case of error - call \fIwxPrinter:getLastError/0\fR\& to get detailed information about the kind of the error\&. .RE .LP .nf .B renderPage(This, PageNum) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br PageNum = integer() .br .RE .RE .RS .LP Renders a page into a \fIwxMemoryDC\fR\&\&. .LP Used internally by \fIwxPrintPreview\fR\&\&. .RE .LP .nf .B setCanvas(This, Window) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br Window = wxPreviewCanvas:wxPreviewCanvas() .br .RE .RE .RS .LP Sets the window to be used for displaying the print preview image\&. .RE .LP .nf .B setCurrentPage(This, PageNum) -> boolean() .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br PageNum = integer() .br .RE .RE .RS .LP Sets the current page to be previewed\&. .RE .LP .nf .B setFrame(This, Frame) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br Frame = wxFrame:wxFrame() .br .RE .RE .RS .LP Sets the frame to be used for displaying the print preview canvas and control bar\&. .RE .LP .nf .B setPrintout(This, Printout) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br Printout = wxPrintout:wxPrintout() .br .RE .RE .RS .LP Associates a printout object with the \fIwxPrintPreview\fR\& object\&. .RE .LP .nf .B setZoom(This, Percent) -> ok .br .fi .br .RS .LP Types: .RS 3 This = wxPrintPreview() .br Percent = integer() .br .RE .RE .RS .LP Sets the percentage preview zoom, and refreshes the preview canvas accordingly\&. .RE