]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/filedlg.cpp
9c7cd9f6b41feee17fd0f70ce52850ad58042da7
[wxWidgets.git] / src / mac / carbon / filedlg.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: filedlg.cpp
3 // Purpose: wxFileDialog
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "filedlg.h"
14 #endif
15
16 #include "wx/defs.h"
17 #include "wx/app.h"
18 #include "wx/utils.h"
19 #include "wx/dialog.h"
20 #include "wx/filedlg.h"
21 #include "wx/intl.h"
22 #include "wx/tokenzr.h"
23 #include "wx/filename.h"
24
25 #ifndef __DARWIN__
26 #include "PLStringFuncs.h"
27 #endif
28
29 #if !USE_SHARED_LIBRARY
30 IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
31 #endif
32
33 // begin wxmac
34
35 #include "wx/mac/private.h"
36
37 #include <Navigation.h>
38
39 #ifdef __DARWIN__
40 # include "MoreFilesX.h"
41 #else
42 # include "MoreFiles.h"
43 # include "MoreFilesExtras.h"
44 #endif
45
46 extern bool gUseNavServices ;
47
48 // the data we need to pass to our standard file hook routine
49 // includes a pointer to the dialog, a pointer to the standard
50 // file reply record (so we can inspect the current selection)
51 // and a copy of the "previous" file spec of the reply record
52 // so we can see if the selection has changed
53
54 struct OpenUserDataRec {
55 int currentfilter ;
56 bool saveMode ;
57 wxArrayString name ;
58 wxArrayString extensions ;
59 wxArrayLong filtermactypes ;
60 wxString defaultLocation;
61 #if TARGET_CARBON
62 CFArrayRef menuitems ;
63 #else
64 NavMenuItemSpecArrayHandle menuitems ;
65 #endif
66 };
67
68 typedef struct OpenUserDataRec
69 OpenUserDataRec, *OpenUserDataRecPtr;
70
71 static pascal void NavEventProc(
72 NavEventCallbackMessage inSelector,
73 NavCBRecPtr ioParams,
74 NavCallBackUserData ioUserData);
75
76 #if TARGET_CARBON
77 static NavEventUPP sStandardNavEventFilter = NewNavEventUPP(NavEventProc);
78 #else
79 static NavEventUPP sStandardNavEventFilter = NewNavEventProc(NavEventProc);
80 #endif
81
82 static pascal void
83 NavEventProc(
84 NavEventCallbackMessage inSelector,
85 NavCBRecPtr ioParams,
86 NavCallBackUserData ioUserData )
87 {
88 OpenUserDataRec * data = ( OpenUserDataRec *) ioUserData ;
89 if (inSelector == kNavCBEvent) {
90 #if TARGET_CARBON
91 #else
92 wxTheApp->MacHandleOneEvent(ioParams->eventData.eventDataParms.event);
93 #endif
94 }
95 else if ( inSelector == kNavCBStart )
96 {
97 #if TARGET_CARBON
98 if (data && !(data->defaultLocation).IsEmpty())
99 {
100 // Set default location for the modern Navigation APIs
101 // Apple Technical Q&A 1151
102 FSSpec theFSSpec;
103 wxMacFilename2FSSpec(data->defaultLocation, &theFSSpec);
104 AEDesc theLocation = {typeNull, NULL};
105 if (noErr == ::AECreateDesc(typeFSS, &theFSSpec, sizeof(FSSpec), &theLocation))
106 ::NavCustomControl(ioParams->context, kNavCtlSetLocation, (void *) &theLocation);
107 }
108
109 NavMenuItemSpec menuItem;
110 menuItem.version = kNavMenuItemSpecVersion;
111 menuItem.menuCreator = 'WXNG';
112 menuItem.menuType = data->currentfilter;
113 wxMacStringToPascal( data->name[data->currentfilter] , (StringPtr)(menuItem.menuItemName) ) ;
114 ::NavCustomControl(ioParams->context, kNavCtlSelectCustomType, &menuItem);
115
116 #else
117 if ( data->menuitems )
118 NavCustomControl(ioParams->context, kNavCtlSelectCustomType, &(*data->menuitems)[data->currentfilter]);
119 #endif
120 }
121 else if ( inSelector == kNavCBPopupMenuSelect )
122 {
123 NavMenuItemSpec * menu = (NavMenuItemSpec *) ioParams->eventData.eventDataParms.param ;
124 #if TARGET_CARBON
125 const size_t numFilters = data->extensions.GetCount();
126
127 if ( menu->menuType < numFilters )
128 #else
129 if ( menu->menuCreator == 'WXNG' )
130 #endif
131 {
132 data->currentfilter = menu->menuType ;
133 if ( data->saveMode )
134 {
135 int i = menu->menuType ;
136 wxString extension = data->extensions[i].AfterLast('.') ;
137 extension.MakeLower() ;
138 wxString sfilename ;
139
140 #if TARGET_CARBON
141 wxMacCFStringHolder cfString( NavDialogGetSaveFileName( ioParams->context ) , false );
142 sfilename = cfString.AsString() ;
143 #else
144 Str255 filename ;
145 // get the current filename
146 NavCustomControl(ioParams->context, kNavCtlGetEditFileName, &filename);
147 sfilename = wxMacMakeStringFromPascal( filename ) ;
148 #endif
149
150 int pos = sfilename.Find('.', true) ;
151 if ( pos != wxNOT_FOUND )
152 {
153 sfilename = sfilename.Left(pos+1)+extension ;
154 #if TARGET_CARBON
155 cfString.Assign( sfilename , wxFONTENCODING_DEFAULT ) ;
156 NavDialogSetSaveFileName( ioParams->context , cfString ) ;
157 #else
158 wxMacStringToPascal( sfilename , filename ) ;
159 NavCustomControl(ioParams->context, kNavCtlSetEditFileName, &filename);
160 #endif
161 }
162 }
163 }
164 }
165 }
166
167
168 void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter )
169 {
170 myData->menuitems = NULL ;
171 myData->currentfilter = 0 ;
172 myData->saveMode = false ;
173
174 if ( filter && filter[0] )
175 {
176 wxString filter2(filter) ;
177 int filterIndex = 0;
178 bool isName = true ;
179 wxString current ;
180 for( unsigned int i = 0; i < filter2.Len() ; i++ )
181 {
182 if( filter2.GetChar(i) == wxT('|') )
183 {
184 if( isName ) {
185 myData->name.Add( current ) ;
186 }
187 else {
188 myData->extensions.Add( current.MakeUpper() ) ;
189 ++filterIndex ;
190 }
191 isName = !isName ;
192 current = wxEmptyString ;
193 }
194 else
195 {
196 current += filter2.GetChar(i) ;
197 }
198 }
199 // we allow for compatibility reason to have a single filter expression (like *.*) without
200 // an explanatory text, in that case the first part is name and extension at the same time
201
202 wxASSERT_MSG( filterIndex == 0 || !isName , wxT("incorrect format of format string") ) ;
203 if ( current.IsEmpty() )
204 myData->extensions.Add( myData->name[filterIndex] ) ;
205 else
206 myData->extensions.Add( current.MakeUpper() ) ;
207 if ( filterIndex == 0 || isName )
208 myData->name.Add( current.MakeUpper() ) ;
209
210 ++filterIndex ;
211
212 const size_t extCount = myData->extensions.GetCount();
213 for ( size_t i = 0 ; i < extCount; i++ )
214 {
215 wxUint32 fileType;
216 wxUint32 creator;
217 wxString extension = myData->extensions[i];
218
219 if (extension.GetChar(0) == '*')
220 extension = extension.Mid(1); // Remove leading *
221
222 if (extension.GetChar(0) == '.')
223 {
224 extension = extension.Mid(1); // Remove leading .
225 }
226
227 if (wxFileName::MacFindDefaultTypeAndCreator( extension, &fileType, &creator ))
228 {
229 myData->filtermactypes.Add( (OSType)fileType );
230 }
231 else
232 {
233 myData->filtermactypes.Add( '****' ) ; // We'll fail safe if it's not recognized
234 }
235 }
236 }
237 }
238
239 static Boolean CheckFile( const wxString &filename , OSType type , OpenUserDataRecPtr data)
240 {
241 wxString file(filename) ;
242 file.MakeUpper() ;
243
244 if ( data->extensions.GetCount() > 0 )
245 {
246 //for ( int i = 0 ; i < data->numfilters ; ++i )
247 int i = data->currentfilter ;
248 if ( data->extensions[i].Right(2) == wxT(".*") )
249 return true ;
250
251 {
252 if ( type == (OSType)data->filtermactypes[i] )
253 return true ;
254
255 wxStringTokenizer tokenizer( data->extensions[i] , wxT(";") ) ;
256 while( tokenizer.HasMoreTokens() )
257 {
258 wxString extension = tokenizer.GetNextToken() ;
259 if ( extension.GetChar(0) == '*' )
260 extension = extension.Mid(1) ;
261
262 if ( file.Len() >= extension.Len() && extension == file.Right(extension.Len() ) )
263 return true ;
264 }
265 }
266 return false ;
267 }
268 return true ;
269 }
270
271 #ifndef __DARWIN__
272 static pascal Boolean CrossPlatformFileFilter(CInfoPBPtr myCInfoPBPtr, void *dataPtr)
273 {
274 OpenUserDataRecPtr data = (OpenUserDataRecPtr) dataPtr ;
275 // return true if this item is invisible or a file
276
277 Boolean visibleFlag;
278 Boolean folderFlag;
279
280 visibleFlag = ! (myCInfoPBPtr->hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible);
281 folderFlag = (myCInfoPBPtr->hFileInfo.ioFlAttrib & 0x10);
282
283 // because the semantics of the filter proc are "true means don't show
284 // it" we need to invert the result that we return
285
286 if ( !visibleFlag )
287 return true ;
288
289 if ( !folderFlag )
290 {
291 wxString file = wxMacMakeStringFromPascal( myCInfoPBPtr->hFileInfo.ioNamePtr ) ;
292 return !CheckFile( file , myCInfoPBPtr->hFileInfo.ioFlFndrInfo.fdType , data ) ;
293 }
294
295 return false ;
296 }
297 #endif
298
299 // end wxmac
300
301 wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
302 const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
303 long style, const wxPoint& pos)
304 :wxFileDialogBase(parent, message, defaultDir, defaultFileName, wildCard, style, pos)
305 {
306 wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ;
307 }
308
309 pascal Boolean CrossPlatformFilterCallback (
310 AEDesc *theItem,
311 void *info,
312 void *callBackUD,
313 NavFilterModes filterMode
314 )
315 {
316 bool display = true;
317 OpenUserDataRecPtr data = (OpenUserDataRecPtr) callBackUD ;
318
319 if (filterMode == kNavFilteringBrowserList)
320 {
321 NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*) info ;
322 if ( !theInfo->isFolder )
323 {
324 if (theItem->descriptorType == typeFSS )
325 {
326 FSSpec spec;
327 memcpy( &spec , *theItem->dataHandle , sizeof(FSSpec) ) ;
328 wxString file = wxMacMakeStringFromPascal( spec.name ) ;
329 display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
330 }
331 #if TARGET_CARBON
332 else if ( theItem->descriptorType == typeFSRef )
333 {
334 FSRef fsref ;
335 memcpy( &fsref , *theItem->dataHandle , sizeof(FSRef) ) ;
336
337
338
339 CFURLRef fullURLRef;
340 fullURLRef = ::CFURLCreateFromFSRef(NULL, &fsref);
341 #ifdef __UNIX__
342 CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle;
343 #else
344 CFURLPathStyle pathstyle = kCFURLHFSPathStyle;
345 #endif
346 CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle);
347 ::CFRelease( fullURLRef ) ;
348 wxString file = wxMacCFStringHolder(cfString).AsString(wxFont::GetDefaultEncoding());
349
350 display = CheckFile( file , theInfo->fileAndFolder.fileInfo.finderInfo.fdType , data ) ;
351 }
352 #endif
353 }
354 }
355
356 return display;
357 }
358
359 int wxFileDialog::ShowModal()
360 {
361 #if TARGET_CARBON
362 OSErr err;
363 NavDialogCreationOptions dialogCreateOptions;
364 // set default options
365 ::NavGetDefaultDialogCreationOptions(&dialogCreateOptions);
366
367 // this was always unset in the old code
368 dialogCreateOptions.optionFlags &= ~kNavSelectDefaultLocation;
369
370 wxMacCFStringHolder message(m_message, m_font.GetEncoding());
371 dialogCreateOptions.windowTitle = message;
372
373 wxMacCFStringHolder defaultFileName(m_fileName, m_font.GetEncoding());
374 dialogCreateOptions.saveFileName = defaultFileName;
375
376
377 NavDialogRef dialog;
378 NavObjectFilterUPP navFilterUPP = NULL;
379 CFArrayRef cfArray = NULL; // for popupExtension
380 OpenUserDataRec myData;
381 myData.defaultLocation = m_dir;
382
383 MakeUserDataRec(&myData , m_wildCard);
384 myData.currentfilter = m_filterIndex;
385 size_t numFilters = myData.extensions.GetCount();
386 if (numFilters)
387 {
388 CFMutableArrayRef popup = CFArrayCreateMutable( kCFAllocatorDefault ,
389 numFilters , &kCFTypeArrayCallBacks ) ;
390 dialogCreateOptions.popupExtension = popup ;
391 myData.menuitems = dialogCreateOptions.popupExtension ;
392 for ( size_t i = 0 ; i < numFilters ; ++i )
393 {
394 CFArrayAppendValue( popup , (CFStringRef) wxMacCFStringHolder( myData.name[i] , m_font.GetEncoding() ) ) ;
395 }
396 }
397
398 if (m_dialogStyle & wxSAVE)
399 {
400 myData.saveMode = true;
401
402 if (!numFilters)
403 {
404 dialogCreateOptions.optionFlags |= kNavNoTypePopup;
405 }
406 dialogCreateOptions.optionFlags |= kNavDontAutoTranslate;
407 dialogCreateOptions.optionFlags |= kNavDontAddTranslateItems;
408
409 // The extension is important
410 if (numFilters < 2)
411 dialogCreateOptions.optionFlags |= kNavPreserveSaveFileExtension;
412
413 err = ::NavCreatePutFileDialog(&dialogCreateOptions,
414 // Suppresses the 'Default' (top) menu item
415 kNavGenericSignature, kNavGenericSignature,
416 sStandardNavEventFilter,
417 &myData, // for defaultLocation
418 &dialog);
419 }
420 else
421 {
422
423 //let people select bundles/programs in dialogs
424 dialogCreateOptions.optionFlags |= kNavSupportPackages;
425
426 navFilterUPP = NewNavObjectFilterUPP(CrossPlatformFilterCallback);
427 err = ::NavCreateGetFileDialog(&dialogCreateOptions,
428 NULL, // NavTypeListHandle
429 sStandardNavEventFilter,
430 NULL, // NavPreviewUPP
431 navFilterUPP,
432 (void *) &myData, // inClientData
433 &dialog);
434 }
435
436 if (err == noErr)
437 err = ::NavDialogRun(dialog);
438
439 // clean up filter related data, etc.
440 if (navFilterUPP)
441 ::DisposeNavObjectFilterUPP(navFilterUPP);
442 if (cfArray)
443 ::CFRelease(cfArray);
444
445 if (err != noErr)
446 return wxID_CANCEL;
447
448 NavReplyRecord navReply;
449 err = ::NavDialogGetReply(dialog, &navReply);
450 if (err == noErr && navReply.validRecord)
451 {
452 AEKeyword theKeyword;
453 DescType actualType;
454 Size actualSize;
455 FSRef theFSRef;
456 wxString thePath ;
457
458 m_filterIndex = myData.currentfilter ;
459
460 long count;
461 ::AECountItems(&navReply.selection , &count);
462 for (long i = 1; i <= count; ++i)
463 {
464 err = ::AEGetNthPtr(&(navReply.selection), i, typeFSRef, &theKeyword, &actualType,
465 &theFSRef, sizeof(theFSRef), &actualSize);
466 if (err != noErr)
467 break;
468
469 CFURLRef fullURLRef = 0 ;
470 if (m_dialogStyle & wxSAVE)
471 {
472 CFURLRef parentURLRef = ::CFURLCreateFromFSRef(NULL, &theFSRef);
473
474 if (parentURLRef)
475 {
476 fullURLRef =
477 ::CFURLCreateCopyAppendingPathComponent(NULL,
478 parentURLRef,
479 navReply.saveFileName,
480 false);
481 ::CFRelease(parentURLRef);
482 }
483 }
484 else
485 {
486 fullURLRef = ::CFURLCreateFromFSRef(NULL, &theFSRef);
487 }
488 #ifdef __UNIX__
489 CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle;
490 #else
491 CFURLPathStyle pathstyle = kCFURLHFSPathStyle;
492 #endif
493 CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle);
494 thePath = wxMacCFStringHolder(cfString).AsString(m_font.GetEncoding());
495 if (!thePath)
496 {
497 ::NavDisposeReply(&navReply);
498 return wxID_CANCEL;
499 }
500 m_path = thePath;
501 m_paths.Add(m_path);
502 m_fileName = wxFileNameFromPath(m_path);
503 m_fileNames.Add(m_fileName);
504 }
505 // set these to the first hit
506 m_path = m_paths[0];
507 m_fileName = wxFileNameFromPath(m_path);
508 m_dir = wxPathOnly(m_path);
509 }
510 ::NavDisposeReply(&navReply);
511
512 return (err == noErr) ? wxID_OK : wxID_CANCEL;
513 #else // TARGET_CARBON
514
515 NavDialogOptions mNavOptions;
516 NavObjectFilterUPP mNavFilterUPP = NULL;
517 NavPreviewUPP mNavPreviewUPP = NULL ;
518 NavReplyRecord mNavReply;
519 AEDesc mDefaultLocation ;
520 bool mSelectDefault = false ;
521 OSStatus err = noErr ;
522 // setup dialog
523
524 mNavFilterUPP = nil;
525 mNavPreviewUPP = nil;
526 mSelectDefault = false;
527 mDefaultLocation.descriptorType = typeNull;
528 mDefaultLocation.dataHandle = nil;
529
530 NavGetDefaultDialogOptions(&mNavOptions);
531 wxMacStringToPascal( m_message , (StringPtr)mNavOptions.message ) ;
532 wxMacStringToPascal( m_fileName , (StringPtr)mNavOptions.savedFileName ) ;
533
534 // Set default location, the location
535 // that's displayed when the dialog
536 // first appears
537
538 FSSpec location ;
539 wxMacFilename2FSSpec( m_dir , &location ) ;
540
541 err = ::AECreateDesc(typeFSS, &location, sizeof(FSSpec), &mDefaultLocation );
542
543 if ( mDefaultLocation.dataHandle )
544 {
545 if (mSelectDefault)
546 {
547 mNavOptions.dialogOptionFlags |= kNavSelectDefaultLocation;
548 } else {
549 mNavOptions.dialogOptionFlags &= ~kNavSelectDefaultLocation;
550 }
551 }
552
553 memset( &mNavReply , 0 , sizeof( mNavReply ) ) ;
554 mNavReply.validRecord = false;
555 mNavReply.replacing = false;
556 mNavReply.isStationery = false;
557 mNavReply.translationNeeded = false;
558 mNavReply.selection.descriptorType = typeNull;
559 mNavReply.selection.dataHandle = nil;
560 mNavReply.keyScript = smSystemScript;
561 mNavReply.fileTranslation = nil;
562 mNavReply.version = kNavReplyRecordVersion ;
563
564 // zero all data
565
566 m_path = wxEmptyString ;
567 m_fileName = wxEmptyString ;
568 m_paths.Empty();
569 m_fileNames.Empty();
570
571 OpenUserDataRec myData;
572 MakeUserDataRec( &myData , m_wildCard ) ;
573 myData.currentfilter = m_filterIndex ;
574 if ( myData.extensions.GetCount() > 0 )
575 {
576 mNavOptions.popupExtension = (NavMenuItemSpecArrayHandle) NewHandle( sizeof( NavMenuItemSpec ) * myData.extensions.GetCount() ) ;
577 myData.menuitems = mNavOptions.popupExtension ;
578 for ( size_t i = 0 ; i < myData.extensions.GetCount() ; ++i )
579 {
580 (*mNavOptions.popupExtension)[i].version = kNavMenuItemSpecVersion ;
581 (*mNavOptions.popupExtension)[i].menuCreator = 'WXNG' ;
582 // TODO : according to the new docs -1 to 10 are reserved for the OS
583 (*mNavOptions.popupExtension)[i].menuType = i ;
584 wxMacStringToPascal( myData.name[i] , (StringPtr)(*mNavOptions.popupExtension)[i].menuItemName ) ;
585 }
586 }
587 if ( m_dialogStyle & wxSAVE )
588 {
589 myData.saveMode = true ;
590
591 mNavOptions.dialogOptionFlags |= kNavDontAutoTranslate ;
592 mNavOptions.dialogOptionFlags |= kNavDontAddTranslateItems ;
593
594 err = ::NavPutFile(
595 &mDefaultLocation,
596 &mNavReply,
597 &mNavOptions,
598 sStandardNavEventFilter ,
599 NULL,
600 kNavGenericSignature,
601 &myData); // User Data
602 m_filterIndex = myData.currentfilter ;
603 }
604 else
605 {
606 myData.saveMode = false ;
607
608 mNavFilterUPP = NewNavObjectFilterUPP( CrossPlatformFilterCallback ) ;
609 if ( m_dialogStyle & wxMULTIPLE )
610 mNavOptions.dialogOptionFlags |= kNavAllowMultipleFiles ;
611 else
612 mNavOptions.dialogOptionFlags &= ~kNavAllowMultipleFiles ;
613
614 err = ::NavGetFile(
615 &mDefaultLocation,
616 &mNavReply,
617 &mNavOptions,
618 sStandardNavEventFilter ,
619 mNavPreviewUPP,
620 mNavFilterUPP,
621 NULL ,
622 &myData);
623 m_filterIndex = myData.currentfilter ;
624 }
625
626 DisposeNavObjectFilterUPP(mNavFilterUPP);
627 if ( mDefaultLocation.dataHandle != nil )
628 {
629 ::AEDisposeDesc(&mDefaultLocation);
630 }
631
632 if ( (err != noErr) && (err != userCanceledErr) ) {
633 return wxID_CANCEL ;
634 }
635
636 if (mNavReply.validRecord)
637 {
638 FSSpec outFileSpec ;
639 AEDesc specDesc ;
640 AEKeyword keyWord ;
641
642 long count ;
643 ::AECountItems( &mNavReply.selection , &count ) ;
644 for ( long i = 1 ; i <= count ; ++i )
645 {
646 OSErr err = ::AEGetNthDesc( &mNavReply.selection , i , typeFSS, &keyWord , &specDesc);
647 if ( err != noErr )
648 {
649 m_path = wxT("") ;
650 return wxID_CANCEL ;
651 }
652 outFileSpec = **(FSSpec**) specDesc.dataHandle;
653 if (specDesc.dataHandle != nil) {
654 ::AEDisposeDesc(&specDesc);
655 }
656 m_path = wxMacFSSpec2MacFilename( &outFileSpec ) ;
657
658 m_paths.Add( m_path ) ;
659 m_fileName = wxFileNameFromPath(m_path);
660 m_fileNames.Add(m_fileName);
661 }
662 // set these to the first hit
663 m_path = m_paths[ 0 ] ;
664 m_fileName = wxFileNameFromPath(m_path);
665 m_dir = wxPathOnly(m_path);
666 NavDisposeReply( &mNavReply ) ;
667 return wxID_OK ;
668 }
669 return wxID_CANCEL;
670 #endif // TARGET_CARBON
671 }
672