Fix setting the title for the wxDirDialog on OSX

OSX 10.11+ doesn't actually display the title, so update documentation
to reference SetMessage instead. For pre-10.11 override the SetTitle
method to set the title of the NSOpenPanel instead of the window.

Also change so the directory is not updated unless it is provided.

Closes #15143.
This commit is contained in:
Ian McInerney
2020-01-17 00:59:16 +00:00
committed by Vadim Zeitlin
parent 61afcae0be
commit 7230acd110
3 changed files with 22 additions and 0 deletions

View File

@@ -47,6 +47,10 @@ public:
virtual int ShowModal() wxOVERRIDE;
// MacOS 10.11 has removed the titlebar from the dialog, so this is provided
// only for compatibility with older versions
virtual void SetTitle(const wxString& title) wxOVERRIDE;
virtual wxString GetPath() const wxOVERRIDE;
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE;
@@ -69,6 +73,7 @@ private:
void Init();
wxArrayString m_paths;
wxString m_title;
wxDECLARE_DYNAMIC_CLASS(wxDirDialog);
};