X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..931d6a47c32a5b4c283243cb553ce71ee2b535d5:/src/common/fldlgcmn.cpp diff --git a/src/common/fldlgcmn.cpp b/src/common/fldlgcmn.cpp index 1d68284280..12ca3a43f0 100644 --- a/src/common/fldlgcmn.cpp +++ b/src/common/fldlgcmn.cpp @@ -4,7 +4,6 @@ // Author: John Labenski // Modified by: // Created: 14.06.03 (extracted from src/*/filedlg.cpp) -// RCS-ID: $Id$ // Copyright: (c) Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -20,6 +19,7 @@ #include "wx/filedlg.h" #include "wx/dirdlg.h" +#include "wx/filename.h" #ifndef WX_PRECOMP #include "wx/string.h" @@ -27,6 +27,16 @@ #include "wx/window.h" #endif // WX_PRECOMP +extern WXDLLEXPORT_DATA(const char) wxFileDialogNameStr[] = "filedlg"; +extern WXDLLEXPORT_DATA(const char) wxFileSelectorPromptStr[] = "Select a file"; +extern WXDLLEXPORT_DATA(const char) wxFileSelectorDefaultWildcardStr[] = +#if defined(__WXMSW__) || defined(__OS2__) + "*.*" +#else // Unix/Mac + "*" +#endif + ; + //---------------------------------------------------------------------------- // wxFileDialogBase //---------------------------------------------------------------------------- @@ -180,6 +190,27 @@ wxSize wxFileDialogBase::GetExtraControlSize() return (*m_extraControlCreator)(&dlg)->GetSize(); } +void wxFileDialogBase::SetPath(const wxString& path) +{ + wxString ext; + wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext); + if ( !ext.empty() ) + m_fileName << wxT('.') << ext; + m_path = path; +} + +void wxFileDialogBase::SetDirectory(const wxString& dir) +{ + m_dir = dir; + m_path = wxFileName(m_dir, m_fileName).GetFullPath(); +} + +void wxFileDialogBase::SetFilename(const wxString& name) +{ + m_fileName = name; + m_path = wxFileName(m_dir, m_fileName).GetFullPath(); +} + //---------------------------------------------------------------------------- // wxFileDialog convenience functions //----------------------------------------------------------------------------