X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23318a5358be74727fb62854f623da84a4545bcd..ad653fa23069c5d9378247084f03c9a718c3ad62:/src/common/filectrlcmn.cpp 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() );