]>
Commit | Line | Data |
---|---|---|
2f3ebe4c JS |
1 | \section{\class{wxGenericDirCtrl}}\label{wxgenericdirctrl} |
2 | ||
3 | This control can be used to place a directory listing (with optional files) on an arbitrary window. | |
4 | ||
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. | |
7 | ||
8 | \wxheading{Derived from} | |
9 | ||
10 | \helpref{wxControl}{wxcontrol}\\ | |
11 | \helpref{wxWindow}{wxwindow}\\ | |
12 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
13 | \helpref{wxObject}{wxobject} | |
14 | ||
15 | \wxheading{Include files} | |
16 | ||
17 | <wx/dirctrl.h> | |
18 | ||
19 | \wxheading{Window styles} | |
20 | ||
d2c2afc9 | 21 | \twocolwidtha{7cm} |
2f3ebe4c | 22 | \begin{twocollist} |
76ff52f7 GT |
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.} | |
dabd1377 | 27 | \twocolitem{\indexit{wxDIRCTRL\_EDIT\_LABELS}}{Allow the folder and file labels to be editable.} |
2f3ebe4c JS |
28 | \end{twocollist} |
29 | ||
30 | See also \helpref{Generic window styles}{windowstyles}. | |
31 | ||
32 | \wxheading{Data structures} | |
33 | ||
34 | \latexignore{\rtfignore{\wxheading{Members}}} | |
35 | ||
36 | \membersection{wxGenericDirCtrl::wxGenericDirCtrl}\label{wxgenericdirctrlwxgenericdirctrl} | |
37 | ||
38 | \func{}{wxGenericDirCtrl}{\void} | |
39 | ||
40 | Default constructor. | |
41 | ||
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}} | |
48 | ||
49 | Main constructor. | |
50 | ||
51 | \wxheading{Parameters} | |
52 | ||
53 | \docparam{parent}{Parent window.} | |
54 | ||
55 | \docparam{id}{Window identifier.} | |
56 | ||
57 | \docparam{dir}{Initial folder.} | |
58 | ||
59 | \docparam{pos}{Position.} | |
60 | ||
61 | \docparam{size}{Size.} | |
62 | ||
deea56b1 | 63 | \docparam{style}{Window style. Please see \helpref{wxGenericDirCtrl}{wxgenericdirctrl} for a list of possible styles.} |
2f3ebe4c JS |
64 | |
65 | \docparam{filter}{A filter string, using the same syntax as that for \helpref{wxFileDialog}{wxfiledialog}. This may be empty if filters | |
66 | are not being used. | |
67 | ||
68 | Example: ``All files (*.*)|*.*|JPEG files (*.jpg)|*.jpg"} | |
69 | ||
70 | \docparam{defaultFilter}{The zero-indexed default filter setting.} | |
71 | ||
72 | \docparam{name}{The window name.} | |
73 | ||
74 | \membersection{wxGenericDirCtrl::\destruct{wxGenericDirCtrl}}\label{wxgenericdirctrldtor} | |
75 | ||
76 | \func{}{\destruct{wxGenericDirCtrl}}{\void} | |
77 | ||
78 | Destructor. | |
79 | ||
80 | \membersection{wxGenericDirCtrl::Create}\label{wxgenericdirctrlcreate} | |
81 | ||
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}} | |
83 | ||
84 | Create function for two-step construction. See \helpref{wxGenericDirCtrl::wxGenericDirCtrl}{wxgenericdirctrlwxgenericdirctrl} for details. | |
85 | ||
86 | \membersection{wxGenericDirCtrl::Init}\label{wxgenericdirctrlinit} | |
87 | ||
88 | \func{void}{Init}{\void} | |
89 | ||
90 | Initializes variables. | |
91 | ||
c06dde42 JS |
92 | \membersection{wxGenericDirCtrl::CollapseTree}\label{wxgenericdirctrlcollapsetree} |
93 | ||
94 | \func{void}{CollapseTree}{\void} | |
95 | ||
96 | Collapses the entire tree. | |
97 | ||
2f3ebe4c JS |
98 | \membersection{wxGenericDirCtrl::ExpandPath}\label{wxgenericdirctrlexpandpath} |
99 | ||
100 | \func{bool}{ExpandPath}{\param{const wxString\& }{path}} | |
101 | ||
102 | Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control. | |
103 | ||
104 | \membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath} | |
105 | ||
106 | \constfunc{wxString}{GetDefaultPath}{\void} | |
107 | ||
108 | Gets the default path. | |
109 | ||
110 | \membersection{wxGenericDirCtrl::GetPath}\label{wxgenericdirctrlgetpath} | |
111 | ||
112 | \constfunc{wxString}{GetPath}{\void} | |
113 | ||
114 | Gets the currently-selected directory or filename. | |
115 | ||
116 | \membersection{wxGenericDirCtrl::GetFilePath}\label{wxgenericdirctrlgetfilepath} | |
117 | ||
118 | \constfunc{wxString}{GetFilePath}{\void} | |
119 | ||
120 | Gets selected filename path only (else empty string). | |
121 | ||
2edb0bde | 122 | This function doesn't count a directory as a selection. |
2f3ebe4c JS |
123 | |
124 | \membersection{wxGenericDirCtrl::GetFilter}\label{wxgenericdirctrlgetfilter} | |
125 | ||
126 | \constfunc{wxString}{GetFilter}{\void} | |
127 | ||
128 | Returns the filter string. | |
129 | ||
130 | \membersection{wxGenericDirCtrl::GetFilterIndex}\label{wxgenericdirctrlgetfilterindex} | |
131 | ||
132 | \constfunc{int}{GetFilterIndex}{\void} | |
133 | ||
134 | Returns the current filter index (zero-based). | |
135 | ||
136 | \membersection{wxGenericDirCtrl::GetFilterListCtrl}\label{wxgenericdirctrlgetfilterlistctrl} | |
137 | ||
138 | \constfunc{wxDirFilterListCtrl*}{GetFilterListCtrl}{\void} | |
139 | ||
140 | Returns a pointer to the filter list control (if present). | |
141 | ||
142 | \membersection{wxGenericDirCtrl::GetRootId}\label{wxgenericdirctrlgetrootid} | |
143 | ||
144 | \func{wxTreeItemId}{GetRootId}{\void} | |
145 | ||
146 | Returns the root id for the tree control. | |
147 | ||
148 | \membersection{wxGenericDirCtrl::GetTreeCtrl}\label{wxgenericdirctrlgettreectrl} | |
149 | ||
150 | \constfunc{wxTreeCtrl*}{GetTreeCtrl}{\void} | |
151 | ||
152 | Returns a pointer to the tree control. | |
153 | ||
c06dde42 JS |
154 | \membersection{wxGenericDirCtrl::ReCreateTree}\label{wxgenericdirctrlrecreatetree} |
155 | ||
156 | \func{void}{ReCreateTree}{\void} | |
157 | ||
158 | Collapse and expand the tree, thus re-creating it from scratch. | |
159 | May be used to update the displayed directory content. | |
160 | ||
2f3ebe4c JS |
161 | \membersection{wxGenericDirCtrl::SetDefaultPath}\label{wxgenericdirctrlsetdefaultpath} |
162 | ||
163 | \func{void}{SetDefaultPath}{\param{const wxString\& }{path}} | |
164 | ||
165 | Sets the default path. | |
166 | ||
167 | \membersection{wxGenericDirCtrl::SetFilter}\label{wxgenericdirctrlsetfilter} | |
168 | ||
169 | \func{void}{SetFilter}{\param{const wxString\& }{filter}} | |
170 | ||
171 | Sets the filter string. | |
172 | ||
173 | \membersection{wxGenericDirCtrl::SetFilterIndex}\label{wxgenericdirctrlsetfilterindex} | |
174 | ||
175 | \func{void}{SetFilterIndex}{\param{int }{n}} | |
176 | ||
177 | Sets the current filter index (zero-based). | |
178 | ||
179 | \membersection{wxGenericDirCtrl::SetPath}\label{wxgenericdirctrlsetpath} | |
180 | ||
181 | \func{void}{SetPath}{\param{const wxString\& }{path}} | |
182 | ||
183 | Sets the current path. | |
184 |