From: Stefan Csomor Date: Wed, 29 Jan 2003 15:21:58 +0000 (+0000) Subject: bug fix & carbon support X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ac9b5f98890276181638271f9691735b36f4db77 bug fix & carbon support git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/filedlg.cpp b/src/mac/carbon/filedlg.cpp index 7e5ba852f4..66a0c2fc79 100644 --- a/src/mac/carbon/filedlg.cpp +++ b/src/mac/carbon/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 ; } 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 ; }