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
\_EDIT\_LABELS}}{Allow the folder and file labels to be editable.
}
29 See also
\helpref{Generic window styles
}{windowstyles
}.
31 \wxheading{Data structures
}
33 \latexignore{\rtfignore{\wxheading{Members
}}}
35 \membersection{wxGenericDirCtrl::wxGenericDirCtrl
}\label{wxgenericdirctrlwxgenericdirctrl
}
37 \func{}{wxGenericDirCtrl
}{\void}
41 \func{}{wxGenericDirCtrl
}{\param{wxWindow*
}{parent
},
\param{const wxWindowID
}{id = -
1},
42 \param{const wxString\&
}{dir = wxDirDialogDefaultFolderStr
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
43 \param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{style = wxDIRCTRL
\_3D\_INTERNAL|wxBORDER
\_SUNKEN},
44 \param{const wxString\&
}{filter = wxEmptyString
},
45 \param{int
}{defaultFilter =
0},
46 \param{const wxString\&
}{name = wxTreeCtrlNameStr
}}
50 \wxheading{Parameters
}
52 \docparam{parent
}{Parent window.
}
54 \docparam{id
}{Window identifier.
}
56 \docparam{dir
}{Initial folder.
}
58 \docparam{pos
}{Position.
}
60 \docparam{size
}{Size.
}
62 \docparam{style
}{Window style. Please see
\helpref{wxGenericDirCtrl
}{wxgenericdirctrl
} for a list of possible styles.
}
64 \docparam{filter
}{A filter string, using the same syntax as that for
\helpref{wxFileDialog
}{wxfiledialog
}. This may be empty if filters
67 Example: ``All files
(*.*)|*.*|JPEG files
(*.jpg)|*.jpg"}
69 \docparam{defaultFilter}{The zero-indexed default filter setting.}
71 \docparam{name}{The window name.}
73 \membersection{wxGenericDirCtrl::\destruct{wxGenericDirCtrl}}\label{wxgenericdirctrldtor}
75 \func{}{\destruct{wxGenericDirCtrl}}{\void}
79 \membersection{wxGenericDirCtrl::Create}\label{wxgenericdirctrlcreate}
81 \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|wxBORDER\_SUNKEN}, \param{const wxString\& }{filter = wxEmptyString}, \param{int }{defaultFilter = 0}, \param{const wxString\& }{name = wxTreeCtrlNameStr}}
83 Create function for two-step construction. See \helpref{wxGenericDirCtrl::wxGenericDirCtrl}{wxgenericdirctrlwxgenericdirctrl} for details.
85 \membersection{wxGenericDirCtrl::Init}\label{wxgenericdirctrlinit}
87 \func{void}{Init}{\void}
89 Initializes variables.
91 \membersection{wxGenericDirCtrl::CollapseTree}\label{wxgenericdirctrlcollapsetree}
93 \func{void}{CollapseTree}{\void}
95 Collapses the entire tree.
97 \membersection{wxGenericDirCtrl::ExpandPath}\label{wxgenericdirctrlexpandpath}
99 \func{bool}{ExpandPath}{\param{const wxString\& }{path}}
101 Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
103 \membersection{wxGenericDirCtrl::CollapsePath}\label{wxgenericdirctrlcollapsepath}
105 \func{bool}{CollapsePath}{\param{const wxString\& }{path}}
107 Collapse the given path.
109 \membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath}
111 \constfunc{wxString}{GetDefaultPath}{\void}
113 Gets the default path.
115 \membersection{wxGenericDirCtrl::GetPath}\label{wxgenericdirctrlgetpath}
117 \constfunc{wxString}{GetPath}{\void}
119 Gets the currently-selected directory or filename.
121 \membersection{wxGenericDirCtrl::GetFilePath}\label{wxgenericdirctrlgetfilepath}
123 \constfunc{wxString}{GetFilePath}{\void}
125 Gets selected filename path only (else empty string).
127 This function doesn't count a directory as a selection.
129 \membersection{wxGenericDirCtrl::GetFilter}\label{wxgenericdirctrlgetfilter}
131 \constfunc{wxString}{GetFilter}{\void}
133 Returns the filter string.
135 \membersection{wxGenericDirCtrl::GetFilterIndex}\label{wxgenericdirctrlgetfilterindex}
137 \constfunc{int}{GetFilterIndex}{\void}
139 Returns the current filter index (zero-based).
141 \membersection{wxGenericDirCtrl::GetFilterListCtrl}\label{wxgenericdirctrlgetfilterlistctrl}
143 \constfunc{wxDirFilterListCtrl*}{GetFilterListCtrl}{\void}
145 Returns a pointer to the filter list control (if present).
147 \membersection{wxGenericDirCtrl::GetRootId}\label{wxgenericdirctrlgetrootid}
149 \func{wxTreeItemId}{GetRootId}{\void}
151 Returns the root id for the tree control.
153 \membersection{wxGenericDirCtrl::GetTreeCtrl}\label{wxgenericdirctrlgettreectrl}
155 \constfunc{wxTreeCtrl*}{GetTreeCtrl}{\void}
157 Returns a pointer to the tree control.
159 \membersection{wxGenericDirCtrl::ReCreateTree}\label{wxgenericdirctrlrecreatetree}
161 \func{void}{ReCreateTree}{\void}
163 Collapse and expand the tree, thus re-creating it from scratch.
164 May be used to update the displayed directory content.
166 \membersection{wxGenericDirCtrl::SetDefaultPath}\label{wxgenericdirctrlsetdefaultpath}
168 \func{void}{SetDefaultPath}{\param{const wxString\& }{path}}
170 Sets the default path.
172 \membersection{wxGenericDirCtrl::SetFilter}\label{wxgenericdirctrlsetfilter}
174 \func{void}{SetFilter}{\param{const wxString\& }{filter}}
176 Sets the filter string.
178 \membersection{wxGenericDirCtrl::SetFilterIndex}\label{wxgenericdirctrlsetfilterindex}
180 \func{void}{SetFilterIndex}{\param{int }{n}}
182 Sets the current filter index (zero-based).
184 \membersection{wxGenericDirCtrl::SetPath}\label{wxgenericdirctrlsetpath}
186 \func{void}{SetPath}{\param{const wxString\& }{path}}
188 Sets the current path.
190 \membersection{wxGenericDirCtrl::ShowHidden}\label{wxgenericdirctrlShowHidden}
192 \func{void}{ShowHidden}{\param{bool }{show}}
194 \wxheading{Parameters}
196 \docparam{show}{If true, hidden folders and files will be displayed by the
197 control. If false, they will not be displayed.}