]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/dirdlg.mm
Add wxTimer::StartOnce().
[wxWidgets.git] / src / osx / cocoa / dirdlg.mm
index 78b32419d3475de33b3dfa48d78bb54c30e9f1f0..02f92f94f834021452b8ae1fef664c9c9fce5ede 100644 (file)
@@ -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);