Previously the file type would solely be based on the extension of the passed filename. This is still done, but any valid filter index as set by the user will now take precedence.
See also #12429.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67551
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
long style, const wxPoint& pos, const wxSize& sz, const wxString& name)
: wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos, sz, name)
{
long style, const wxPoint& pos, const wxSize& sz, const wxString& name)
: wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos, sz, name)
{
}
bool wxFileDialog::SupportsExtraControl() const
}
bool wxFileDialog::SupportsExtraControl() const
m_path = wxEmptyString;
m_fileNames.Clear();
m_paths.Clear();
m_path = wxEmptyString;
m_fileNames.Clear();
m_paths.Clear();
- // since we don't support retrieving the matching filter
- m_filterIndex = -1;
wxNonOwnedWindow* parentWindow = NULL;
int returnCode = -1;
wxNonOwnedWindow* parentWindow = NULL;
int returnCode = -1;
}
m_firstFileTypeFilter = -1;
}
m_firstFileTypeFilter = -1;
-
- if ( m_useFileTypeFilter )
+
+ if ( m_useFileTypeFilter
+ && m_filterIndex >= 0 && m_filterIndex < m_filterExtensions.GetCount() )
+ {
+ m_firstFileTypeFilter = m_filterIndex;
+ }
+ else if ( m_useFileTypeFilter )
{
types = nil;
bool useDefault = true;
{
types = nil;
bool useDefault = true;