X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/75cb911c7c8a475269901bf5f0c69c583d79e498..a9c5eac9e49fd0b76178e0edfd04ae5c83bc3f02:/src/generic/filepickerg.cpp diff --git a/src/generic/filepickerg.cpp b/src/generic/filepickerg.cpp index edfcfc5fea..3d5b975a9a 100644 --- a/src/generic/filepickerg.cpp +++ b/src/generic/filepickerg.cpp @@ -139,14 +139,19 @@ wxDialog *wxGenericFileButton::CreateDialog() GetDialogStyle() ); - // this sets both the default folder and the default file of the dialog - dialog->SetPath(m_path); - // If there is no default file or if it doesn't have any path, use the // explicitly set initial directory. + // + // Notice that it is important to call this before SetPath() below as if we + // do have m_initialDir and no directory in m_path, we need to interpret + // the path as being relative with respect to m_initialDir. if ( !m_initialDir.empty() ) DoSetInitialDirectory(dialog, m_initialDir); + // This sets both the default file name and the default directory of the + // dialog if m_path contains directory part. + dialog->SetPath(m_path); + return dialog; }