wxPrintPreview(3erl)
π
wxPrintPreview(3erl) β Erlang Module Definition π
okay so bestie, this is the manual page for wxPrintPreview, and it lowkey has main character energy. Let's go π
β¨ NAME β¨
wxPrintPreview β Functions for wxPrintPreview class.
π DESCRIPTION π
Okay so objects of this class manage the print preview process. The object is passed a wxPrintout object, and the wxPrintPreview object itself is passed to a wxPreviewFrame object. Previewing is started by initializing and showing the preview frame. Unlike wxPrinter:print/4, flow of control returns to the application immediately after the frame is shown.
β οΈ Note: The preview shown is only exact on Windows. On other platforms, thewxDCused for preview is different from what is used for printing and the results may be significantly different, depending on how the output is created. In particular, printing code relying onwxDC:getTextExtent/3heavily (for example,wxHtmlEasyPrintingand otherwxHTMLclasses do) is affected. It is recommended to use native preview functionality on platforms that offer it (macOS,GTK+).
See: Overview printing, wxPrinterDC (not implemented in wx), wxPrintDialog, wxPrintout, wxPrinter, wxPreviewCanvas, wxPreviewControlBar, wxPreviewFrame.
wxWidgets docs: wxPrintPreview.
π¦ DATA TYPES π¦
The one and only type alias, no cap:
wxPrintPreview() = wx:wx_object()
π EXPORTS π
Every export is here, bestie β no skipping, periodt.
new(Printout) -> wxPrintPreview()β Types:Printout = wxPrintout:wxPrintout(). No extra prose in the original, just the type, iykyk.new(Printout, Options :: [Option]) -> wxPrintPreview()β Types first:
Printout = wxPrintout:wxPrintout()
Option =
{printoutForPrinting, wxPrintout:wxPrintout()} |
{data, wxPrintDialogData:wxPrintDialogData()}
Constructor. 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.
If printoutForPrinting is non-NULL, a "Print..." button will be placed on the preview frame so that the user can print directly from the preview interface.
Remark: Do not explicitly delete the printout objects once this constructor has been called, since they will be deleted in thewxPrintPreviewdestructor. The same does not apply to thedataargument.
Use isOk/1 to check whether the wxPrintPreview object was created correctly.
new(Printout, PrintoutForPrinting, Data) -> wxPrintPreview()β Types only again, bestie:
Printout = PrintoutForPrinting = wxPrintout:wxPrintout()
Data = wxPrintData:wxPrintData()
destroy(This :: wxPrintPreview()) -> okβ Types:This = wxPrintPreview(). Destructor. Deletes both print preview objects, so do not destroy these objects in your application.getCanvas(This) -> wxPreviewCanvas:wxPreviewCanvas()β Types:This = wxPrintPreview(). Gets the preview window used for displaying the print preview image.getCurrentPage(This) -> integer()β Types:This = wxPrintPreview(). Gets the page currently being previewed.getFrame(This) -> wxFrame:wxFrame()β Types:This = wxPrintPreview(). Gets the frame used for displaying the print preview canvas and control bar.getMaxPage(This) -> integer()β Types:This = wxPrintPreview(). Returns the maximum page number.getMinPage(This) -> integer()β Types:This = wxPrintPreview(). Returns the minimum page number.getPrintout(This) -> wxPrintout:wxPrintout()β Types:This = wxPrintPreview(). Gets the preview printout object associated with thewxPrintPreviewobject.getPrintoutForPrinting(This) -> wxPrintout:wxPrintout()β Types:This = wxPrintPreview(). Gets the printout object to be used for printing from within the preview interface, orNULLif none exists.isOk(This) -> boolean()β Types:This = wxPrintPreview(). Returnstrueif thewxPrintPreviewis valid,falseotherwise.
It could return false if there was a problem initializing the printer device context (current printer not set, for example).
paintPage(This, Canvas, Dc) -> boolean()β Types:This = wxPrintPreview(),Canvas = wxPreviewCanvas:wxPreviewCanvas(),Dc = wxDC:wxDC(). This refreshes the preview window with the preview image.
It must be called from the preview window's OnPaint member.
The implementation simply blits the preview bitmap onto the canvas, creating a new preview bitmap if none exists.
print(This, Prompt) -> boolean()β Types:This = wxPrintPreview(),Prompt = boolean(). Invokes the print process using the secondwxPrintoutobject supplied in thewxPrintPreviewconstructor.
Will normally be called by the Print... panel item on the preview frame's control bar.
Returns false in case of error - call wxPrinter:getLastError/0 to get detailed information about the kind of the error.
renderPage(This, PageNum) -> boolean()β Types:This = wxPrintPreview(),PageNum = integer(). Renders a page into awxMemoryDC.
Used internally by wxPrintPreview.
setCanvas(This, Window) -> okβ Types:This = wxPrintPreview(),Window = wxPreviewCanvas:wxPreviewCanvas(). Sets the window to be used for displaying the print preview image.setCurrentPage(This, PageNum) -> boolean()β Types:This = wxPrintPreview(),PageNum = integer(). Sets the current page to be previewed.setFrame(This, Frame) -> okβ Types:This = wxPrintPreview(),Frame = wxFrame:wxFrame(). Sets the frame to be used for displaying the print preview canvas and control bar.setPrintout(This, Printout) -> okβ Types:This = wxPrintPreview(),Printout = wxPrintout:wxPrintout(). Associates a printout object with thewxPrintPreviewobject.setZoom(This, Percent) -> okβ Types:This = wxPrintPreview(),Percent = integer(). Sets the percentage preview zoom, and refreshes the preview canvas accordingly.
signed, sealed, and delivered by the wxWidgets team π β version wx 2.2.2.1, and the footer/date stamp says wxPrintPreview(3erl). Stay iconic, bestie π
β¨
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms