wxStdDialogButtonSizer(3)

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

πŸ’… wxStdDialogButtonSizer β€” an Erlang module, bestie

okay so this is a page from the Erlang module docs (manual name wxStdDialogButtonSizer(3), in case you were wondering) and it's lowkey one of the most satisfying little widgets in wx. buckle up πŸŽ€

✨ NAME ✨

wxStdDialogButtonSizer β€” this class creates button layouts which conform to the standard button spacing and ordering defined by the platform or toolkit's user interface guidelines (if such things exist). yes, if such things exist. iconic hedging. πŸ‘‘


🌸 DESCRIPTION 🌸

By using this class, you can ensure that all your standard dialogs look correct on all major platforms. Currently it conforms to the Windows, GTK+ and macOS human interface guidelines. three whole platforms, no cap. πŸ¦‹

When there aren't interface guidelines defined for a particular platform or toolkit, wxStdDialogButtonSizer reverts to the Windows implementation. (windows is the default friend who always shows up lol.)

To use this class, first add buttons to the sizer by calling addButton/2 (or setAffirmativeButton/2, setNegativeButton/2 or setCancelButton/2) and then call Realize in order to create the actual button layout used. Other than these special operations, this sizer works like any other sizer. so it's just a sizer with main character energy, fr fr. ✨

If you add a button with wxID_SAVE, on macOS the button will be renamed to "Save" and the wxID_NO button will be renamed to "Don't Save" in accordance with the macOS Human Interface Guidelines. apple said "we'll handle the vibes" πŸ“

See:

  • wxSizer
  • Overview sizer
  • wxDialog:createButtonSizer/2

This class is derived, and can use functions, from:

  • wxBoxSizer
  • wxSizer

wxWidgets docs: wxStdDialogButtonSizer


πŸ’– DATA TYPES πŸ’–

  • wxStdDialogButtonSizer() :: wx:wx_object().

πŸ”₯ FUNCTIONS πŸ”₯

addButton(This, Button) -> ok

addButton(This, Button) -> ok
                   when
                       This :: wxStdDialogButtonSizer(),
                       Button :: wxButton:wxButton().

Adds a button to the wxStdDialogButtonSizer. πŸ’«

The button must have one of the following identifiers:

  • wxID_OK
  • wxID_YES
  • wxID_SAVE
  • wxID_APPLY
  • wxID_CLOSE
  • wxID_NO
  • wxID_CANCEL
  • wxID_HELP
  • wxID_CONTEXT_HELP
bestie. it says must. pick from the list or this whole thing falls apart, and not in a cute way. 🫢

destroy(This :: wxStdDialogButtonSizer()) -> ok

Destroys the object. bye queen πŸ¦‹

new() -> wxStdDialogButtonSizer()

Constructor for a wxStdDialogButtonSizer. fresh out the box, brand new ✨

realize(This) -> ok when This :: wxStdDialogButtonSizer()

Rearranges the buttons and applies proper spacing between buttons to make them match the platform or toolkit's interface guidelines. this is the glow-up step, the final touch-up before the reveal πŸ’…

setAffirmativeButton(This, Button) -> ok

setAffirmativeButton(This, Button) -> ok
                              when
                                  This :: wxStdDialogButtonSizer(),
                                  Button :: wxButton:wxButton().

Sets the affirmative button for the sizer. πŸ’–

This allows you to use identifiers other than the standard identifiers outlined above. so you're not locked into the wxID_* list, you can do your own thing πŸŽ€

setCancelButton(This, Button) -> ok

setCancelButton(This, Button) -> ok
                         when
                             This :: wxStdDialogButtonSizer(),
                             Button :: wxButton:wxButton().

Sets the cancel button for the sizer. πŸ›‘

This allows you to use identifiers other than the standard identifiers outlined above. same deal, custom IDs welcome 🌈

setNegativeButton(This, Button) -> ok

setNegativeButton(This, Button) -> ok
                           when
                               This :: wxStdDialogButtonSizer(),
                               Button :: wxButton:wxButton().

Sets the negative button for the sizer. no thanks, but make it ✨aesthetic✨

This allows you to use identifiers other than the standard identifiers outlined above. yes bestie, freedom 🧚


ok that's the whole page, we consumed it, we understood it, we slayed πŸ’œ

and per the footer: this came from the wx manual, version 2.6, brought to you by Ericsson AB, dated as the page wxStdDialogButtonSizer(3) says so. mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from