]> git.saurik.com Git - wxWidgets.git/commitdiff
Filter index wasn't being set for multiple file dialog
authorJulian Smart <julian@anthemion.co.uk>
Wed, 21 Jan 2004 13:41:12 +0000 (13:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 21 Jan 2004 13:41:12 +0000 (13:41 +0000)
Added several filters to multiple files test in dialogs sample
to test that it's now working

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dialogs/dialogs.cpp
src/msw/filedlg.cpp

index 493a89b5aa6de98dd25704cf2de36f93a03813fc..96d05b980dbad9ba91e53f6c516c00f5b92a9f79 100644 (file)
@@ -518,8 +518,14 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) )
 
 void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
 {
+    wxString wildcards = 
+#ifdef __WXMOTIF__
+                    _T("C++ files (*.cpp)|*.cpp");
+#else
+                    _T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp");
+#endif
     wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
-                        _T(""), _T(""), wxFileSelectorDefaultWildcardStr,
+                        _T(""), _T(""), wildcards,
                         wxMULTIPLE);
 
     if (dialog.ShowModal() == wxID_OK)
@@ -538,6 +544,8 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
 
             msg += s;
         }
+        s.Printf(_T("Filter index: %d"), dialog.GetFilterIndex());
+        msg += s;
 
         wxMessageDialog dialog2(this, msg, _T("Selected files"));
         dialog2.ShowModal();
index 8677731279a52075f4b0e85ba48924241dbb7cd2..b8d7c947e5045230502f715327514157b11a8195 100644 (file)
@@ -340,6 +340,7 @@ int wxFileDialog::ShowModal()
                 dir += _T('\\');
 
             m_path = dir + m_fileName;
+            m_filterIndex = (int)of.nFilterIndex - 1;
         }
         else
         {