phoenix_title wx.GenericDirCtrl

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

The control contains a wx.TreeCtrl window representing the directory hierarchy, and optionally, a wx.Choice window containing a list of filters.

styles Window Styles

This class supports the following styles:

  • wx.DIRCTRL_DIR_ONLY: Only show directories, and not files.

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

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

  • wx.DIRCTRL_SHOW_FILTERS: Show the drop-down filter list.

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

  • wx.DIRCTRL_MULTIPLE: Allows multiple files and folders to be selected.

events Events Emitted by this Class

Event macros for events emitted by this class:

  • EVT_DIRCTRL_SELECTIONCHANGED: Selected directory has changed. Processes a wxEVT_DIRCTRL_SELECTIONCHANGED event type. Notice that this event is generated even for the changes done by the program itself and not only those done by the user. Available since wxWidgets 2.9.5.

  • EVT_DIRCTRL_FILEACTIVATED: The user activated a file by double-clicking or pressing Enter. Available since wxWidgets 2.9.5.


class_hierarchy Class Hierarchy

Inheritance diagram for class GenericDirCtrl:

appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


method_summary Methods Summary

__init__

Default constructor.

CollapsePath

Collapse the given path.

CollapseTree

Collapses the entire tree.

Create

Create function for two-step construction.

ExpandPath

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

GetClassDefaultAttributes

GetDefaultPath

Gets the default path.

GetFilePath

Gets selected filename path only (else empty string).

GetFilePaths

Fills the array paths with the currently selected filepaths.

GetFilter

Returns the filter string.

GetFilterIndex

Returns the current filter index (zero-based).

GetFilterListCtrl

Returns a pointer to the filter list control (if present).

GetPath

Gets the currently-selected directory or filename.

GetPaths

Returns a list of the currently selected paths.

GetRootId

Returns the root id for the tree control.

GetTreeCtrl

Returns a pointer to the tree control.

Init

Initializes variables.

ReCreateTree

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

SelectPath

Selects the given item.

SelectPaths

Selects only the specified paths, clearing any previous selection.

SetDefaultPath

Sets the default path.

SetFilter

Sets the filter string.

SetFilterIndex

Sets the current filter index (zero-based).

SetPath

Sets the current path.

ShowHidden

UnselectAll

Removes the selection from all currently selected items.


property_summary Properties Summary

DefaultPath

See GetDefaultPath and SetDefaultPath

FilePath

See GetFilePath

Filter

See GetFilter and SetFilter

FilterIndex

See GetFilterIndex and SetFilterIndex

FilterListCtrl

See GetFilterListCtrl

Path

See GetPath and SetPath

Paths

See GetPaths

RootId

See GetRootId

TreeCtrl

See GetTreeCtrl


api Class API

class wx.GenericDirCtrl(Control)

Possible constructors:

GenericDirCtrl() -> None

GenericDirCtrl(parent, id=ID_ANY, dir=DirDialogDefaultFolderStr,
               pos=DefaultPosition, size=DefaultSize, style=DIRCTRL_DEFAULT_STYLE,
               filter='',