From: Robert Roebling <robert@roebling.de> Date: Wed, 30 Mar 2005 19:45:32 +0000 (+0000) Subject: Fix bug [ 1170089 ] wxGenericDirCtrl doesn't show files X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dd0138d9a4635a031a12ed9322d1a3d725faaaf6 Fix bug [ 1170089 ] wxGenericDirCtrl doesn't show files by giving the control a sensible default filter "*" or "*.*". git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 3a7e8ef87a..ff84d56790 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -533,6 +533,13 @@ bool wxGenericDirCtrl::Create(wxWindow *parent, m_defaultPath = dir; m_filter = filter; + if (m_filter.empty()) +#ifdef __UNIX__ + m_filter = wxT("*"); +#else + m_filter = wxT("*.*"); +#endif + SetFilterIndex(defaultFilter); if (m_filterListCtrl) @@ -1090,7 +1097,11 @@ void wxGenericDirCtrl::SetFilterIndex(int n) if (ExtractWildcard(m_filter, n, f, d)) m_currentFilterStr = f; else +#ifdef __UNIX__ + m_currentFilterStr = wxT("*"); +#else m_currentFilterStr = wxT("*.*"); +#endif } void wxGenericDirCtrl::SetFilter(const wxString& filter) @@ -1101,7 +1112,11 @@ void wxGenericDirCtrl::SetFilter(const wxString& filter) if (ExtractWildcard(m_filter, m_currentFilter, f, d)) m_currentFilterStr = f; else +#ifdef __UNIX__ + m_currentFilterStr = wxT("*"); +#else m_currentFilterStr = wxT("*.*"); +#endif } // Extract description and actual filter from overall filter string