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
\_EDITABLE}}{Allow the folder and file items 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::ExpandPath}\label{wxgenericdirctrlexpandpath}
94 \func{bool}{ExpandPath}{\param{const wxString\& }{path}}
96 Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
98 \membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath}
100 \constfunc{wxString}{GetDefaultPath}{\void}
102 Gets the default path.
104 \membersection{wxGenericDirCtrl::GetPath}\label{wxgenericdirctrlgetpath}
106 \constfunc{wxString}{GetPath}{\void}
108 Gets the currently-selected directory or filename.
110 \membersection{wxGenericDirCtrl::GetFilePath}\label{wxgenericdirctrlgetfilepath}
112 \constfunc{wxString}{GetFilePath}{\void}
114 Gets selected filename path only (else empty string).
116 This function doen't count a directory as a selection.
118 \membersection{wxGenericDirCtrl::GetFilter}\label{wxgenericdirctrlgetfilter}
120 \constfunc{wxString}{GetFilter}{\void}
122 Returns the filter string.
124 \membersection{wxGenericDirCtrl::GetFilterIndex}\label{wxgenericdirctrlgetfilterindex}
126 \constfunc{int}{GetFilterIndex}{\void}
128 Returns the current filter index (zero-based).
130 \membersection{wxGenericDirCtrl::GetFilterListCtrl}\label{wxgenericdirctrlgetfilterlistctrl}
132 \constfunc{wxDirFilterListCtrl*}{GetFilterListCtrl}{\void}
134 Returns a pointer to the filter list control (if present).
136 \membersection{wxGenericDirCtrl::GetRootId}\label{wxgenericdirctrlgetrootid}
138 \func{wxTreeItemId}{GetRootId}{\void}
140 Returns the root id for the tree control.
142 \membersection{wxGenericDirCtrl::GetTreeCtrl}\label{wxgenericdirctrlgettreectrl}
144 \constfunc{wxTreeCtrl*}{GetTreeCtrl}{\void}
146 Returns a pointer to the tree control.
148 \membersection{wxGenericDirCtrl::SetDefaultPath}\label{wxgenericdirctrlsetdefaultpath}
150 \func{void}{SetDefaultPath}{\param{const wxString\& }{path}}
152 Sets the default path.
154 \membersection{wxGenericDirCtrl::SetFilter}\label{wxgenericdirctrlsetfilter}
156 \func{void}{SetFilter}{\param{const wxString\& }{filter}}
158 Sets the filter string.
160 \membersection{wxGenericDirCtrl::SetFilterIndex}\label{wxgenericdirctrlsetfilterindex}
162 \func{void}{SetFilterIndex}{\param{int }{n}}
164 Sets the current filter index (zero-based).
166 \membersection{wxGenericDirCtrl::SetPath}\label{wxgenericdirctrlsetpath}
168 \func{void}{SetPath}{\param{const wxString\& }{path}}
170 Sets the current path.