]> git.saurik.com Git - wxWidgets.git/commitdiff
conforming to deprecation recommendation for 10.6
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 16 Feb 2011 16:10:30 +0000 (16:10 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 16 Feb 2011 16:10:30 +0000 (16:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/filedlg.mm

index a505870f3d6a2cda9f01d078f7306c77ad40c9e7..19c84eee0aa81c7c58d896aeee0fb6acc9d03a02 100644 (file)
@@ -200,9 +200,8 @@ void wxFileDialog::ShowWindowModal()
         [oPanel setResolvesAliases:YES];
         [oPanel setCanChooseFiles:YES];
         [oPanel setMessage:cf.AsNSString()];
-        if ( HasFlag(wxFD_MULTIPLE) )
-            [oPanel setAllowsMultipleSelection:YES];
-    
+        [oPanel setAllowsMultipleSelection: (HasFlag(wxFD_MULTIPLE) ? YES : NO )];
+        
         NSWindow* nativeParent = parentWindow->GetWXWindow();
         ModalDialogDelegate* sheetDelegate = [[ModalDialogDelegate alloc] init];
         [sheetDelegate setImplementation: this];
@@ -298,11 +297,20 @@ int wxFileDialog::ShowModal()
         [oPanel setResolvesAliases:YES];
         [oPanel setCanChooseFiles:YES];
         [oPanel setMessage:cf.AsNSString()];
-        if ( HasFlag(wxFD_MULTIPLE) )
-            [oPanel setAllowsMultipleSelection:YES];
+        [oPanel setAllowsMultipleSelection: (HasFlag(wxFD_MULTIPLE) ? YES : NO )];
 
-        returnCode = [oPanel runModalForDirectory:dir.AsNSString()
+        if ( UMAGetSystemVersion() < 0x1060 )
+        {
+            returnCode = [oPanel runModalForDirectory:dir.AsNSString()
                         file:file.AsNSString() types:types];
+        }
+        else 
+        {
+            [oPanel setAllowedFileTypes:types];
+            [oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString() 
+                                               isDirectory:YES]];
+            returnCode = [oPanel runModal];
+        }
 
         ModalFinishedCallback(oPanel, returnCode);