+void wxFileButton::SetInitialDirectory(const wxString& dir)
+{
+ if (m_dialog)
+ {
+ // Only change the directory if the default file name doesn't have any
+ // directory in it, otherwise it takes precedence.
+ if ( m_path.find_first_of(wxFileName::GetPathSeparators()) ==
+ wxString::npos )
+ {
+ static_cast<wxFileDialog*>(m_dialog)->SetDirectory(dir);
+ }
+ }
+ else
+ wxGenericFileButton::SetInitialDirectory(dir);
+}