View Source wxGenericDirCtrl (wx v2.4.2)

Functions for wxGenericDirCtrl class

This control can be used to place a directory listing (with optional files) on an arbitrary window.

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

Styles

This class supports the following styles:

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

Summary

Functions

Collapses the entire tree.

Create function for two-step construction.

Destructor.

Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.

Gets the default path.

Gets selected filename path only (else empty string).

Returns the filter string.

Returns the current filter index (zero-based).

Gets the currently-selected directory or filename.

Gets the path corresponding to the given tree control item.

Returns the root id for the tree control.

Returns a pointer to the tree control.

Initializes variables.

Default constructor.

Main constructor.

Collapse and expand the tree, thus re-creating it from scratch.

Sets the default path.

Sets the filter string.

Sets the current filter index (zero-based).

Sets the current path.

Types

-type wxGenericDirCtrl() :: wx:wx_object().

Functions

-spec collapseTree(This) -> ok when This :: wxGenericDirCtrl().

Collapses the entire tree.

-spec create(This, Parent) -> boolean() when This :: wxGenericDirCtrl(), Parent :: wxWindow:wxWindow().
-spec create(This, Parent, [Option]) -> boolean()
          when
              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()}.

Create function for two-step construction.

See new/2 for details.

-spec destroy(This :: wxGenericDirCtrl()) -> ok.

Destructor.

-spec expandPath(This, Path) -> boolean() when This :: wxGenericDirCtrl(), Path :: unicode:chardata().

Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.

-spec getDefaultPath(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Gets the default path.

-spec getFilePath(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Gets selected filename path only (else empty string).

This function doesn't count a directory as a selection.

-spec getFilter(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Returns the filter string.

-spec getFilterIndex(This) -> integer() when This :: wxGenericDirCtrl().

Returns the current filter index (zero-based).

-spec getPath(This) -> unicode:charlist() when This :: wxGenericDirCtrl().

Gets the currently-selected directory or filename.

-spec getPath(This, ItemId) -> unicode:charlist() when This :: wxGenericDirCtrl(), ItemId :: integer().

Gets the path corresponding to the given tree control item.

Since: 2.9.5

-spec getRootId(This) -> integer() when This :: wxGenericDirCtrl().

Returns the root id for the tree control.

-spec getTreeCtrl(This) -> wxTreeCtrl:wxTreeCtrl() when This :: wxGenericDirCtrl().

Returns a pointer to the tree control.

-spec init(This) -> ok when This :: wxGenericDirCtrl().

Initializes variables.

-spec new() -> wxGenericDirCtrl().

Default constructor.

-spec new(Parent) -> wxGenericDirCtrl() when Parent :: wxWindow:wxWindow().
-spec new(Parent, [Option]) -> wxGenericDirCtrl()
       when
           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()}.

Main constructor.

-spec reCreateTree(This) -> ok when This :: wxGenericDirCtrl().

Collapse and expand the tree, thus re-creating it from scratch.

May be used to update the displayed directory content.

Link to this function

setDefaultPath(This, Path)

View Source
-spec setDefaultPath(This, Path) -> ok when This :: wxGenericDirCtrl(), Path :: unicode:chardata().

Sets the default path.

-spec setFilter(This, Filter) -> ok when This :: wxGenericDirCtrl(), Filter :: unicode:chardata().

Sets the filter string.

-spec setFilterIndex(This, N) -> ok when This :: wxGenericDirCtrl(), N :: integer().

Sets the current filter index (zero-based).

-spec setPath(This, Path) -> ok when This :: wxGenericDirCtrl(), Path :: unicode:chardata().

Sets the current path.