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.
| DIRCTRL_DIR_ONLY | Only show directories, and not files. |
| DIRCTRL_3D_INTERNAL | Use 3D borders for internal controls. |
| DIRCTRL_SELECT_FIRST | When setting the default path, select the first file in the directory. |
| DIRCTRL_SHOW_FILTERS | Show the drop-down filter list. |
| DIRCTRL_EDIT_LABELS | Allow the folder and file labels to be editable. |
See also Generic window styles.
GenericDirCtrl.new(Window parent, Integer id = -1,
String dir = DirDialogDefaultFolderStr,
Point pos = DEFAULT_POSITION,
Size size = DEFAULT_SIZE,
Integer style = DIRCTRL_3D_INTERNAL|SUNKEN_BORDER,
String filter = '',
Integer defaultFilter = 0,
String name = TreeCtrlNameStr)
Main constructor.
destructor()
Destructor.
Boolean *create(Window parent, Integer id = -1,
String dir = DirDialogDefaultFolderStr,
Point pos = DEFAULT_POSITION,
Size size = DEFAULT_SIZE,
Integer style = DIRCTRL_3D_INTERNAL|SUNKEN_BORDER,
String filter = '',
Integer defaultFilter = 0,
String name = TreeCtrlNameStr)
Create function for two-step construction. See GenericDirCtrl.new for details.
init()
Initializes variables.
collapse_tree()
Collapses the entire tree.
Boolean expand_path(String path)
Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
Boolean collapse_path(String path)
Collapse the given path.
String get_default_path()
Gets the default path.
String get_path()
Gets the currently-selected directory or filename.
String get_file_path()
Gets selected filename path only (else empty string).
This function doesn’t count a directory as a selection.
String get_filter()
Returns the filter string.
Integer get_filter_index()
Returns the current filter index (zero-based).
DirFilterListCtrl get_filter_list_ctrl()
Returns the filter list control (if present).
TreeItemId get_root_id()
Returns the root id for the tree control.
TreeCtrl get_tree_ctrl()
Returns the TreeCtrl used to display the items in the tree. Normal TreeCtrl methods may be used on this tree. The text for each item is the name of the corresponding directory or file. The data (which can be retrieved by calling get_item_data) for each item is a String containing the full path of the directory or file.
re_create_tree()
Collapse and expand the tree, thus re-creating it from scratch. May be used to update the displayed directory content.
set_default_path(String path)
Sets the default path.
set_filter(String filter)
Sets the filter string.
set_filter_index(Integer n)
Sets the current filter index (zero-based).
set_path(String path)
Sets the current path.
show_hidden(Boolean show)
[This page automatically generated from the Textile source at Fri Feb 27 23:38:58 +0000 2009]