X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/95c854dfc127127d6c980fff134cae2c87b1559d..7c60222510bc5e197b12f153c4bf05db66cb0f4a:/src/osx/cocoa/dirdlg.mm?ds=sidebyside diff --git a/src/osx/cocoa/dirdlg.mm b/src/osx/cocoa/dirdlg.mm index 78b32419d3..02f92f94f8 100644 --- a/src/osx/cocoa/dirdlg.mm +++ b/src/osx/cocoa/dirdlg.mm @@ -32,6 +32,7 @@ #include "wx/filename.h" #include "wx/evtloop.h" +#include "wx/modalhook.h" #include "wx/osx/private.h" @@ -65,7 +66,7 @@ WX_NSOpenPanel wxDirDialog::OSXCreatePanel() const wxCFStringRef cf( m_message ); [oPanel setMessage:cf.AsNSString()]; - if ( HasFlag(wxDD_NEW_DIR_BUTTON) ) + if ( !HasFlag(wxDD_DIR_MUST_EXIST) ) [oPanel setCanCreateDirectories:YES]; return oPanel; @@ -94,6 +95,8 @@ void wxDirDialog::ShowWindowModal() int wxDirDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + wxCFEventLoopPauseIdleEvents pause; NSOpenPanel *oPanel = OSXCreatePanel(); @@ -117,7 +120,7 @@ void wxDirDialog::ModalFinishedCallback(void* panel, int returnCode) if (returnCode == NSOKButton ) { NSOpenPanel* oPanel = (NSOpenPanel*)panel; - SetPath( wxCFStringRef::AsString([[oPanel filenames] objectAtIndex:0])); + SetPath( wxCFStringRef::AsStringWithNormalizationFormC([[oPanel filenames] objectAtIndex:0])); result = wxID_OK; } SetReturnCode(result);