]>
Commit | Line | Data |
---|---|---|
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 | ||
18 | MAKE_CONST_WXSTRING(DirDialogDefaultFolderStr); | |
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 | ||
57 | class wxGenericDirCtrl: public wxControl | |
58 | { | |
59 | public: | |
60 | %pythonAppend wxGenericDirCtrl "self._setOORInfo(self)" | |
61 | %pythonAppend wxGenericDirCtrl() "" | |
62 | ||
63 | wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = -1, | |
64 | const wxString& dir = wxPyDirDialogDefaultFolderStr, | |
65 | const wxPoint& pos = wxDefaultPosition, | |
66 | const wxSize& size = wxDefaultSize, | |
67 | long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, | |
68 | const wxString& filter = wxPyEmptyString, | |
69 | int defaultFilter = 0, | |
70 | const wxString& name = wxPyTreeCtrlNameStr); | |
71 | %name(PreGenericDirCtrl)wxGenericDirCtrl(); | |
72 | ||
73 | ||
74 | bool Create(wxWindow *parent, const wxWindowID id = -1, | |
75 | const wxString& dir = wxPyDirDialogDefaultFolderStr, | |
76 | const wxPoint& pos = wxDefaultPosition, | |
77 | const wxSize& size = wxDefaultSize, | |
78 | long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, | |
79 | const wxString& filter = wxPyEmptyString, | |
80 | int defaultFilter = 0, | |
81 | const wxString& name = wxPyTreeCtrlNameStr); | |
82 | ||
83 | ||
84 | ||
85 | // Try to expand as much of the given path as possible. | |
86 | virtual bool ExpandPath(const wxString& path); | |
87 | ||
88 | ||
89 | virtual inline wxString GetDefaultPath() const; | |
90 | virtual void SetDefaultPath(const wxString& path); | |
91 | ||
92 | // Get dir or filename | |
93 | virtual wxString GetPath() const; | |
94 | ||
95 | // Get selected filename path only (else empty string). | |
96 | // I.e. don't count a directory as a selection | |
97 | virtual wxString GetFilePath() const; | |
98 | virtual void SetPath(const wxString& path); | |
99 | ||
100 | virtual void ShowHidden( bool show ); | |
101 | virtual bool GetShowHidden(); | |
102 | ||
103 | virtual wxString GetFilter() const; | |
104 | virtual void SetFilter(const wxString& filter); | |
105 | ||
106 | virtual int GetFilterIndex() const; | |
107 | virtual void SetFilterIndex(int n); | |
108 | ||
109 | virtual wxTreeItemId GetRootId(); | |
110 | ||
111 | virtual wxPyTreeCtrl* GetTreeCtrl() const; | |
112 | virtual wxDirFilterListCtrl* GetFilterListCtrl() const; | |
113 | ||
114 | ||
115 | // Parse the filter into an array of filters and an array of descriptions | |
116 | // virtual int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions); | |
117 | ||
118 | DocDeclAStr( | |
119 | virtual wxTreeItemId, FindChild(wxTreeItemId parentId, const wxString& path, bool& OUTPUT), | |
120 | "FindChild(wxTreeItemId parentId, wxString path) -> (item, done)", | |
121 | "Find the child that matches the first part of 'path'. E.g. if a child path is\n" | |
122 | "\"/usr\" and 'path' is \"/usr/include\" then the child for /usr is returned.\n" | |
123 | "If the path string has been used (we're at the leaf), done is set to True\n"); | |
124 | ||
125 | ||
126 | // Resize the components of the control | |
127 | virtual void DoResize(); | |
128 | ||
129 | // Collapse & expand the tree, thus re-creating it from scratch: | |
130 | virtual void ReCreateTree(); | |
131 | ||
132 | }; | |
133 | ||
134 | ||
135 | ||
136 | ||
137 | class wxDirFilterListCtrl: public wxChoice | |
138 | { | |
139 | public: | |
140 | %pythonAppend wxDirFilterListCtrl "self._setOORInfo(self)" | |
141 | %pythonAppend wxDirFilterListCtrl() "" | |
142 | ||
143 | wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = -1, | |
144 | const wxPoint& pos = wxDefaultPosition, | |
145 | const wxSize& size = wxDefaultSize, | |
146 | long style = 0); | |
147 | %name(PreDirFilterListCtrl)wxDirFilterListCtrl(); | |
148 | ||
149 | bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1, | |
150 | const wxPoint& pos = wxDefaultPosition, | |
151 | const wxSize& size = wxDefaultSize, | |
152 | long style = 0); | |
153 | ||
154 | //// Operations | |
155 | void FillFilterList(const wxString& filter, int defaultFilter); | |
156 | }; | |
157 | ||
158 | ||
159 | //--------------------------------------------------------------------------- | |
160 | //--------------------------------------------------------------------------- | |
161 | //--------------------------------------------------------------------------- |