This control can be used to place a directory listing (with optional files) on an arbitrary window.
The control contains a TreeCtrl window representing the directory hierarchy, and optionally, a Choice window containing a list of filters.
This class supports the following styles:
__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. |
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 | Fills the array paths with the selected directories and filenames. |
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. |
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 |
RootId | See GetRootId |
TreeCtrl | See GetTreeCtrl |
This control can be used to place a directory listing (with optional files) on an arbitrary window.
Possible constructors:
GenericDirCtrl()
GenericDirCtrl(parent, id=ID_ANY, dir=DirDialogDefaultFolderStr,
pos=DefaultPosition, size=DefaultSize, style=DIRCTRL_3D_INTERNAL,
filter='', defaultFilter=0, name=TreeCtrlNameStr)
Overloaded Implementations:
__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, dir=DirDialogDefaultFolderStr, pos=DefaultPosition, size=DefaultSize, style=DIRCTRL_3D_INTERNAL, filter=’‘, defaultFilter=0, name=TreeCtrlNameStr)
Main constructor.
Parameters: |
|
---|
Collapse the given path.
Parameters: | path (string) – |
---|---|
Return type: | bool |
Collapses the entire tree.
Create function for two-step construction.
See GenericDirCtrl for details.
Parameters: | |
---|---|
Return type: | bool |
Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
Parameters: | path (string) – |
---|---|
Return type: | bool |
Gets the default path.
Return type: | string |
---|
Gets selected filename path only (else empty string).
This function doesn’t count a directory as a selection.
Return type: | string |
---|
Fills the array paths with the currently selected filepaths.
This function doesn’t count a directory as a selection.
Parameters: | paths (list of strings) – |
---|
Returns the filter string.
Return type: | string |
---|
Returns the current filter index (zero-based).
Return type: | int |
---|
Returns a pointer to the filter list control (if present).
Return type: | DirFilterListCtrl |
---|
Gets the currently-selected directory or filename.
Return type: | string |
---|
Fills the array paths with the selected directories and filenames.
Parameters: | paths (list of strings) – |
---|
Returns the root id for the tree control.
Return type: | TreeItemId |
---|
Initializes variables.
Collapse and expand the tree, thus re-creating it from scratch.
May be used to update the displayed directory content.
Selects the given item.
In multiple selection controls, can be also used to deselect a currently selected item if the value of select is False. Existing selections are not changed. Only visible items can be (de)selected, otherwise use ExpandPath .
Parameters: |
|
---|
Selects only the specified paths, clearing any previous selection.
Only supported when DIRCTRL_MULTIPLE is set.
Parameters: | paths (list of strings) – |
---|
Sets the default path.
Parameters: | path (string) – |
---|
Sets the filter string.
Parameters: | filter (string) – |
---|
Sets the current filter index (zero-based).
Parameters: | n (int) – |
---|
Sets the current path.
Parameters: | path (string) – |
---|
Parameters: | show (bool) – If True, hidden folders and files will be displayed by the control. If False, they will not be displayed. |
---|
Removes the selection from all currently selected items.
See GetDefaultPath and SetDefaultPath
See GetFilePath
See GetFilterIndex and SetFilterIndex
See GetTreeCtrl