// Author: John Labenski
// Modified by:
// Created: 14.06.03 (extracted from src/*/filedlg.cpp)
-// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/filedlg.h"
#include "wx/dirdlg.h"
+#include "wx/filename.h"
#ifndef WX_PRECOMP
#include "wx/string.h"
#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
//----------------------------------------------------------------------------
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
//----------------------------------------------------------------------------