]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fldlgcmn.cpp
Minor corrections to wxFlexGridSizer ctor documentation.
[wxWidgets.git] / src / common / fldlgcmn.cpp
index 1d68284280853a194ae317b5267097ccb82d87e3..f4b4e0a7782e84d9a627547d5ebe8772701a4c20 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "wx/filedlg.h"
 #include "wx/dirdlg.h"
+#include "wx/filename.h"
 
 #ifndef WX_PRECOMP
     #include "wx/string.h"
@@ -180,6 +181,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 << _T('.') << 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
 //----------------------------------------------------------------------------