wxPageSetupDialog(3)

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

πŸ’– wxPageSetupDialog πŸ’–

okay bestie, so you know how every app has that one "print setup" window where you pick your paper size and whether it's portrait or landscape? yeah. that's this. it's the wxPageSetupDialog class from the Erlang wx module β€” the page setup common dialog. iconic behavior, honestly. let's get into it πŸŽ€


✨ NAME ✨

wxPageSetupDialog β€” literally the page setup common dialog class. that's it, that's the vibe. πŸ¦‹


✨ DESCRIPTION ✨

so the page setup dialog has controls for paper size (think letter, A4, A5, etc.), orientation (landscape or portrait), and β€” only under Windows currently β€” controls for setting left, top, right and bottom margin sizes in millimetres. πŸ’…

the exact appearance of this dialog varies among the platforms, because a native dialog is used when available (which, rn, is the case for all major platforms). so don't come for me if it looks different on your machine, it's giving ✨platform native✨.

once the dialog has been closed, you need to query the wxPageSetupDialogData object associated with the dialog. like, the dialog doesn't hand you the answers, you gotta go ask its data object. periodt.

🚨 no cap: the OK and Cancel buttons do not destroy the dialog. this must be done by the application. so if you're out here clicking OK and expecting things to clean themselves up β€” nope. that's on you, bestie.

See also (the required reading):

  • Overview printing
  • wxPrintDialog
  • wxPageSetupDialogData

and the wxWidgets docs, for the crossover episode: wxPageSetupDialog πŸ“š


✨ DATA TYPES ✨

  • wxPageSetupDialog() :: wx:wx_object().

that's the whole type. it's a wx:wx_object(). short, sweet, mysterious. main character energy. πŸ‘‘


✨ FUNCTIONS ✨

πŸ’« destroy(This :: wxPageSetupDialog()) -> ok.

destroys the object. bye bestie πŸ’€βœ¨

πŸ’« getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData() when This :: wxPageSetupDialog().

returns the wxPageSetupDialogData object associated with the dialog. this is the one you call after the dialog closes, remember? the data lives here. go get it. 🫢

πŸ’« new(Parent, [Option]) -> wxPageSetupDialog()

new(Parent, [Option]) -> wxPageSetupDialog()
    when
        Parent :: wxWindow:wxWindow(),
        Option ::
            {data,
             wxPageSetupDialogData:wxPageSetupDialogData()}.

the constructor, obviously. 🌸

pass a parent window, and optionally a pointer to a block of page setup data β€” which will be copied to the print dialog's internal data. so it's a copy situation, not a sharing situation. noted. πŸ“

πŸ’« showModal(This) -> integer() when This :: wxPageSetupDialog().

shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL otherwise. two outcomes, two vibes. that's the whole plot. πŸ”₯


and that's the page!! go forth and pick your paper size, you absolute legend πŸ’œ

Ericsson AB, wx 2.6 β€” catch you on the next manpage, bestie πŸŽ€πŸŒˆβ­

πŸ“¦ where this page comes from