]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/filedlgg.cpp
Add some more docs to the runtime installer.
[wxWidgets.git] / src / generic / filedlgg.cpp
index febc457bfea0c74a089ca2aadc73d646cda1451b..0cf73c397e1c52f98b76b56234f8c715bda5cb66 100644 (file)
@@ -135,7 +135,7 @@ int wxCALLBACK wxFileDataTimeCompare( long data1, long data2, long data)
      return fd1->GetDateTime().IsLaterThan(fd2->GetDateTime()) ? int(data) : -int(data);
 }
 
-#if defined(__UNIX__) && !defined(__OS2__)
+#if defined(__UNIX__) && !defined(__OS2__) && !defined(__CYGWIN__)
 #define IsTopMostDir(dir)   (dir == wxT("/"))
 #endif
 
@@ -915,7 +915,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
 {
     m_bypassGenericImpl = bypassGenericImpl;
 
-    if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFile, 
+    if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFile,
                                   wildCard, style, pos))
     {
         return false;
@@ -1151,12 +1151,13 @@ void wxGenericFileDialog::SetWildcard(const wxString& wildCard)
                                                     wildFilters);
     wxCHECK_RET( count, wxT("wxFileDialog: bad wildcard string") );
 
-    size_t n, old_count = m_choice->GetCount();
-    for ( n = 0; n < count; n++ )
+    const size_t countOld = m_choice->GetCount();
+    size_t n;
+    for ( n = 0; n < countOld; n++ )
     {
         delete (wxString *)m_choice->GetClientData(n);
     }
-    
+
     for ( n = 0; n < count; n++ )
     {
         m_choice->Append( wildDescriptions[n], new wxString( wildFilters[n] ) );
@@ -1266,16 +1267,19 @@ void wxGenericFileDialog::HandleAction( const wxString &fn )
     }
 #endif // __UNIX__
 
-    if ((filename.Find(wxT('*')) != wxNOT_FOUND) ||
-        (filename.Find(wxT('?')) != wxNOT_FOUND))
+    if (!(m_dialogStyle & wxSAVE))
     {
-        if (filename.Find(wxFILE_SEP_PATH) != wxNOT_FOUND)
+        if ((filename.Find(wxT('*')) != wxNOT_FOUND) ||
+            (filename.Find(wxT('?')) != wxNOT_FOUND))
         {
-            wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR );
+            if (filename.Find(wxFILE_SEP_PATH) != wxNOT_FOUND)
+            {
+                wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR );
+                return;
+            }
+            m_list->SetWild( filename );
             return;
         }
-        m_list->SetWild( filename );
-        return;
     }
 
     if (!IsTopMostDir(dir))