2000-10-10 06:50:27 -04:00
|
|
|
\section{\class{wxGenericDirCtrl}}\label{wxgenericdirctrl}
|
|
|
|
|
|
|
|
This control can be used to place a directory listing (with optional files) on an arbitrary window.
|
|
|
|
|
|
|
|
The control contains a \helpref{wxTreeCtrl}{wxtreectrl} window representing the directory
|
|
|
|
hierarchy, and optionally, a \helpref{wxChoice}{wxchoice} window containing a list of filters.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxControl}{wxcontrol}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/dirctrl.h>
|
|
|
|
|
|
|
|
\wxheading{Window styles}
|
|
|
|
|
2004-02-21 20:16:32 -05:00
|
|
|
\twocolwidtha{7cm}
|
2000-10-10 06:50:27 -04:00
|
|
|
\begin{twocollist}
|
2000-12-22 08:33:14 -05:00
|
|
|
\twocolitem{\indexit{wxDIRCTRL\_DIR\_ONLY}}{Only show directories, and not files.}
|
|
|
|
\twocolitem{\indexit{wxDIRCTRL\_3D\_INTERNAL}}{Use 3D borders for internal controls.}
|
|
|
|
\twocolitem{\indexit{wxDIRCTRL\_SELECT\_FIRST}}{When setting the default path, select the first file in the directory.}
|
|
|
|
\twocolitem{\indexit{wxDIRCTRL\_SHOW\_FILTERS}}{Show the drop-down filter list.}
|
2002-04-10 05:35:36 -04:00
|
|
|
\twocolitem{\indexit{wxDIRCTRL\_EDIT\_LABELS}}{Allow the folder and file labels to be editable.}
|
2000-10-10 06:50:27 -04:00
|
|
|
\end{twocollist}
|
|
|
|
|
|
|
|
See also \helpref{Generic window styles}{windowstyles}.
|
|
|
|
|
|
|
|
\wxheading{Data structures}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::wxGenericDirCtrl}\label{wxgenericdirctrlwxgenericdirctrl}
|
|
|
|
|
|
|
|
\func{}{wxGenericDirCtrl}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
|
|
|
\func{}{wxGenericDirCtrl}{\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}}
|
|
|
|
|
|
|
|
Main constructor.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{Parent window.}
|
|
|
|
|
|
|
|
\docparam{id}{Window identifier.}
|
|
|
|
|
|
|
|
\docparam{dir}{Initial folder.}
|
|
|
|
|
|
|
|
\docparam{pos}{Position.}
|
|
|
|
|
|
|
|
\docparam{size}{Size.}
|
|
|
|
|
2000-10-10 07:11:36 -04:00
|
|
|
\docparam{style}{Window style. Please see \helpref{wxGenericDirCtrl}{wxgenericdirctrl} for a list of possible styles.}
|
2000-10-10 06:50:27 -04:00
|
|
|
|
|
|
|
\docparam{filter}{A filter string, using the same syntax as that for \helpref{wxFileDialog}{wxfiledialog}. This may be empty if filters
|
|
|
|
are not being used.
|
|
|
|
|
|
|
|
Example: ``All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg"}
|
|
|
|
|
|
|
|
\docparam{defaultFilter}{The zero-indexed default filter setting.}
|
|
|
|
|
|
|
|
\docparam{name}{The window name.}
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::\destruct{wxGenericDirCtrl}}\label{wxgenericdirctrldtor}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxGenericDirCtrl}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::Create}\label{wxgenericdirctrlcreate}
|
|
|
|
|
|
|
|
\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}}
|
|
|
|
|
|
|
|
Create function for two-step construction. See \helpref{wxGenericDirCtrl::wxGenericDirCtrl}{wxgenericdirctrlwxgenericdirctrl} for details.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::Init}\label{wxgenericdirctrlinit}
|
|
|
|
|
|
|
|
\func{void}{Init}{\void}
|
|
|
|
|
|
|
|
Initializes variables.
|
|
|
|
|
2005-03-31 14:04:03 -05:00
|
|
|
\membersection{wxGenericDirCtrl::CollapseTree}\label{wxgenericdirctrlcollapsetree}
|
|
|
|
|
|
|
|
\func{void}{CollapseTree}{\void}
|
|
|
|
|
|
|
|
Collapses the entire tree.
|
|
|
|
|
2000-10-10 06:50:27 -04:00
|
|
|
\membersection{wxGenericDirCtrl::ExpandPath}\label{wxgenericdirctrlexpandpath}
|
|
|
|
|
|
|
|
\func{bool}{ExpandPath}{\param{const wxString\& }{path}}
|
|
|
|
|
|
|
|
Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
|
|
|
|
|
2006-05-28 19:54:28 -04:00
|
|
|
\membersection{wxGenericDirCtrl::CollapsePath}\label{wxgenericdirctrlcollapsepath}
|
|
|
|
|
|
|
|
\func{bool}{CollapsePath}{\param{const wxString\& }{path}}
|
|
|
|
|
|
|
|
Collapse the given path.
|
|
|
|
|
2000-10-10 06:50:27 -04:00
|
|
|
\membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetDefaultPath}{\void}
|
|
|
|
|
|
|
|
Gets the default path.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::GetPath}\label{wxgenericdirctrlgetpath}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetPath}{\void}
|
|
|
|
|
|
|
|
Gets the currently-selected directory or filename.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::GetFilePath}\label{wxgenericdirctrlgetfilepath}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetFilePath}{\void}
|
|
|
|
|
|
|
|
Gets selected filename path only (else empty string).
|
|
|
|
|
2002-06-07 16:15:28 -04:00
|
|
|
This function doesn't count a directory as a selection.
|
2000-10-10 06:50:27 -04:00
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::GetFilter}\label{wxgenericdirctrlgetfilter}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetFilter}{\void}
|
|
|
|
|
|
|
|
Returns the filter string.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::GetFilterIndex}\label{wxgenericdirctrlgetfilterindex}
|
|
|
|
|
|
|
|
\constfunc{int}{GetFilterIndex}{\void}
|
|
|
|
|
|
|
|
Returns the current filter index (zero-based).
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::GetFilterListCtrl}\label{wxgenericdirctrlgetfilterlistctrl}
|
|
|
|
|
|
|
|
\constfunc{wxDirFilterListCtrl*}{GetFilterListCtrl}{\void}
|
|
|
|
|
|
|
|
Returns a pointer to the filter list control (if present).
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::GetRootId}\label{wxgenericdirctrlgetrootid}
|
|
|
|
|
|
|
|
\func{wxTreeItemId}{GetRootId}{\void}
|
|
|
|
|
|
|
|
Returns the root id for the tree control.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::GetTreeCtrl}\label{wxgenericdirctrlgettreectrl}
|
|
|
|
|
|
|
|
\constfunc{wxTreeCtrl*}{GetTreeCtrl}{\void}
|
|
|
|
|
|
|
|
Returns a pointer to the tree control.
|
|
|
|
|
2005-03-31 14:04:03 -05:00
|
|
|
\membersection{wxGenericDirCtrl::ReCreateTree}\label{wxgenericdirctrlrecreatetree}
|
|
|
|
|
|
|
|
\func{void}{ReCreateTree}{\void}
|
|
|
|
|
|
|
|
Collapse and expand the tree, thus re-creating it from scratch.
|
|
|
|
May be used to update the displayed directory content.
|
|
|
|
|
2000-10-10 06:50:27 -04:00
|
|
|
\membersection{wxGenericDirCtrl::SetDefaultPath}\label{wxgenericdirctrlsetdefaultpath}
|
|
|
|
|
|
|
|
\func{void}{SetDefaultPath}{\param{const wxString\& }{path}}
|
|
|
|
|
|
|
|
Sets the default path.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::SetFilter}\label{wxgenericdirctrlsetfilter}
|
|
|
|
|
|
|
|
\func{void}{SetFilter}{\param{const wxString\& }{filter}}
|
|
|
|
|
|
|
|
Sets the filter string.
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::SetFilterIndex}\label{wxgenericdirctrlsetfilterindex}
|
|
|
|
|
|
|
|
\func{void}{SetFilterIndex}{\param{int }{n}}
|
|
|
|
|
|
|
|
Sets the current filter index (zero-based).
|
|
|
|
|
|
|
|
\membersection{wxGenericDirCtrl::SetPath}\label{wxgenericdirctrlsetpath}
|
|
|
|
|
|
|
|
\func{void}{SetPath}{\param{const wxString\& }{path}}
|
|
|
|
|
|
|
|
Sets the current path.
|
|
|
|
|
2006-12-24 07:38:38 -05:00
|
|
|
\membersection{wxGenericDirCtrl::ShowHidden}\label{wxgenericdirctrlShowHidden}
|
|
|
|
|
|
|
|
\func{void}{ShowHidden}{\param{bool }{show}}
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{show}{If true, hidden folders and files will be displayed by the
|
|
|
|
control. If false, they will not be displayed.}
|
|
|
|
|