#include "PLStringFuncs.h"
#endif
-#include "MoreFilesX.h"
-
IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
-extern bool gUseNavServices;
-
// the data we need to pass to our standard file hook routine
// includes a pointer to the dialog, a pointer to the standard
// file reply record (so we can inspect the current selection)
{
// Set default location for the modern Navigation APIs
// Apple Technical Q&A 1151
- FSSpec theFSSpec;
- wxMacFilename2FSSpec(data->defaultLocation, &theFSSpec);
+ FSRef theFile;
+ wxMacPathToFSRef(data->defaultLocation, &theFile);
AEDesc theLocation = { typeNull, NULL };
- if (noErr == ::AECreateDesc(typeFSS, &theFSSpec, sizeof(FSSpec), &theLocation))
+ if (noErr == ::AECreateDesc(typeFSRef, &theFile, sizeof(FSRef), &theLocation))
::NavCustomControl(ioParams->context, kNavCtlSetLocation, (void *) &theLocation);
}
NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ;
if ( !theInfo->isFolder )
{
- if (theItem->descriptorType == typeFSS)
- {
- FSSpec spec;
- memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ;
- wxString file = wxMacMakeStringFromPascal( spec.name ) ;
- display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
- }
- else if ( theItem->descriptorType == typeFSRef )
+ AECoerceDesc (theItem, typeFSRef, theItem);
+
+ FSRef fsref ;
+ if ( AEGetDescData (theItem, &fsref, sizeof (FSRef)) == noErr )
{
- FSRef fsref ;
memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ;
wxString file = wxMacFSRefToPath( &fsref ) ;
display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
NavDialogRef dialog;
NavObjectFilterUPP navFilterUPP = NULL;
- CFArrayRef cfArray = NULL; // for popupExtension
OpenUserDataRec myData;
myData.defaultLocation = m_dir;
// clean up filter related data, etc.
if (navFilterUPP)
::DisposeNavObjectFilterUPP(navFilterUPP);
- if (cfArray)
- ::CFRelease(cfArray);
if (err != noErr)
return wxID_CANCEL;