Mercurial > dwindows
comparison mac/dw.m @ 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 | 00fa951abeb5 |
children | 6bb8bff36548 |
comparison
equal
deleted
inserted
replaced
824:c6040726eb92 | 825:8a2e3138e1e4 |
---|---|
2346 * the file path on success. | 2346 * the file path on success. |
2347 * | 2347 * |
2348 */ | 2348 */ |
2349 char * API dw_file_browse(char *title, char *defpath, char *ext, int flags) | 2349 char * API dw_file_browse(char *title, char *defpath, char *ext, int flags) |
2350 { | 2350 { |
2351 if(flags == DW_FILE_OPEN) | 2351 if(flags == DW_FILE_OPEN || flags == DW_DIRECTORY_OPEN) |
2352 { | 2352 { |
2353 /* Create the File Open Dialog class. */ | 2353 /* Create the File Open Dialog class. */ |
2354 NSOpenPanel* openDlg = [NSOpenPanel openPanel]; | 2354 NSOpenPanel* openDlg = [NSOpenPanel openPanel]; |
2355 | 2355 |
2356 /* Enable the selection of files in the dialog. */ | 2356 /* Enable the selection of files in the dialog. */ |
2357 [openDlg setCanChooseFiles:YES]; | 2357 if(flags == DW_FILE_OPEN) |
2358 [openDlg setCanChooseDirectories:NO]; | 2358 { |
2359 [openDlg setCanChooseFiles:YES]; | |
2360 [openDlg setCanChooseDirectories:NO]; | |
2361 } | |
2362 else | |
2363 { | |
2364 [openDlg setCanChooseFiles:NO]; | |
2365 [openDlg setCanChooseDirectories:YES]; | |
2366 } | |
2359 | 2367 |
2360 /* Disable multiple selection */ | 2368 /* Disable multiple selection */ |
2361 [openDlg setAllowsMultipleSelection:NO]; | 2369 [openDlg setAllowsMultipleSelection:NO]; |
2362 | 2370 |
2363 /* Display the dialog. If the OK button was pressed, | 2371 /* Display the dialog. If the OK button was pressed, |