X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23318a5358be74727fb62854f623da84a4545bcd..b3ee9f4d2efa4a5088b4c84eb8a0ba712fa7e7fb:/src/common/filectrlcmn.cpp?ds=sidebyside diff --git a/src/common/filectrlcmn.cpp b/src/common/filectrlcmn.cpp index 76ef8187f4..b8d3ec1830 100644 --- a/src/common/filectrlcmn.cpp +++ b/src/common/filectrlcmn.cpp @@ -25,14 +25,24 @@ 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() );