1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface file for wxGenericDirCtrl
7 // Created: 10-June-1998
9 // Copyright: (c) 2002 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 DECLARE_DEF_STRING(DirDialogDefaultFolderStr);
22 //---------------------------------------------------------------------------
25 // Extra styles for wxGenericDirCtrl
28 // Only allow directory viewing/selection, no files
29 wxDIRCTRL_DIR_ONLY = 0x0010,
30 // When setting the default path, select the first file in the directory
31 wxDIRCTRL_SELECT_FIRST = 0x0020,
32 // Show the filter list
33 wxDIRCTRL_SHOW_FILTERS = 0x0040,
34 // Use 3D borders on internal controls
35 wxDIRCTRL_3D_INTERNAL = 0x0080,
37 wxDIRCTRL_EDIT_LABELS = 0x0100
43 class wxDirItemData : public wxObject // wxTreeItemData
46 wxDirItemData(const wxString& path, const wxString& name, bool isDir);
47 // ~wxDirItemDataEx();
48 void SetNewDirName( wxString path );
49 wxString m_path, m_name;
59 class wxGenericDirCtrl: public wxControl
62 %addtofunc wxGenericDirCtrl "self._setOORInfo(self)"
63 %addtofunc wxGenericDirCtrl() ""
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,
72 const wxString& name = wxPy_TreeCtrlNameStr);
73 %name(PreGenericDirCtrl)wxGenericDirCtrl();
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,
83 const wxString& name = wxPy_TreeCtrlNameStr);
87 // Try to expand as much of the given path as possible.
88 virtual bool ExpandPath(const wxString& path);
91 virtual inline wxString GetDefaultPath() const;
92 virtual void SetDefaultPath(const wxString& path);
94 // Get dir or filename
95 virtual wxString GetPath() const;
97 // Get selected filename path only (else empty string).
98 // I.e. don't count a directory as a selection
99 virtual wxString GetFilePath() const;
100 virtual void SetPath(const wxString& path);
102 virtual void ShowHidden( bool show );
103 virtual bool GetShowHidden();
105 virtual wxString GetFilter() const;
106 virtual void SetFilter(const wxString& filter);
108 virtual int GetFilterIndex() const;
109 virtual void SetFilterIndex(int n);
111 virtual wxTreeItemId GetRootId();
113 virtual wxTreeCtrl* GetTreeCtrl() const;
114 virtual wxDirFilterListCtrl* GetFilterListCtrl() const;
117 // Parse the filter into an array of filters and an array of descriptions
118 // virtual int ParseFilter(const wxString& filterStr, wxArrayString& filters, wxArrayString& descriptions);
120 // Find the child that matches the first part of 'path'.
121 // E.g. if a child path is "/usr" and 'path' is "/usr/include"
122 // then the child for /usr is returned.
123 // If the path string has been used (we're at the leaf), done is set to TRUE
124 virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& OUTPUT);
126 // Resize the components of the control
127 virtual void DoResize();
129 // Collapse & expand the tree, thus re-creating it from scratch:
130 virtual void ReCreateTree();
137 class wxDirFilterListCtrl: public wxChoice
140 %addtofunc wxDirFilterListCtrl "self._setOORInfo(self)"
141 %addtofunc wxDirFilterListCtrl() ""
143 wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = -1,
144 const wxPoint& pos = wxDefaultPosition,
145 const wxSize& size = wxDefaultSize,
147 %name(PreDirFilterListCtrl)wxDirFilterListCtrl();
149 bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1,
150 const wxPoint& pos = wxDefaultPosition,
151 const wxSize& size = wxDefaultSize,
155 void FillFilterList(const wxString& filter, int defaultFilter);
159 //---------------------------------------------------------------------------
160 //---------------------------------------------------------------------------
161 //---------------------------------------------------------------------------