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 //---------------------------------------------------------------------------
 
  18 MAKE_CONST_WXSTRING(DirDialogDefaultFolderStr);
 
  20 //---------------------------------------------------------------------------
 
  23 // Extra styles for wxGenericDirCtrl
 
  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,
 
  35     wxDIRCTRL_EDIT_LABELS    = 0x0100
 
  41 class wxDirItemData : public wxObject // wxTreeItemData
 
  44   wxDirItemData(const wxString& path, const wxString& name, bool isDir);
 
  45 //  ~wxDirItemDataEx();
 
  46   void SetNewDirName( wxString path );
 
  47   wxString m_path, m_name;
 
  57 MustHaveApp(wxGenericDirCtrl);
 
  59 class wxGenericDirCtrl: public wxControl
 
  62     %pythonAppend wxGenericDirCtrl         "self._setOORInfo(self)"
 
  63     %pythonAppend 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 = wxPyTreeCtrlNameStr);
 
  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 = wxPyTreeCtrlNameStr);
 
  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 wxPyTreeCtrl* 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);
 
 121         virtual wxTreeItemId, FindChild(wxTreeItemId parentId, const wxString& path, bool& OUTPUT),
 
 122         "FindChild(wxTreeItemId parentId, wxString path) -> (item, done)",
 
 123         "Find the child that matches the first part of 'path'.  E.g. if a child
 
 124 path is \"/usr\" and 'path' is \"/usr/include\" then the child for
 
 125 /usr is returned.  If the path string has been used (we're at the
 
 126 leaf), done is set to True.
 
 130     // Resize the components of the control
 
 131     virtual void DoResize();
 
 133     // Collapse & expand the tree, thus re-creating it from scratch:
 
 134     virtual void ReCreateTree();
 
 141 MustHaveApp(wxDirFilterListCtrl);
 
 143 class wxDirFilterListCtrl: public wxChoice
 
 146     %pythonAppend wxDirFilterListCtrl         "self._setOORInfo(self)"
 
 147     %pythonAppend wxDirFilterListCtrl()       ""
 
 149     wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = -1,
 
 150                         const wxPoint& pos = wxDefaultPosition,
 
 151                         const wxSize& size = wxDefaultSize,
 
 153     %name(PreDirFilterListCtrl)wxDirFilterListCtrl();
 
 155     bool Create(wxGenericDirCtrl* parent, const wxWindowID id = -1,
 
 156               const wxPoint& pos = wxDefaultPosition,
 
 157               const wxSize& size = wxDefaultSize,
 
 161     void FillFilterList(const wxString& filter, int defaultFilter);
 
 165 //---------------------------------------------------------------------------
 
 166 //---------------------------------------------------------------------------
 
 167 //---------------------------------------------------------------------------