changeset 825:8a2e3138e1e4

Implemented DW_DIRECTORY_OPEN on the Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 26 Mar 2011 14:36:51 +0000
parents c6040726eb92
children 6bb8bff36548
files mac/dw.m
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Sat Mar 26 14:22:44 2011 +0000
+++ b/mac/dw.m	Sat Mar 26 14:36:51 2011 +0000
@@ -2348,14 +2348,22 @@
  */
 char * API dw_file_browse(char *title, char *defpath, char *ext, int flags)
 {
-    if(flags == DW_FILE_OPEN)
+    if(flags == DW_FILE_OPEN || flags == DW_DIRECTORY_OPEN)
     {
         /* Create the File Open Dialog class. */
         NSOpenPanel* openDlg = [NSOpenPanel openPanel];
 
         /* Enable the selection of files in the dialog. */
-        [openDlg setCanChooseFiles:YES];
-        [openDlg setCanChooseDirectories:NO];
+        if(flags == DW_FILE_OPEN)
+        {
+            [openDlg setCanChooseFiles:YES];
+            [openDlg setCanChooseDirectories:NO];
+        }
+        else
+        {
+            [openDlg setCanChooseFiles:NO];
+            [openDlg setCanChooseDirectories:YES];
+        }
 
         /* Disable multiple selection */
         [openDlg setAllowsMultipleSelection:NO];