X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/260020e39271329f71d1ef7912e3dc8216a2e924..d485bda109d5ef0fef36a3f737549e9b9f54baab:/src/common/filectrlcmn.cpp?ds=sidebyside diff --git a/src/common/filectrlcmn.cpp b/src/common/filectrlcmn.cpp index 17665f27c1..b8d3ec1830 100644 --- a/src/common/filectrlcmn.cpp +++ b/src/common/filectrlcmn.cpp @@ -23,16 +23,26 @@ # include "wx/debug.h" #endif -const wxChar wxFileCtrlNameStr[] = wxT( "wxfilectrl" ); +const char wxFileCtrlNameStr[] = "wxfilectrl"; -DEFINE_EVENT_TYPE( wxEVT_FILECTRL_SELECTIONCHANGED ); -DEFINE_EVENT_TYPE( wxEVT_FILECTRL_FILEACTIVATED ); -DEFINE_EVENT_TYPE( wxEVT_FILECTRL_FOLDERCHANGED ); +wxDEFINE_EVENT( wxEVT_FILECTRL_SELECTIONCHANGED, wxFileCtrlEvent ); +wxDEFINE_EVENT( wxEVT_FILECTRL_FILEACTIVATED, wxFileCtrlEvent ); +wxDEFINE_EVENT( wxEVT_FILECTRL_FOLDERCHANGED, wxFileCtrlEvent ); +wxDEFINE_EVENT( wxEVT_FILECTRL_FILTERCHANGED, wxFileCtrlEvent ); IMPLEMENT_DYNAMIC_CLASS( wxFileCtrlEvent, wxCommandEvent ) // some helper functions +void GenerateFilterChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ) +{ + wxFileCtrlEvent event( wxEVT_FILECTRL_FILTERCHANGED, wnd, wnd->GetId() ); + + event.SetFilterIndex( fileCtrl->GetFilterIndex() ); + + wnd->GetEventHandler()->ProcessEvent( event ); +} + void GenerateFolderChangedEvent( wxFileCtrlBase *fileCtrl, wxWindow *wnd ) { wxFileCtrlEvent event( wxEVT_FILECTRL_FOLDERCHANGED, wnd, wnd->GetId() );