wxGenericDirCtrl(3erl)

πŸ’– NAME πŸ’–

wxGenericDirCtrl(3erl) β€” Functions for wxGenericDirCtrl class. This is the Erlang Module Definition manual, bestie, and we're folding that header info right in here like a lil name tag πŸŽ€.

✨ DESCRIPTION ✨

Okay so picture this: wxGenericDirCtrl is a control that lets you place a directory listing (with optional files) on an arbitrary window. Literally main character energy for file trees.

The control contains a wxTreeCtrl window representing the directory hierarchy, and optionally, a wxChoice window containing a list of filters. Iconic.

🌸 Styles 🌸

This class supports the following styles:

  • The original says this class supports the following styles: and then gives us no bullets, so there is no styles list to enumerate, bestie 🫠

This class is derived (and can use functions) from: wxControl wxWindow wxEvtHandler. πŸ’…

wxWidgets docs: wxGenericDirCtrl.

πŸ”₯ EVENTS πŸ”₯

Event types emitted from this class: dirctrl_selectionchanged, dirctrl_fileactivated. That's the whole vibe check.

πŸ¦‹ DATA TYPES πŸ¦‹

wxGenericDirCtrl() = wx:wx_object()

πŸ‘‘ EXPORTS πŸ‘‘

Here's every export, no cap. All signatures and types kept exactly as the original, because we do not mess with the facts πŸ’–

  • new() -> wxGenericDirCtrl() β€” default constructor. Fresh control just dropped.
  • new(Parent) -> wxGenericDirCtrl() β€” types only, bestie:
Parent = wxWindow:wxWindow()
  • new(Parent, Options :: [Option]) -> wxGenericDirCtrl() β€” main constructor. Here's the whole type situation:
Parent = wxWindow:wxWindow()
Option =
    {id, integer()} |
    {dir, unicode:chardata()} |
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()} |
    {filter, unicode:chardata()} |
    {defaultFilter, integer()}
  • destroy(This :: wxGenericDirCtrl()) -> ok β€” destructor. Bye bestie.
  • create(This, Parent) -> boolean() β€” types:
This = wxGenericDirCtrl()
Parent = wxWindow:wxWindow()
  • create(This, Parent, Options :: [Option]) -> boolean() β€” create function for two-step construction. See new/2 for details. Types:
This = wxGenericDirCtrl()
Parent = wxWindow:wxWindow()
Option =
    {id, integer()} |
    {dir, unicode:chardata()} |
    {pos, {X :: integer(), Y :: integer()}} |
    {size, {W :: integer(), H :: integer()}} |
    {style, integer()} |
    {filter, unicode:chardata()} |
    {defaultFilter, integer()}
  • init(This) -> ok β€” initializes variables.
This = wxGenericDirCtrl()
  • collapseTree(This) -> ok β€” collapses the entire tree.
This = wxGenericDirCtrl()
  • expandPath(This, Path) -> boolean() β€” tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
This = wxGenericDirCtrl()
Path = unicode:chardata()
  • getDefaultPath(This) -> unicode:charlist() β€” gets the default path.
This = wxGenericDirCtrl()
  • getPath(This) -> unicode:charlist() β€” gets the currently-selected directory or filename.
This = wxGenericDirCtrl()
  • getPath(This, ItemId) -> unicode:charlist() β€” gets the path corresponding to the given tree control item. Since: 2.9.5.
This = wxGenericDirCtrl()
ItemId = integer()
  • getFilePath(This) -> unicode:charlist() β€” gets selected filename path only (else empty string). This function doesn't count a directory as a selection.
This = wxGenericDirCtrl()
  • getFilter(This) -> unicode:charlist() β€” returns the filter string.
This = wxGenericDirCtrl()
  • getFilterIndex(This) -> integer() β€” returns the current filter index (zero-based).
This = wxGenericDirCtrl()
  • getRootId(This) -> integer() β€” returns the root id for the tree control.
This = wxGenericDirCtrl()
  • getTreeCtrl(This) -> wxTreeCtrl:wxTreeCtrl() β€” returns a pointer to the tree control.
This = wxGenericDirCtrl()
  • reCreateTree(This) -> ok β€” collapse and expand the tree, thus re-creating it from scratch. May be used to update the displayed directory content.
This = wxGenericDirCtrl()
  • setDefaultPath(This, Path) -> ok β€” sets the default path.
This = wxGenericDirCtrl()
Path = unicode:chardata()
  • setFilter(This, Filter) -> ok β€” sets the filter string.
This = wxGenericDirCtrl()
Filter = unicode:chardata()
  • setFilterIndex(This, N) -> ok β€” sets the current filter index (zero-based).
This = wxGenericDirCtrl()
N = integer()
  • setPath(This, Path) -> ok β€” sets the current path.
This = wxGenericDirCtrl()
Path = unicode:chardata()

πŸ’– cute sign-off: shoutout to the wxWidgets team for this page, version wx 2.2.2.1 β€” and the footer date is literally MIA, so no date to report, bestie πŸŽ€

πŸ“¦ where this page comes from