]>
Commit | Line | Data |
---|---|---|
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 | ||
21 | \twocolwidtha{5cm} | |
22 | \begin{twocollist} | |
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\_EDIT\_LABELS}}{Allow the folder and file labels to be editable.} | |
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 | ||
63 | \docparam{style}{Window style. Please see \helpref{wxGenericDirCtrl}{wxgenericdirctrl} for a list of possible styles.} | |
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 | ||
92 | \membersection{wxGenericDirCtrl::ExpandPath}\label{wxgenericdirctrlexpandpath} | |
93 | ||
94 | \func{bool}{ExpandPath}{\param{const wxString\& }{path}} | |
95 | ||
96 | Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control. | |
97 | ||
98 | \membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath} | |
99 | ||
100 | \constfunc{wxString}{GetDefaultPath}{\void} | |
101 | ||
102 | Gets the default path. | |
103 | ||
104 | \membersection{wxGenericDirCtrl::GetPath}\label{wxgenericdirctrlgetpath} | |
105 | ||
106 | \constfunc{wxString}{GetPath}{\void} | |
107 | ||
108 | Gets the currently-selected directory or filename. | |
109 | ||
110 | \membersection{wxGenericDirCtrl::GetFilePath}\label{wxgenericdirctrlgetfilepath} | |
111 | ||
112 | \constfunc{wxString}{GetFilePath}{\void} | |
113 | ||
114 | Gets selected filename path only (else empty string). | |
115 | ||
116 | This function doesn't count a directory as a selection. | |
117 | ||
118 | \membersection{wxGenericDirCtrl::GetFilter}\label{wxgenericdirctrlgetfilter} | |
119 | ||
120 | \constfunc{wxString}{GetFilter}{\void} | |
121 | ||
122 | Returns the filter string. | |
123 | ||
124 | \membersection{wxGenericDirCtrl::GetFilterIndex}\label{wxgenericdirctrlgetfilterindex} | |
125 | ||
126 | \constfunc{int}{GetFilterIndex}{\void} | |
127 | ||
128 | Returns the current filter index (zero-based). | |
129 | ||
130 | \membersection{wxGenericDirCtrl::GetFilterListCtrl}\label{wxgenericdirctrlgetfilterlistctrl} | |
131 | ||
132 | \constfunc{wxDirFilterListCtrl*}{GetFilterListCtrl}{\void} | |
133 | ||
134 | Returns a pointer to the filter list control (if present). | |
135 | ||
136 | \membersection{wxGenericDirCtrl::GetRootId}\label{wxgenericdirctrlgetrootid} | |
137 | ||
138 | \func{wxTreeItemId}{GetRootId}{\void} | |
139 | ||
140 | Returns the root id for the tree control. | |
141 | ||
142 | \membersection{wxGenericDirCtrl::GetTreeCtrl}\label{wxgenericdirctrlgettreectrl} | |
143 | ||
144 | \constfunc{wxTreeCtrl*}{GetTreeCtrl}{\void} | |
145 | ||
146 | Returns a pointer to the tree control. | |
147 | ||
148 | \membersection{wxGenericDirCtrl::SetDefaultPath}\label{wxgenericdirctrlsetdefaultpath} | |
149 | ||
150 | \func{void}{SetDefaultPath}{\param{const wxString\& }{path}} | |
151 | ||
152 | Sets the default path. | |
153 | ||
154 | \membersection{wxGenericDirCtrl::SetFilter}\label{wxgenericdirctrlsetfilter} | |
155 | ||
156 | \func{void}{SetFilter}{\param{const wxString\& }{filter}} | |
157 | ||
158 | Sets the filter string. | |
159 | ||
160 | \membersection{wxGenericDirCtrl::SetFilterIndex}\label{wxgenericdirctrlsetfilterindex} | |
161 | ||
162 | \func{void}{SetFilterIndex}{\param{int }{n}} | |
163 | ||
164 | Sets the current filter index (zero-based). | |
165 | ||
166 | \membersection{wxGenericDirCtrl::SetPath}\label{wxgenericdirctrlsetpath} | |
167 | ||
168 | \func{void}{SetPath}{\param{const wxString\& }{path}} | |
169 | ||
170 | Sets the current path. | |
171 |