]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix bug [ 1170089 ] wxGenericDirCtrl doesn't show files
authorRobert Roebling <robert@roebling.de>
Wed, 30 Mar 2005 19:45:32 +0000 (19:45 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 30 Mar 2005 19:45:32 +0000 (19:45 +0000)
   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

src/generic/dirctrlg.cpp

index 3a7e8ef87ae0f2c7a92b34a447723d46be527e85..ff84d56790969285c4979de2d057cb3f8c50e83e 100644 (file)
@@ -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