wxPrintDialog(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

✨ NAME ✨

wxPrintDialog β€” okay so this is the class that represents the print and print setup common dialogs. That's it, that's the whole name line, bestie. πŸ’…


🌸 DESCRIPTION 🌸

So here's the tea: you can get yourself a wxPrinterDC device context (which is not implemented in wx, jsyk) out of a print dialog that was successfully dismissed. Slay. πŸŽ€

See also, because you're gonna wanna wander:

  • Overview printing
  • Overview cmndlg

This class is derived from the following, and can use their functions too β€” it's giving nepo baby but make it inheritance πŸ‘‘:

  • wxDialog
  • wxTopLevelWindow
  • wxWindow
  • wxEvtHandler

Also, for the record: wxWidgets docs: wxPrintDialog. πŸ’–


πŸ¦‹ DATA TYPES πŸ¦‹

wxPrintDialog() :: wx:wx_object().

🫢 FUNCTIONS 🫢

destroy/1

destroy(This :: wxPrintDialog()) -> ok.

Destroys the object. That's the whole vibe. πŸ’€

getPrintDC/1

getPrintDC(This) -> wxDC:wxDC() when This :: wxPrintDialog().

Returns the device context that the print dialog created, if any β€” like, it might not exist, so don't come for me. 🀷

⚠️ Real talk: once you've called this function, the ownership of that device context is transferred to the application. So you have to delete it explicitly yourself. No takebacks, no cleanup fairy, it's on you. 🧚

getPrintDialogData/1

getPrintDialogData(This) -> wxPrintDialogData:wxPrintDialogData()
                            when This :: wxPrintDialog().

Returns the print dialog data that's associated with the print dialog. Lowkey straightforward. ✨

new/2

Two whole ways to call this one, and the manpage gives you zero prose, so here's the shape of it, exactly as written:

new(Parent, [Option]) -> wxPrintDialog()
            when
                Parent :: wxWindow:wxWindow(),
                Option :: {data, wxPrintDialogData:wxPrintDialogData()};
        (Parent, Data) -> wxPrintDialog()
            when
                Parent :: wxWindow:wxWindow(),
                Data :: wxPrintData:wxPrintData().

Note the plot twist: the first clause takes an option tuple tagged data holding a wxPrintDialogData:wxPrintDialogData(), and the second clause takes a Data that is a wxPrintData:wxPrintData(). Two different types, two different clauses, iconic behavior honestly. 🌈


And that's the whole page! Mwah. πŸ’‹

This lil manual page came to you from Ericsson AB, for wx 2.6, and it's the wxPrintDialog(3) page. Go print something, main character. πŸ–¨οΈπŸ‘‘

πŸ“¦ where this page comes from