-#if TARGET_CARBON
- NavDialogCreationOptions mNavOptions;
- NavDialogRef navDialogRef = NULL ;
-// since the same field has been renamed ...
-#define dialogOptionFlags optionFlags
-#else
- NavDialogOptions mNavOptions;
-#endif
- NavObjectFilterUPP mNavFilterUPP = NULL;
- NavPreviewUPP mNavPreviewUPP = NULL ;
- NavReplyRecord mNavReply;
- AEDesc mDefaultLocation ;
- bool mSelectDefault = false ;
- OSStatus err = noErr ;
- // setup dialog
-
- mNavFilterUPP = nil;
- mNavPreviewUPP = nil;
- mSelectDefault = false;
- mDefaultLocation.descriptorType = typeNull;
- mDefaultLocation.dataHandle = nil;
-
-#if TARGET_CARBON
- NavGetDefaultDialogCreationOptions( &mNavOptions ) ;
- wxMacCFStringHolder cfMessage(m_message) ;
- wxMacCFStringHolder cfFileName(m_fileName) ;
- mNavOptions.saveFileName = cfFileName ;
- mNavOptions.message = cfMessage ;
-#else
- NavGetDefaultDialogOptions(&mNavOptions);
- wxMacStringToPascal( m_message , (StringPtr)mNavOptions.message ) ;
- wxMacStringToPascal( m_fileName , (StringPtr)mNavOptions.savedFileName ) ;
-
- // Set default location, the location
- // that's displayed when the dialog
- // first appears
-
- FSSpec location ;
- wxMacFilename2FSSpec( m_dir , &location ) ;
-
- err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation );
-
- if ( mDefaultLocation.dataHandle ) {
-
- if (mSelectDefault) {
- mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
- } else {
- mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
- }
- }
-#endif