X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd3f686c274a264e89ea97505350a82c1134f307..8c73964939048d046c50ec0240d26d9c36a4e424:/src/msw/filedlg.cpp diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index f5cc104122..4a97a16e14 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -24,8 +24,10 @@ #include #include "wx/defs.h" #include "wx/utils.h" +#include "wx/msgdlg.h" #include "wx/dialog.h" #include "wx/filedlg.h" +#include "wx/intl.h" #endif #include @@ -82,12 +84,36 @@ char *wxFileSelector(const char *title, defaultFilenameString = ""; wxFileDialog fileDialog(parent, title, defaultDirString, defaultFilenameString, filter2, flags, wxPoint(x, y)); - + if(defaultExtension) + { + unsigned int ii; + int filterFind,filterIndex=0; + filterFind=1; + for(ii=0;ii 0 && is+1 < filter2.Length()) + if(filter2.Mid(is+1,ii-is-1) == defaultExtension) + { + filterFind=filterIndex; + break; + } + } + } + fileDialog.SetFilterIndex(filterFind); + } + if ( fileDialog.ShowModal() == wxID_OK ) - { + { strcpy(wxBuffer, (const char *)fileDialog.GetPath()); return wxBuffer; - } + } else return NULL; }