X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/489468feaa08b8f504735eecca522fb8d0f825d2..47e175a24f862aa8b7ca7dd4a2bb5957991e7f2d:/src/osx/carbon/dirdlg.cpp diff --git a/src/osx/carbon/dirdlg.cpp b/src/osx/carbon/dirdlg.cpp index 5caa7f6b4b..4f98aa02da 100644 --- a/src/osx/carbon/dirdlg.cpp +++ b/src/osx/carbon/dirdlg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/mac/carbon/dirdlg.cpp +// Name: src/osx/carbon/dirdlg.cpp // Purpose: wxDirDialog // Author: Stefan Csomor // Modified by: @@ -11,25 +11,19 @@ #include "wx/wxprec.h" -#if wxUSE_DIRDLG +#if wxUSE_DIRDLG && !defined(__WXUNIVERSAL__) #include "wx/dirdlg.h" #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/dialog.h" - #include "wx/cmndata.h" #endif // WX_PRECOMP #include "wx/filename.h" +#include "wx/testing.h" -#include "wx/mac/private.h" - -#ifdef __DARWIN__ - #include -#else - #include -#endif +#include "wx/osx/private.h" IMPLEMENT_CLASS(wxDirDialog, wxDialog) @@ -64,19 +58,23 @@ static pascal void NavEventProc( wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, const wxString& defaultPath, - long WXUNUSED(style), + long style, const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), const wxString& WXUNUSED(name)) { wxASSERT_MSG( NavServicesAvailable() , wxT("Navigation Services are not running") ) ; - m_message = message; m_parent = parent; - m_path = defaultPath; + + SetMessage( message ); + SetWindowStyle(style); + SetPath(defaultPath); } int wxDirDialog::ShowModal() { + WX_TESTING_SHOW_MODAL_HOOK(); + NavDialogRef dialog = NULL; NavDialogCreationOptions options; NavReplyRecord reply ; @@ -92,7 +90,9 @@ int wxDirDialog::ShowModal() err = NavCreateChooseFolderDialog(&options, sStandardNavEventFilter , NULL, this , &dialog); if (err == noErr) { + wxDialog::OSXBeginModalDialog(); err = NavDialogRun(dialog); + wxDialog::OSXEndModalDialog(); if ( err == noErr ) { err = NavDialogGetReply(dialog, &reply); @@ -136,8 +136,8 @@ int wxDirDialog::ShowModal() if ( err != noErr && err != userCanceledErr ) m_path = wxEmptyString ; - if ( dialog ) - ::NavDialogDispose(dialog); + if ( dialog ) + ::NavDialogDispose(dialog); return (err == noErr) ? wxID_OK : wxID_CANCEL ; }