1 \section{\class{wxGenericDirCtrl
}}\label{wxgenericdirctrl
}
3 This control can be used to place a directory listing (with optional files) on an arbitrary window.
5 The control contains a
\helpref{wxTreeCtrl
}{wxtreectrl
} window representing the directory
6 hierarchy, and optionally, a
\helpref{wxChoice
}{wxchoice
} window containing a list of filters.
8 \wxheading{Derived from
}
10 \helpref{wxControl
}{wxcontrol
}\\
11 \helpref{wxWindow
}{wxwindow
}\\
12 \helpref{wxEvtHandler
}{wxevthandler
}\\
13 \helpref{wxObject
}{wxobject
}
15 \wxheading{Include files
}
19 \wxheading{Window styles
}
23 \twocolitem{\indexit{wxDIRCTRL
\_DIR\_ONLY}}{Only show directories, and not files.
}
24 \twocolitem{\indexit{wxDIRCTRL
\_3D\_INTERNAL}}{Use
3D borders for internal controls.
}
25 \twocolitem{\indexit{wxDIRCTRL
\_SELECT\_FIRST}}{When setting the default path, select the first file in the directory.
}
26 \twocolitem{\indexit{wxDIRCTRL
\_SHOW\_FILTERS}}{Show the drop-down filter list.
}
27 \twocolitem{\indexit{wxDIRCTRL
\_EDIT\_LABELS}}{Allow the folder and file labels to be editable.
}
30 See also
\helpref{Generic window styles
}{windowstyles
}.
32 \wxheading{Data structures
}
34 \latexignore{\rtfignore{\wxheading{Members
}}}
36 \membersection{wxGenericDirCtrl::wxGenericDirCtrl
}\label{wxgenericdirctrlwxgenericdirctrl
}
38 \func{}{wxGenericDirCtrl
}{\void}
42 \func{}{wxGenericDirCtrl
}{\param{wxWindow*
}{parent
},
\param{const wxWindowID
}{id = -
1},
43 \param{const wxString\&
}{dir = wxDirDialogDefaultFolderStr
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
44 \param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxDIRCTRL
\_3D\_INTERNAL|wxSUNKEN
\_BORDER},
45 \param{const wxString\&
}{filter = wxEmptyString
},
46 \param{int
}{defaultFilter =
0},
47 \param{const wxString\&
}{name = wxTreeCtrlNameStr
}}
51 \wxheading{Parameters
}
53 \docparam{parent
}{Parent window.
}
55 \docparam{id
}{Window identifier.
}
57 \docparam{dir
}{Initial folder.
}
59 \docparam{pos
}{Position.
}
61 \docparam{size
}{Size.
}
63 \docparam{style
}{Window style. Please see
\helpref{wxGenericDirCtrl
}{wxgenericdirctrl
} for a list of possible styles.
}
65 \docparam{filter
}{A filter string, using the same syntax as that for
\helpref{wxFileDialog
}{wxfiledialog
}. This may be empty if filters
68 Example: ``All files
(*.*)|*.*|JPEG files
(*.jpg)|*.jpg"}
70 \docparam{defaultFilter}{The zero-indexed default filter setting.}
72 \docparam{name}{The window name.}
74 \membersection{wxGenericDirCtrl::\destruct{wxGenericDirCtrl}}\label{wxgenericdirctrldtor}
76 \func{}{\destruct{wxGenericDirCtrl}}{\void}
80 \membersection{wxGenericDirCtrl::Create}\label{wxgenericdirctrlcreate}
82 \func{bool}{Create}{\param{wxWindow* }{parent}, \param{const wxWindowID }{id = -1}, \param{const wxString\& }{dir = wxDirDialogDefaultFolderStr}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxDIRCTRL\_3D\_INTERNAL|wxSUNKEN\_BORDER}, \param{const wxString\& }{filter = wxEmptyString}, \param{int }{defaultFilter = 0}, \param{const wxString\& }{name = wxTreeCtrlNameStr}}
84 Create function for two-step construction. See \helpref{wxGenericDirCtrl::wxGenericDirCtrl}{wxgenericdirctrlwxgenericdirctrl} for details.
86 \membersection{wxGenericDirCtrl::Init}\label{wxgenericdirctrlinit}
88 \func{void}{Init}{\void}
90 Initializes variables.
92 \membersection{wxGenericDirCtrl::CollapseTree}\label{wxgenericdirctrlcollapsetree}
94 \func{void}{CollapseTree}{\void}
96 Collapses the entire tree.
98 \membersection{wxGenericDirCtrl::ExpandPath}\label{wxgenericdirctrlexpandpath}
100 \func{bool}{ExpandPath}{\param{const wxString\& }{path}}
102 Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
104 \membersection{wxGenericDirCtrl::CollapsePath}\label{wxgenericdirctrlcollapsepath}
106 \func{bool}{CollapsePath}{\param{const wxString\& }{path}}
108 Collapse the given path.
110 \membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath}
112 \constfunc{wxString}{GetDefaultPath}{\void}
114 Gets the default path.
116 \membersection{wxGenericDirCtrl::GetPath}\label{wxgenericdirctrlgetpath}
118 \constfunc{wxString}{GetPath}{\void}
120 Gets the currently-selected directory or filename.
122 \membersection{wxGenericDirCtrl::GetFilePath}\label{wxgenericdirctrlgetfilepath}
124 \constfunc{wxString}{GetFilePath}{\void}
126 Gets selected filename path only (else empty string).
128 This function doesn't count a directory as a selection.
130 \membersection{wxGenericDirCtrl::GetFilter}\label{wxgenericdirctrlgetfilter}
132 \constfunc{wxString}{GetFilter}{\void}
134 Returns the filter string.
136 \membersection{wxGenericDirCtrl::GetFilterIndex}\label{wxgenericdirctrlgetfilterindex}
138 \constfunc{int}{GetFilterIndex}{\void}
140 Returns the current filter index (zero-based).
142 \membersection{wxGenericDirCtrl::GetFilterListCtrl}\label{wxgenericdirctrlgetfilterlistctrl}
144 \constfunc{wxDirFilterListCtrl*}{GetFilterListCtrl}{\void}
146 Returns a pointer to the filter list control (if present).
148 \membersection{wxGenericDirCtrl::GetRootId}\label{wxgenericdirctrlgetrootid}
150 \func{wxTreeItemId}{GetRootId}{\void}
152 Returns the root id for the tree control.
154 \membersection{wxGenericDirCtrl::GetTreeCtrl}\label{wxgenericdirctrlgettreectrl}
156 \constfunc{wxTreeCtrl*}{GetTreeCtrl}{\void}
158 Returns a pointer to the tree control.
160 \membersection{wxGenericDirCtrl::ReCreateTree}\label{wxgenericdirctrlrecreatetree}
162 \func{void}{ReCreateTree}{\void}
164 Collapse and expand the tree, thus re-creating it from scratch.
165 May be used to update the displayed directory content.
167 \membersection{wxGenericDirCtrl::SetDefaultPath}\label{wxgenericdirctrlsetdefaultpath}
169 \func{void}{SetDefaultPath}{\param{const wxString\& }{path}}
171 Sets the default path.
173 \membersection{wxGenericDirCtrl::SetFilter}\label{wxgenericdirctrlsetfilter}
175 \func{void}{SetFilter}{\param{const wxString\& }{filter}}
177 Sets the filter string.
179 \membersection{wxGenericDirCtrl::SetFilterIndex}\label{wxgenericdirctrlsetfilterindex}
181 \func{void}{SetFilterIndex}{\param{int }{n}}
183 Sets the current filter index (zero-based).
185 \membersection{wxGenericDirCtrl::SetPath}\label{wxgenericdirctrlsetpath}
187 \func{void}{SetPath}{\param{const wxString\& }{path}}
189 Sets the current path.