wxGenericDirCtrl (wx v2.5.4)

Copy Markdown View Source

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:

  • wxDIRCTRL_DIR_ONLY: Only show directories, and not files.

  • wxDIRCTRL_3D_INTERNAL: Use 3D borders for internal controls. This is the default.

  • wxDIRCTRL_SELECT_FIRST: When setting the default path, select the first file in the directory.

  • wxDIRCTRL_SHOW_FILTERS: Show the drop-down filter list.

  • wxDIRCTRL_EDIT_LABELS: Allow the folder and file labels to be editable.

  • wxDIRCTRL_MULTIPLE: Allows multiple files and folders to be selected.

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

wxWidgets docs: wxGenericDirCtrl

Events

Event types emitted from this class:

Summary

Functions

Collapses the entire tree.

Create function for two-step construction.

Destroys the object

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

wxGenericDirCtrl()

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

Functions

collapseTree(This :: wxGenericDirCtrl()) -> ok

Collapses the entire tree.

create(This, Parent) ≡ create(This, Parent, [])

create/3

-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.

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

Destroys the object

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

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

getDefaultPath(This :: wxGenericDirCtrl()) -> unicode:charlist()

Gets the default path.

getFilePath(This :: wxGenericDirCtrl()) -> unicode:charlist()

Gets selected filename path only (else empty string).

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

getFilter(This :: wxGenericDirCtrl()) -> unicode:charlist()

Returns the filter string.

getFilterIndex(This :: wxGenericDirCtrl()) -> integer()

Returns the current filter index (zero-based).

getPath(This :: wxGenericDirCtrl()) -> unicode:charlist()

Gets the currently-selected directory or filename.

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

Gets the path corresponding to the given tree control item.

Since: 2.9.5

getRootId(This :: wxGenericDirCtrl()) -> integer()

Returns the root id for the tree control.

getTreeCtrl(This :: wxGenericDirCtrl()) -> Result

Types

Result = wxTreeCtrl:wxTreeCtrl()

Returns a pointer to the tree control.

init(This :: wxGenericDirCtrl()) -> ok

Initializes variables.

new() -> wxGenericDirCtrl()

Default constructor.

new(Parent) ≡ new(Parent, [])

new/2

-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.

reCreateTree(This :: wxGenericDirCtrl()) -> ok

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

May be used to update the displayed directory content.

setDefaultPath(This :: wxGenericDirCtrl(), Path :: unicode:chardata()) -> ok

Sets the default path.

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

Sets the filter string.

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

Sets the current filter index (zero-based).

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

Sets the current path.