]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/dirctrlg.h
applied event speed up patch (752928)
[wxWidgets.git] / include / wx / generic / dirctrlg.h
index b19d21f6473a66f7ce83fec99eab45592841ad24..977b5396a7b60ab70452e05caed3f1542c7fb1a2 100644 (file)
@@ -31,6 +31,8 @@
 //-----------------------------------------------------------------------------
 
 class WXDLLEXPORT wxTextCtrl;
+class WXDLLEXPORT wxImageList;
+class WXDLLEXPORT wxHashTable;
 
 //-----------------------------------------------------------------------------
 // Extra styles for wxGenericDirCtrl
@@ -161,9 +163,13 @@ public:
     virtual void ReCreateTree();
     
 protected:
-    void ExpandDir(wxTreeItemId parentId);
-    void CollapseDir(wxTreeItemId parentId);
-    void AddSection(const wxString& path, const wxString& name, int imageId = 0);
+    virtual void ExpandDir(wxTreeItemId parentId);
+    virtual void CollapseDir(wxTreeItemId parentId);
+    virtual const wxTreeItemId AddSection(const wxString& path, const wxString& name, int imageId = 0);
+    virtual wxTreeItemId AppendItem (const wxTreeItemId & parent,
+                const wxString & text,
+                int image = -1, int selectedImage = -1,
+                wxTreeItemData * data = NULL);
     //void FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayString& filenames);
 
     // Extract description and actual filter from overall filter string
@@ -172,7 +178,6 @@ protected:
 private:
     bool            m_showHidden;
     wxTreeItemId    m_rootId;
-    wxImageList*    m_imageList;
     wxString        m_defaultPath; // Starting path
     long            m_styleEx; // Extended style
     wxString        m_filter;  // Wildcards in same format as per wxFileDialog
@@ -184,6 +189,7 @@ private:
 private:
     DECLARE_EVENT_TABLE()
     DECLARE_DYNAMIC_CLASS(wxGenericDirCtrl)
+    DECLARE_NO_COPY_CLASS(wxGenericDirCtrl)
 };
 
 //-----------------------------------------------------------------------------
@@ -223,6 +229,7 @@ protected:
 
     DECLARE_EVENT_TABLE()
     DECLARE_CLASS(wxDirFilterListCtrl)
+    DECLARE_NO_COPY_CLASS(wxDirFilterListCtrl)
 };
 
 #if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXPM__)
@@ -233,6 +240,42 @@ protected:
 #define wxID_TREECTRL          7000
 #define wxID_FILTERLISTCTRL    7001
 
+//-------------------------------------------------------------------------
+// wxFileIconsTable - use wxTheFileIconsTable which is created as necessary
+//-------------------------------------------------------------------------
+
+class WXDLLEXPORT wxFileIconsTable
+{
+public:
+    wxFileIconsTable();
+    ~wxFileIconsTable();
+
+    enum iconId_Type
+    {
+        folder,
+        folder_open,
+        computer,
+        drive,
+        cdrom,
+        floppy,
+        removeable,
+        file,
+        executable
+    };
+
+    int GetIconID(const wxString& extension, const wxString& mime = wxEmptyString);
+    wxImageList *GetSmallImageList();
+
+protected:
+    void Create();  // create on first use
+
+    wxImageList *m_smallImageList;
+    wxHashTable *m_HashTable;
+};
+
+// The global fileicons table
+WXDLLEXPORT_DATA(extern wxFileIconsTable *) wxTheFileIconsTable;
+
 #endif // wxUSE_DIRDLG
 
 #endif