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
This commit is contained in:
@@ -533,6 +533,13 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
|
|||||||
m_defaultPath = dir;
|
m_defaultPath = dir;
|
||||||
m_filter = filter;
|
m_filter = filter;
|
||||||
|
|
||||||
|
if (m_filter.empty())
|
||||||
|
#ifdef __UNIX__
|
||||||
|
m_filter = wxT("*");
|
||||||
|
#else
|
||||||
|
m_filter = wxT("*.*");
|
||||||
|
#endif
|
||||||
|
|
||||||
SetFilterIndex(defaultFilter);
|
SetFilterIndex(defaultFilter);
|
||||||
|
|
||||||
if (m_filterListCtrl)
|
if (m_filterListCtrl)
|
||||||
@@ -1090,7 +1097,11 @@ void wxGenericDirCtrl::SetFilterIndex(int n)
|
|||||||
if (ExtractWildcard(m_filter, n, f, d))
|
if (ExtractWildcard(m_filter, n, f, d))
|
||||||
m_currentFilterStr = f;
|
m_currentFilterStr = f;
|
||||||
else
|
else
|
||||||
|
#ifdef __UNIX__
|
||||||
|
m_currentFilterStr = wxT("*");
|
||||||
|
#else
|
||||||
m_currentFilterStr = wxT("*.*");
|
m_currentFilterStr = wxT("*.*");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGenericDirCtrl::SetFilter(const wxString& filter)
|
void wxGenericDirCtrl::SetFilter(const wxString& filter)
|
||||||
@@ -1101,7 +1112,11 @@ void wxGenericDirCtrl::SetFilter(const wxString& filter)
|
|||||||
if (ExtractWildcard(m_filter, m_currentFilter, f, d))
|
if (ExtractWildcard(m_filter, m_currentFilter, f, d))
|
||||||
m_currentFilterStr = f;
|
m_currentFilterStr = f;
|
||||||
else
|
else
|
||||||
|
#ifdef __UNIX__
|
||||||
|
m_currentFilterStr = wxT("*");
|
||||||
|
#else
|
||||||
m_currentFilterStr = wxT("*.*");
|
m_currentFilterStr = wxT("*.*");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract description and actual filter from overall filter string
|
// Extract description and actual filter from overall filter string
|
||||||
|
Reference in New Issue
Block a user