X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b4da62701dbe8ccfbe447ce8d1bc77fcb40e9e5..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/filectrl.h diff --git a/include/wx/filectrl.h b/include/wx/filectrl.h index ad22cebdcf..e4c302f7d5 100644 --- a/include/wx/filectrl.h +++ b/include/wx/filectrl.h @@ -5,7 +5,6 @@ // Author: Diaa M. Sami // Modified by: // Created: Jul-07-2007 -// RCS-ID: $Id$ // Copyright: (c) Diaa M. Sami // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -29,11 +28,7 @@ enum }; #define wxFC_DEFAULT_STYLE wxFC_OPEN -extern WXDLLEXPORT_DATA( const wxChar ) wxFileCtrlNameStr[]; // in filectrlcmn.cpp - -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_SELECTIONCHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_FILEACTIVATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_FOLDERCHANGED; +extern WXDLLIMPEXP_DATA_CORE(const char) wxFileCtrlNameStr[]; // in filectrlcmn.cpp class WXDLLIMPEXP_CORE wxFileCtrlBase { @@ -67,6 +62,7 @@ public: virtual void ShowHidden(bool show) = 0; }; +void GenerateFilterChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ); void GenerateFolderChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ); void GenerateSelectionChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ); void GenerateFileActivatedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd, const wxString filename = wxEmptyString ); @@ -80,6 +76,8 @@ void GenerateFileActivatedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd, const #endif // Some documentation +// On wxEVT_FILECTRL_FILTERCHANGED, only the value returned by GetFilterIndex is +// valid and it represents the (new) current filter index for the wxFileCtrl. // On wxEVT_FILECTRL_FOLDERCHANGED, only the value returned by GetDirectory is // valid and it represents the (new) current directory for the wxFileCtrl. // On wxEVT_FILECTRL_FILEACTIVATED, GetDirectory returns the current directory @@ -104,13 +102,16 @@ public: void SetFiles( const wxArrayString &files ) { m_files = files; } void SetDirectory( const wxString &directory ) { m_directory = directory; } + void SetFilterIndex( int filterIndex ) { m_filterIndex = filterIndex; } wxArrayString GetFiles() const { return m_files; } wxString GetDirectory() const { return m_directory; } + int GetFilterIndex() const { return m_filterIndex; } wxString GetFile() const; protected: + int m_filterIndex; wxString m_directory; wxArrayString m_files; @@ -119,8 +120,13 @@ protected: typedef void ( wxEvtHandler::*wxFileCtrlEventFunction )( wxFileCtrlEvent& ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILECTRL_SELECTIONCHANGED, wxFileCtrlEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILECTRL_FILEACTIVATED, wxFileCtrlEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILECTRL_FOLDERCHANGED, wxFileCtrlEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILECTRL_FILTERCHANGED, wxFileCtrlEvent ); + #define wxFileCtrlEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFileCtrlEventFunction, &func) + wxEVENT_HANDLER_CAST( wxFileCtrlEventFunction, func ) #define EVT_FILECTRL_FILEACTIVATED(id, fn) \ wx__DECLARE_EVT1(wxEVT_FILECTRL_FILEACTIVATED, id, wxFileCtrlEventHandler(fn)) @@ -131,6 +137,9 @@ typedef void ( wxEvtHandler::*wxFileCtrlEventFunction )( wxFileCtrlEvent& ); #define EVT_FILECTRL_FOLDERCHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_FILECTRL_FOLDERCHANGED, id, wxFileCtrlEventHandler(fn)) +#define EVT_FILECTRL_FILTERCHANGED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_FILECTRL_FILTERCHANGED, id, wxFileCtrlEventHandler(fn)) + #endif // wxUSE_FILECTRL #endif // _WX_FILECTRL_H_BASE_