1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxGenericDirCtrl class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxGenericDirCtrl
13 This control can be used to place a directory listing (with optional files) on
16 The control contains a wxTreeCtrl window representing the directory
17 hierarchy, and optionally, a wxChoice window containing a list of filters.
21 @appearance{genericdirctrl.png}
23 class wxGenericDirCtrl
: public wxControl
46 Window style. Please see wxGenericDirCtrl for a list of possible styles.
49 A filter string, using the same syntax as that for wxFileDialog. This may be
53 Example: "All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg"
56 The zero-indexed default filter setting.
62 wxGenericDirCtrl(wxWindow
* parent
, const wxWindowID id
= -1,
63 const wxString
& dir
= wxDirDialogDefaultFolderStr
,
64 const wxPoint
& pos
= wxDefaultPosition
,
65 const wxSize
& size
= wxDefaultSize
,
66 long style
= wxDIRCTRL_3D_INTERNAL
|wxBORDER_SUNKEN
,
67 const wxString
& filter
= wxEmptyString
,
68 int defaultFilter
= 0,
69 const wxString
& name
= wxTreeCtrlNameStr
);
78 Collapse the given path.
80 bool CollapsePath(const wxString
& path
);
83 Collapses the entire tree.
88 Create function for two-step construction. See wxGenericDirCtrl() for details.
90 bool Create(wxWindow
* parent
, const wxWindowID id
= -1,
91 const wxString
& dir
= wxDirDialogDefaultFolderStr
,
92 const wxPoint
& pos
= wxDefaultPosition
,
93 const wxSize
& size
= wxDefaultSize
,
94 long style
= wxDIRCTRL_3D_INTERNAL
|wxBORDER_SUNKEN
,
95 const wxString
& filter
= wxEmptyString
,
96 int defaultFilter
= 0,
97 const wxString
& name
= wxTreeCtrlNameStr
);
100 Tries to expand as much of the given path as possible, so that the filename or
101 directory is visible in the tree control.
103 bool ExpandPath(const wxString
& path
);
106 Gets the default path.
108 wxString
GetDefaultPath();
111 Gets selected filename path only (else empty string).
113 This function doesn't count a directory as a selection.
115 wxString
GetFilePath();
118 Returns the filter string.
120 wxString
GetFilter();
123 Returns the current filter index (zero-based).
125 int GetFilterIndex();
128 Returns a pointer to the filter list control (if present).
130 wxDirFilterListCtrl
* GetFilterListCtrl();
133 Gets the currently-selected directory or filename.
138 Returns the root id for the tree control.
140 wxTreeItemId
GetRootId();
143 Returns a pointer to the tree control.
145 wxTreeCtrl
* GetTreeCtrl();
148 Initializes variables.
153 Collapse and expand the tree, thus re-creating it from scratch.
154 May be used to update the displayed directory content.
159 Sets the default path.
161 void SetDefaultPath(const wxString
& path
);
164 Sets the filter string.
166 void SetFilter(const wxString
& filter
);
169 Sets the current filter index (zero-based).
171 void SetFilterIndex(int n
);
174 Sets the current path.
176 void SetPath(const wxString
& path
);
180 If @true, hidden folders and files will be displayed by the
181 control. If @false, they will not be displayed.
183 void ShowHidden(bool show
);