X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d4e4f802f8a165c8d41053d2cd6d33c32b08f79..94311eef78b66304c9a2f78bcbdd396c798f19a6:/src/mac/filedlg.cpp diff --git a/src/mac/filedlg.cpp b/src/mac/filedlg.cpp index 7e5ba852f4..66a0c2fc79 100644 --- a/src/mac/filedlg.cpp +++ b/src/mac/filedlg.cpp @@ -81,7 +81,9 @@ NavEventProc( { OpenUserDataRec * data = ( OpenUserDataRec *) ioUserData ; if (inSelector == kNavCBEvent) { +#if !TARGET_CARBON wxTheApp->MacHandleOneEvent(ioParams->eventData.eventDataParms.event); +#endif } else if ( inSelector == kNavCBStart ) { @@ -300,8 +302,7 @@ wxString wxFileSelector(const char *title, if ( fileDialog.ShowModal() == wxID_OK ) { - strcpy(wxBuffer, (const char *)fileDialog.GetPath()); - return wxBuffer; + return fileDialog.GetPath(); } else return wxGetEmptyString(); @@ -324,8 +325,7 @@ WXDLLEXPORT wxString wxFileSelectorEx(const char *title, if ( fileDialog.ShowModal() == wxID_OK ) { *defaultFilterIndex = fileDialog.GetFilterIndex(); - strcpy(wxBuffer, (const char *)fileDialog.GetPath()); - return wxBuffer; + return fileDialog.GetPath(); } else return wxGetEmptyString(); @@ -380,6 +380,15 @@ int wxFileDialog::ShowModal() AEDesc mDefaultLocation ; bool mSelectDefault = false ; + // zero all data + + m_path = wxEmptyString ; + m_fileName = wxEmptyString ; + m_paths.Empty(); + m_fileNames.Empty(); + + // setup dialog + ::NavGetDefaultDialogOptions(&mNavOptions); mNavFilterUPP = nil; @@ -495,7 +504,6 @@ int wxFileDialog::ShowModal() } if ( (err != noErr) && (err != userCanceledErr) ) { - m_path = "" ; return wxID_CANCEL ; }