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{{\bf \indexit{wxDIRCTRL
\_DIR\_ONLY}}}{Only show directories, and not files.
}
24 \twocolitem{{\bf \indexit{wxDIRCTRL
\_3D\_INTERNAL}}}{Use
3D borders for internal controls.
}
25 \twocolitem{{\bf \indexit{wxDIRCTRL
\_SELECT\_FIRST}}}{When setting the default path, select the first file in the directory.
}
26 \twocolitem{{\bf \indexit{wxDIRCTRL
\_SHOW\_FILTERS}}}{Show the drop-down filter list.
}
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|wxSUNKEN
\_BORDER},
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|wxSUNKEN\_BORDER}, \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::ExpandPath}\label{wxgenericdirctrlexpandpath}
93 \func{bool}{ExpandPath}{\param{const wxString\& }{path}}
95 Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
97 \membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath}
99 \constfunc{wxString}{GetDefaultPath}{\void}
101 Gets the default path.
103 \membersection{wxGenericDirCtrl::GetPath}\label{wxgenericdirctrlgetpath}
105 \constfunc{wxString}{GetPath}{\void}
107 Gets the currently-selected directory or filename.
109 \membersection{wxGenericDirCtrl::GetFilePath}\label{wxgenericdirctrlgetfilepath}
111 \constfunc{wxString}{GetFilePath}{\void}
113 Gets selected filename path only (else empty string).
115 This function doen't count a directory as a selection.
117 \membersection{wxGenericDirCtrl::GetFilter}\label{wxgenericdirctrlgetfilter}
119 \constfunc{wxString}{GetFilter}{\void}
121 Returns the filter string.
123 \membersection{wxGenericDirCtrl::GetFilterIndex}\label{wxgenericdirctrlgetfilterindex}
125 \constfunc{int}{GetFilterIndex}{\void}
127 Returns the current filter index (zero-based).
129 \membersection{wxGenericDirCtrl::GetFilterListCtrl}\label{wxgenericdirctrlgetfilterlistctrl}
131 \constfunc{wxDirFilterListCtrl*}{GetFilterListCtrl}{\void}
133 Returns a pointer to the filter list control (if present).
135 \membersection{wxGenericDirCtrl::GetRootId}\label{wxgenericdirctrlgetrootid}
137 \func{wxTreeItemId}{GetRootId}{\void}
139 Returns the root id for the tree control.
141 \membersection{wxGenericDirCtrl::GetTreeCtrl}\label{wxgenericdirctrlgettreectrl}
143 \constfunc{wxTreeCtrl*}{GetTreeCtrl}{\void}
145 Returns a pointer to the tree control.
147 \membersection{wxGenericDirCtrl::SetDefaultPath}\label{wxgenericdirctrlsetdefaultpath}
149 \func{void}{SetDefaultPath}{\param{const wxString\& }{path}}
151 Sets the default path.
153 \membersection{wxGenericDirCtrl::SetFilter}\label{wxgenericdirctrlsetfilter}
155 \func{void}{SetFilter}{\param{const wxString\& }{filter}}
157 Sets the filter string.
159 \membersection{wxGenericDirCtrl::SetFilterIndex}\label{wxgenericdirctrlsetfilterindex}
161 \func{void}{SetFilterIndex}{\param{int }{n}}
163 Sets the current filter index (zero-based).
165 \membersection{wxGenericDirCtrl::SetPath}\label{wxgenericdirctrlsetpath}
167 \func{void}{SetPath}{\param{const wxString\& }{path}}
169 Sets the current path.