From: David Webster Date: Wed, 21 Aug 2002 04:12:31 +0000 (+0000) Subject: File dialog fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/25fc812c7439ed77f8fb7a8b05fb12a7a11a6cd8 File dialog fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/os2/filedlg.h b/include/wx/os2/filedlg.h index 39b3516ea5..5d106c8bdc 100644 --- a/include/wx/os2/filedlg.h +++ b/include/wx/os2/filedlg.h @@ -18,9 +18,6 @@ * File selector */ -WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr; -WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr; - class WXDLLEXPORT wxFileDialog: public wxDialog { DECLARE_DYNAMIC_CLASS(wxFileDialog) @@ -47,7 +44,7 @@ public: void GetPaths(wxArrayString& rasPath) const; inline wxString GetDirectory(void) const { return m_sDir; } inline wxString GetFilename(void) const { return m_sFileName; } - inline void GetFilenames(wxArrayString& rasFilenames) { rasFilenames.Empty(); rasFilenames.Add( m_sFileName); } + inline void GetFilenames(wxArrayString& rasFilenames) { rasFilenames = m_asFileNames; } inline wxString GetWildcard(void) const { return m_sWildCard; } inline long GetStyle(void) const { return m_lDialogStyle; } inline int GetFilterIndex() const { return m_nFilterIndex ; } diff --git a/src/os2/filedlg.cpp b/src/os2/filedlg.cpp index 605d1b2cc4..cb87d850f1 100644 --- a/src/os2/filedlg.cpp +++ b/src/os2/filedlg.cpp @@ -332,6 +332,7 @@ int wxFileDialog::ShowModal() if (sDir.IsEmpty()) sDir = "*.*"; wxStrcpy(vFileDlg.szFullFile, sDir.c_str()); + sFilterBuffer = sDir; hWnd = ::WinFileDlg( HWND_DESKTOP ,GetHwndOf(m_pParent) @@ -367,8 +368,14 @@ int wxFileDialog::ShowModal() wxStrcpy(zFileNameBuffer, vFileDlg.szFullFile); int nIdx = wxStrlen(zFileNameBuffer) - 1; + wxString sExt; - if (zFileNameBuffer[nIdx] == wxT('.') ) + wxSplitPath( zFileNameBuffer + ,&m_sPath + ,&m_sFileName + ,&sExt + ); + if (zFileNameBuffer[nIdx] == wxT('.') || sExt.IsEmpty()) { zFileNameBuffer[nIdx] = wxT('\0');