X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6ae55c76d85d20be45fad5c243f4bbfb394d4378..0ee169da2b0688749a2e119099f9c7eeb23c933e:/src/osx/carbon/printdlg.cpp diff --git a/src/osx/carbon/printdlg.cpp b/src/osx/carbon/printdlg.cpp index 0232701404..2a9c234ec7 100644 --- a/src/osx/carbon/printdlg.cpp +++ b/src/osx/carbon/printdlg.cpp @@ -28,19 +28,24 @@ #include "wx/osx/private/print.h" #include "wx/osx/private.h" #include "wx/statline.h" +#include "wx/testing.h" int wxMacPrintDialog::ShowModal() { + WX_TESTING_SHOW_MODAL_HOOK(); + m_printDialogData.GetPrintData().ConvertToNative(); ((wxOSXPrintData*)m_printDialogData.GetPrintData().GetNativeData())->TransferFrom( &m_printDialogData ); int result = wxID_CANCEL; - + OSErr err = noErr; Boolean accepted; wxOSXPrintData* nativeData = (wxOSXPrintData*)m_printDialogData.GetPrintData().GetNativeData(); + wxDialog::OSXBeginModalDialog(); err = PMSessionPrintDialog(nativeData->GetPrintSession(), nativeData->GetPrintSettings(), nativeData->GetPageFormat(), &accepted ); + wxDialog::OSXEndModalDialog(); if ((err == noErr) && !accepted) { @@ -72,6 +77,8 @@ int wxMacPrintDialog::ShowModal() int wxMacPageSetupDialog::ShowModal() { + WX_TESTING_SHOW_MODAL_HOOK(); + m_pageSetupData.GetPrintData().ConvertToNative(); wxOSXPrintData* nativeData = (wxOSXPrintData*)m_pageSetupData.GetPrintData().GetNativeData(); nativeData->TransferFrom( &m_pageSetupData ); @@ -80,8 +87,10 @@ int wxMacPageSetupDialog::ShowModal() OSErr err = noErr; Boolean accepted; + wxDialog::OSXBeginModalDialog(); err = PMSessionPageSetupDialog( nativeData->GetPrintSession(), nativeData->GetPageFormat(), &accepted ); + wxDialog::OSXEndModalDialog(); if ((err == noErr) && !accepted) {