]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/filedlg.cpp
added wxListView class: this is going to be a wxListCtrl with human (inter)face
[wxWidgets.git] / src / msw / filedlg.cpp
index cf25db47e6fa5a5e88972b968045545fe47e484f..29ba5231bd378215943ce1783e62dc08e7423762 100644 (file)
@@ -28,6 +28,8 @@
     #pragma hdrstop
 #endif
 
+#if wxUSE_FILEDLG
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/msgdlg.h"
@@ -118,7 +120,7 @@ wxString wxFileSelector(const wxChar *title,
                             flags, wxPoint(x, y));
     if( wxStrlen(defaultExtension) != 0 )
     {
-        int filterFind = 1,
+        int filterFind = 0,
             filterIndex = 0;
 
         for( unsigned int i = 0; i < filter2.Len(); i++ )
@@ -127,7 +129,6 @@ wxString wxFileSelector(const wxChar *title,
             {
                 // save the start index of the new filter
                 unsigned int is = i++;
-                filterIndex++;
 
                 // find the end of the filter
                 for( ; i < filter2.Len(); i++ )
@@ -139,12 +140,13 @@ wxString wxFileSelector(const wxChar *title,
                 if( i-is-1 > 0 && is+1 < filter2.Len() )
                 {
                     if( filter2.Mid(is+1,i-is-1).Contains(defaultExtension) )
-//                    if( filter2.Mid(is+1,i-is-1) == defaultExtension )
                     {
                         filterFind = filterIndex;
                         break;
                     }
                 }
+
+                filterIndex++;
             }
         }
 
@@ -193,7 +195,7 @@ wxString wxFileSelectorEx(const wxChar *title,
 
 wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
         const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
-        long style, const wxPoint& pos)
+        long style, const wxPoint& WXUNUSED(pos))
 {
     m_message = message;
     m_dialogStyle = style;
@@ -329,8 +331,8 @@ int wxFileDialog::ShowModal()
 
     //== Execute FileDialog >>=================================================
 
-    bool success = (m_dialogStyle & wxSAVE) ? (GetSaveFileName(&of) != 0)
-                                            : (GetOpenFileName(&of) != 0);
+    bool success = (m_dialogStyle & wxSAVE ? GetSaveFileName(&of)
+                                           : GetOpenFileName(&of)) != 0;
 
     DWORD errCode = CommDlgExtendedError();
 
@@ -512,4 +514,5 @@ WXDLLEXPORT wxString wxSaveFileSelector(const wxChar *what,
     return wxDefaultFileSelector(FALSE, what, extension, default_name, parent);
 }
 
+#endif // wxUSE_FILEDLG