+
+ SetPath(defaultPath);
+}
+
+void wxDirDialog::SetPath(const wxString& path)
+{
+ m_path = path;
+
+ // SHBrowseForFolder doesn't like '/'s nor the trailing backslashes
+ m_path.Replace(_T("/"), _T("\\"));
+ if ( !m_path.empty() )
+ {
+ while ( *(m_path.end() - 1) == _T('\\') )
+ {
+ size_t len = m_path.length();
+ if ( len == 1 )
+ {
+ // leave '/' alone
+ break;
+ }
+
+ m_path.erase(len - 1);
+ }
+ }