-wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
- const wxString& defaultPath,
- long style, const wxPoint& pos)
+IMPLEMENT_CLASS(wxDirDialog, wxDialog)
+
+static pascal void NavEventProc(
+ NavEventCallbackMessage inSelector,
+ NavCBRecPtr ioParams,
+ NavCallBackUserData ioUserData );
+
+static NavEventUPP sStandardNavEventFilter = NewNavEventUPP(NavEventProc);
+
+static pascal void NavEventProc(
+ NavEventCallbackMessage inSelector,
+ NavCBRecPtr ioParams,
+ NavCallBackUserData ioUserData )
+{
+ wxDirDialog * data = ( wxDirDialog *) ioUserData ;
+ if ( inSelector == kNavCBStart )
+ {
+ if (data && !data->GetPath().empty() )
+ {
+ // Set default location for the modern Navigation APIs
+ // Apple Technical Q&A 1151
+ FSRef theFile;
+ wxMacPathToFSRef(data->GetPath(), &theFile);
+ AEDesc theLocation = { typeNull, NULL };
+ if (noErr == ::AECreateDesc(typeFSRef, &theFile, sizeof(FSRef), &theLocation))
+ ::NavCustomControl(ioParams->context, kNavCtlSetLocation, (void *) &theLocation);
+ }
+ }
+}
+
+wxDirDialog::wxDirDialog(wxWindow *parent,
+ const wxString& message,
+ const wxString& defaultPath,
+ long WXUNUSED(style),
+ const wxPoint& WXUNUSED(pos),
+ const wxSize& WXUNUSED(size),
+ const wxString& WXUNUSED(name))