]>
Commit | Line | Data |
---|---|---|
d14a1e28 RD |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: _ditctrl.i | |
3 | // Purpose: SWIG interface file for wxGenericDirCtrl | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 10-June-1998 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 2002 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | // Not a %module | |
14 | ||
15 | ||
16 | //--------------------------------------------------------------------------- | |
17 | ||
b2dc1044 | 18 | MAKE_CONST_WXSTRING(DirDialogDefaultFolderStr); |
d14a1e28 RD |
19 | |
20 | //--------------------------------------------------------------------------- | |
21 | %newgroup | |
22 | ||
23 | // Extra styles for wxGenericDirCtrl | |
24 | enum | |
25 | { | |
26 | // Only allow directory viewing/selection, no files | |
27 | wxDIRCTRL_DIR_ONLY = 0x0010, | |
28 | // When setting the default path, select the first file in the directory | |
29 | wxDIRCTRL_SELECT_FIRST = 0x0020, | |
30 | // Show the filter list | |
31 | wxDIRCTRL_SHOW_FILTERS = 0x0040, | |
32 | // Use 3D borders on internal controls | |
33 | wxDIRCTRL_3D_INTERNAL = 0x0080, | |
34 | // Editable labels | |
35 | wxDIRCTRL_EDIT_LABELS = 0x0100 | |
36 | }; | |
37 | ||
38 | ||
39 | ||
40 | #if 0 | |
41 | class wxDirItemData : public wxObject // wxTreeItemData | |
42 | { | |
43 | public: | |
44 | wxDirItemData(const wxString& path, const wxString& name, bool isDir); | |
45 | // ~wxDirItemDataEx(); | |
46 | void SetNewDirName( wxString path ); | |
47 | wxString m_path, m_name; | |
48 | bool m_isHidden; | |
49 | bool m_isExpanded; | |
50 | bool m_isDir; | |
51 | }; | |
52 | #endif | |
53 | ||
54 | ||
55 | ||
56 | ||
ab1f7d2a RD |
57 | MustHaveApp(wxGenericDirCtrl); |
58 | ||
d14a1e28 RD |
59 | class wxGenericDirCtrl: public wxControl |
60 | { | |
61 | public: | |
2b9048c5 RD |
62 | %pythonAppend wxGenericDirCtrl "self._setOORInfo(self)" |
63 | %pythonAppend wxGenericDirCtrl() "" | |
d14a1e28 RD |
64 | |
65 | wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1, | |
66 | const wxString& dir = wxPyDirDialogDefaultFolderStr, | |
67 | const wxPoint& pos = wxDefaultPosition, | |
68 | const wxSize& size = wxDefaultSize, | |
69 | long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, | |
70 | const wxString& filter = wxPyEmptyString, | |
71 | int defaultFilter = 0, | |
b2dc1044 | 72 | const wxString& name = wxPyTreeCtrlNameStr); |
1b8c7ba6 | 73 | %RenameCtor(PreGenericDirCtrl, wxGenericDirCtrl()); |
d14a1e28 RD |
74 | |
75 | ||
76 | bool Create(wxWindow *parent, const wxWindowID id = -1, | |
77 | const wxString& dir = wxPyDirDialogDefaultFolderStr, | |
78 | const wxPoint& pos = wxDefaultPosition, | |
79 | const wxSize& size = wxDefaultSize, | |
80 | long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, | |
81 | const wxString& filter = wxPyEmptyString, | |
82 | int defaultFilter = 0, | |
b2dc1044 | 83 | const wxString& name = wxPyTreeCtrlNameStr); |
d14a1e28 RD |
84 | |
85 | ||
86 | ||
87 | // Try to expand as much of the given path as possible. | |
88 | virtual bool ExpandPath(const wxString& path); | |
d0e2ede0 RD |
89 | // collapse the path |
90 | virtual bool CollapsePath(const wxString& path); | |
d14a1e28 RD |
91 | |
92 | virtual inline wxString GetDefaultPath() const; | |
93 | virtual void SetDefaultPath(const wxString& path); | |
94 | ||
95 | // Get dir or filename | |
96 | virtual wxString GetPath() const; | |
97 | ||
98 | // Get selected filename path only (else empty string). | |
99 | // I.e. don't count a directory as a selection | |
100 | virtual wxString GetFilePath() const; | |
101 | virtual void SetPath(const wxString& path); | |
102 | ||
103 | virtual void ShowHidden( bool show ); | |
104 | virtual bool GetShowHidden(); | |
105 | ||
106 | virtual wxString GetFilter() const; | |
107 | virtual void SetFilter(const wxString& filter); | |
108 | ||
109 | virtual int GetFilterIndex() const; | |
110 | virtual void SetFilterIndex(int n); | |
111 | ||
112 | virtual wxTreeItemId GetRootId(); | |
113 | ||
b2dc1044 | 114 | virtual wxPyTreeCtrl* GetTreeCtrl() const; |
d14a1e28 RD |
115 | virtual wxDirFilterListCtrl* GetFilterListCtrl() const; |
116 | ||
117 | ||
118 | // Parse the filter into an array of filters and an array of descriptions | |
119 | // virtual int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions); | |
120 | ||
322913ce RD |
121 | DocDeclAStr( |
122 | virtual wxTreeItemId, FindChild(wxTreeItemId parentId, const wxString& path, bool& OUTPUT), | |
123 | "FindChild(wxTreeItemId parentId, wxString path) -> (item, done)", | |
d07d2bc9 RD |
124 | "Find the child that matches the first part of 'path'. E.g. if a child |
125 | path is \"/usr\" and 'path' is \"/usr/include\" then the child for | |
126 | /usr is returned. If the path string has been used (we're at the | |
127 | leaf), done is set to True. | |
128 | ", ""); | |
322913ce | 129 | |
d14a1e28 RD |
130 | |
131 | // Resize the components of the control | |
132 | virtual void DoResize(); | |
133 | ||
134 | // Collapse & expand the tree, thus re-creating it from scratch: | |
135 | virtual void ReCreateTree(); | |
136 | ||
137 | }; | |
138 | ||
139 | ||
140 | ||
141 | ||
ab1f7d2a RD |
142 | MustHaveApp(wxDirFilterListCtrl); |
143 | ||
d14a1e28 RD |
144 | class wxDirFilterListCtrl: public wxChoice |
145 | { | |
146 | public: | |
2b9048c5 RD |
147 | %pythonAppend wxDirFilterListCtrl "self._setOORInfo(self)" |
148 | %pythonAppend wxDirFilterListCtrl() "" | |
d14a1e28 RD |
149 | |
150 | wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = -1, | |
151 | const wxPoint& pos = wxDefaultPosition, | |
152 | const wxSize& size = wxDefaultSize, | |
153 | long style = 0); | |
1b8c7ba6 | 154 | %RenameCtor(PreDirFilterListCtrl, wxDirFilterListCtrl()); |
d14a1e28 RD |
155 | |
156 | bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1, | |
157 | const wxPoint& pos = wxDefaultPosition, | |
158 | const wxSize& size = wxDefaultSize, | |
159 | long style = 0); | |
160 | ||
161 | //// Operations | |
162 | void FillFilterList(const wxString& filter, int defaultFilter); | |
163 | }; | |
164 | ||
165 | ||
166 | //--------------------------------------------------------------------------- | |
167 | //--------------------------------------------------------------------------- | |
168 | //--------------------------------------------------------------------------- |