mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
NFD updated to 1.1.4
This commit is contained in:
parent
3d94cb5b93
commit
b0aa733c4e
6 changed files with 658 additions and 68 deletions
|
|
@ -117,7 +117,7 @@ static nfdresult_t AllocPathSet( NSArray *urls, nfdpathset_t *pathset )
|
|||
/* public */
|
||||
|
||||
|
||||
nfdresult_t NFD_OpenDialog( const char *filterList,
|
||||
nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList,
|
||||
const nfdchar_t *defaultPath,
|
||||
nfdchar_t **outPath )
|
||||
{
|
||||
|
|
@ -146,6 +146,7 @@ nfdresult_t NFD_OpenDialog( const char *filterList,
|
|||
if ( !*outPath )
|
||||
{
|
||||
[pool release];
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
return NFD_ERROR;
|
||||
}
|
||||
memcpy( *outPath, utf8Path, len+1 ); /* copy null term */
|
||||
|
|
@ -163,6 +164,7 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
|
|||
nfdpathset_t *outPaths )
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
|
||||
|
||||
NSOpenPanel *dialog = [NSOpenPanel openPanel];
|
||||
[dialog setAllowsMultipleSelection:YES];
|
||||
|
|
@ -181,12 +183,14 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
|
|||
if ( [urls count] == 0 )
|
||||
{
|
||||
[pool release];
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
return NFD_CANCEL;
|
||||
}
|
||||
|
||||
if ( AllocPathSet( urls, outPaths ) == NFD_ERROR )
|
||||
{
|
||||
[pool release];
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
return NFD_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -194,6 +198,7 @@ nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
|
|||
}
|
||||
[pool release];
|
||||
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
return nfdResult;
|
||||
}
|
||||
|
||||
|
|
@ -203,7 +208,8 @@ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
|
|||
nfdchar_t **outPath )
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
|
||||
|
||||
NSSavePanel *dialog = [NSSavePanel savePanel];
|
||||
[dialog setExtensionHidden:NO];
|
||||
|
||||
|
|
@ -225,6 +231,7 @@ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
|
|||
if ( !*outPath )
|
||||
{
|
||||
[pool release];
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
return NFD_ERROR;
|
||||
}
|
||||
memcpy( *outPath, utf8Path, byteLen );
|
||||
|
|
@ -232,7 +239,7 @@ nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
|
|||
}
|
||||
|
||||
[pool release];
|
||||
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
return nfdResult;
|
||||
}
|
||||
|
||||
|
|
@ -241,7 +248,7 @@ nfdresult_t NFD_PickFolder(const nfdchar_t *defaultPath,
|
|||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
|
||||
NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow];
|
||||
NSOpenPanel *dialog = [NSOpenPanel openPanel];
|
||||
[dialog setAllowsMultipleSelection:NO];
|
||||
[dialog setCanChooseDirectories:YES];
|
||||
|
|
@ -264,6 +271,7 @@ nfdresult_t NFD_PickFolder(const nfdchar_t *defaultPath,
|
|||
if ( !*outPath )
|
||||
{
|
||||
[pool release];
|
||||
[keyWindow makeKeyAndOrderFront:nil];
|
||||
return NFD_ERROR;
|
||||
}
|
||||
memcpy( *outPath, utf8Path, len+1 ); /* copy null term */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue