X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80f624ec0c99878e327bfd070d6a92adf48eac14..77c8efc8c37da6d6a5e2e8022d21d1cd7d76371d:/include/wx/generic/dirctrlg.h diff --git a/include/wx/generic/dirctrlg.h b/include/wx/generic/dirctrlg.h index b2ff47f63c..af6ab5de58 100644 --- a/include/wx/generic/dirctrlg.h +++ b/include/wx/generic/dirctrlg.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dirctrlg.h +// Name: wx/generic/dirctrlg.h // Purpose: wxGenericDirCtrl class // Builds on wxDirCtrl class written by Robert Roebling for the // wxFile application, modified by Harm van der Heijden. @@ -15,10 +15,6 @@ #ifndef _WX_DIRCTRL_H_ #define _WX_DIRCTRL_H_ -#if wxUSE_DIRDLG || wxUSE_FILEDLG - #include "wx/imaglist.h" -#endif - #if wxUSE_DIRDLG #include "wx/treectrl.h" @@ -31,7 +27,6 @@ //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxTextCtrl; -class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_FWD_BASE wxHashTable; //----------------------------------------------------------------------------- @@ -116,6 +111,7 @@ public: void OnCollapseItem(wxTreeEvent &event ); void OnBeginEditItem(wxTreeEvent &event ); void OnEndEditItem(wxTreeEvent &event ); + void OnTreeSelChange(wxTreeEvent &event); void OnSize(wxSizeEvent &event ); // Try to expand as much of the given path as possible. @@ -166,6 +162,8 @@ public: // If the path string has been used (we're at the leaf), done is set to true virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done); + wxString GetPath(wxTreeItemId itemId) const; + // Resize the components of the control virtual void DoResize(); @@ -194,6 +192,9 @@ protected: bool ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description); private: + void PopulateNode(wxTreeItemId node); + wxDirItemData* GetItemData(wxTreeItemId itemId); + bool m_showHidden; wxTreeItemId m_rootId; wxString m_defaultPath; // Starting path @@ -210,6 +211,13 @@ private: wxDECLARE_NO_COPY_CLASS(wxGenericDirCtrl); }; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRCTRL_CHANGED, wxTreeEvent ); + +#define wx__DECLARE_DIRCTRL_EVT(evt, id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_DIRCTRL_ ## evt, id, wxTreeEventHandler(fn)) + +#define EVT_DIRCTRL_CHANGED(id, fn) wx__DECLARE_DIRCTRL_EVT(CHANGED, id, fn) + //----------------------------------------------------------------------------- // wxDirFilterListCtrl //----------------------------------------------------------------------------- @@ -264,7 +272,9 @@ protected: // wxFileIconsTable - use wxTheFileIconsTable which is created as necessary //------------------------------------------------------------------------- -#if wxUSE_DIRDLG || wxUSE_FILEDLG +#if wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL + +class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_CORE wxFileIconsTable { @@ -298,7 +308,7 @@ protected: // The global fileicons table extern WXDLLIMPEXP_DATA_CORE(wxFileIconsTable *) wxTheFileIconsTable; -#endif // wxUSE_DIRDLG || wxUSE_FILEDLG +#endif // wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL #endif // _WX_DIRCTRLG_H_