wxDirDialog(3)

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

πŸ’– wxDirDialog πŸ’–

okay bestie, so this one lives in the Erlang Module Definition world under wx 2.6, and it's the whole vibe of a directory chooser dialog ✨


🌸 NAME 🌸

wxDirDialog β€” this class is literally the directory chooser dialog, that's it, that's the whole personality πŸŽ€


✨ DESCRIPTION ✨

πŸ’… Styles πŸ’…

the tea is that this class supports these styles, and you need to know all of them:

  • wxDD_DEFAULT_STYLE β€” equivalent to a combo of wxDEFAULT_DIALOG_STYLE and wxRESIZE_BORDER, so it's giving both at once 🫢
  • wxDD_DIR_MUST_EXIST β€” the dialog will only let the user pick a folder that already exists. when this style is not given, a "Create new directory" button gets added to the dialog (on Windows) or some other way is provided for the user to type in the name of a new folder πŸ†•
  • wxDD_CHANGE_DIR β€” changes the current working directory to whatever directory the user chose. no cap.
⚠️ note: this flag cannot be used with the wxDD_MULTIPLE style. periodt.
  • wxDD_MULTIPLE β€” lets the user select multiple directories. this flag is only available since wxWidgets 3.1.4 πŸ“…
  • wxDD_SHOW_HIDDEN β€” shows hidden and system folders. this flag is only available since wxWidgets 3.1.4 πŸ“…

notice that wxRESIZE_BORDER has a special side effect under Windows, where two different directory selection dialogs are available, and this style also implicitly selects the new version, since the old one always has fixed size. as the new version is almost always preferable, it is recommended that wxRESIZE_BORDER style be always used. this is the case if the dialog is created with the default style value, but if you need to use any additional styles you should still specify wxDD_DEFAULT_STYLE unless you explicitly need to use the old dialog version under Windows. E.g. do instead of just using wxDD_DIR_MUST_EXIST style alone. πŸ’€

Remark: MacOS 10.11+ does not display a title bar on the dialog. use setMessage/2 to change the string displayed to the user at the top of the dialog after creation. the wxTopLevelWindow:setTitle/2 method is provided for compatibility with pre-10.11 MacOS versions that do still support displaying the title bar 🍎

See:

  • Overview cmndlg
  • wxFileDialog

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

  • wxDialog
  • wxTopLevelWindow
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxDirDialog 🌈


πŸ¦‹ DATA TYPES πŸ¦‹

wxDirDialog() :: wx:wx_object().

πŸ”₯ FUNCTIONS πŸ”₯

  • destroy(This :: wxDirDialog()) -> ok β€” destroys the object. bye bestie πŸ’€βœ¨
  • getMessage(This) -> unicode:charlist() when This :: wxDirDialog() β€” returns the message that will be displayed on the dialog πŸ’¬
  • getPath(This) -> unicode:charlist() when This :: wxDirDialog() β€” returns the default or user-selected path πŸ“
⚠️ Note: this function can't be used with dialogs which have the wxDD_MULTIPLE style, use GetPaths() (not implemented in wx) instead. iykyk.
  • new(Parent, [Option]) -> wxDirDialog()
when
    Parent :: wxWindow:wxWindow(),
    Option ::
        {title, unicode:chardata()} |
        {defaultPath, unicode:chardata()} |
        {style, integer()} |
        {pos, {X :: integer(), Y :: integer()}} |
        {sz, {W :: integer(), H :: integer()}}.

constructor ✨ use wxDialog:showModal/1 to actually show the dialog, that's the main character moment πŸ‘‘

  • setMessage(This, Message) -> ok
when
    This :: wxDirDialog(),
    Message :: unicode:chardata().

sets the message that will be displayed on the dialog πŸ’¬

  • setPath(This, Path) -> ok
when This :: wxDirDialog(), Path :: unicode:chardata().

sets the default path πŸ›€οΈ


and that's the whole page, bestie 🫢 this lil icon was brought to you by Ericsson AB, running wx 2.6, and the page itself is wxDirDialog(3) β€” slay, ate, no crumbs left, periodt πŸ’…πŸŽ€πŸ’–

πŸ“¦ where this page comes from