X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c39e82f097ecdc5fc9ad24f67e1c71458d4d1ae3..6f28211af2258ce0c052e5b5c1d862e7bbc8de27:/src/msw/filedlg.cpp diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index ba52c18fcc..7888780761 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "filedlg.h" #endif @@ -28,7 +28,7 @@ #pragma hdrstop #endif -#if wxUSE_FILEDLG && !wxUSE_SMARTPHONE +#if wxUSE_FILEDLG && !defined(__SMARTPHONE__) #ifndef WX_PRECOMP #include "wx/utils.h" @@ -113,6 +113,11 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const } } +void wxFileDialog::GetFilenames(wxArrayString& files) const +{ + files = m_fileNames; +} + void wxFileDialog::SetPath(const wxString& path) { wxString ext; @@ -152,13 +157,12 @@ int wxFileDialog::ShowModal() { msw_flags |= OFN_NOCHANGEDIR; } -/* chris elliott for some reason this does not work usefully if no extension - is given, as it test for junk instead of junk.ext + if ( m_dialogStyle & wxOVERWRITE_PROMPT ) { msw_flags |= OFN_OVERWRITEPROMPT; } -*/ + OPENFILENAME of; wxZeroMemory(of); @@ -336,6 +340,7 @@ int wxFileDialog::ShowModal() dir += _T('\\'); m_path = dir + m_fileName; + m_filterIndex = (int)of.nFilterIndex - 1; } else { @@ -363,18 +368,6 @@ int wxFileDialog::ShowModal() m_fileNames.Add(m_fileName); m_dir = wxPathOnly(fileNameBuffer); } - //=== Simulating the wxOVERWRITE_PROMPT >>============================ - //should we also test for file save style ?? - if ( (m_dialogStyle & wxOVERWRITE_PROMPT) && - ::wxFileExists( fileNameBuffer ) ) - { - wxString messageText; - messageText.Printf(_("File '%s' already exists.\nDo you want to replace it?"), fileNameBuffer); - if ( wxMessageBox(messageText, wxT("Save File As"), wxYES_NO | wxICON_EXCLAMATION ) != wxYES ) - { - success = FALSE; - } - } } else {