X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc2f6088e7cee8dda9953d346de97fcb26970aeb..cb6b81bc94108bcb0a702ac5fdaf4944fa7706a0:/src/osx/cocoa/printdlg.mm?ds=sidebyside diff --git a/src/osx/cocoa/printdlg.mm b/src/osx/cocoa/printdlg.mm index d74128d3a9..06c7e15950 100644 --- a/src/osx/cocoa/printdlg.mm +++ b/src/osx/cocoa/printdlg.mm @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -14,6 +13,7 @@ #if wxUSE_PRINTING_ARCHITECTURE #include "wx/printdlg.h" +#include "wx/modalhook.h" #ifndef WX_PRECOMP #include "wx/object.h" @@ -33,7 +33,6 @@ IMPLEMENT_CLASS(wxOSXCocoaPrintData, wxOSXPrintData) wxOSXCocoaPrintData::wxOSXCocoaPrintData() { m_macPrintInfo = [[NSPrintInfo alloc] init]; - // TODO add 10.4 code m_macPageFormat = (PMPageFormat) [m_macPrintInfo PMPageFormat]; m_macPrintSettings = (PMPrintSettings) [m_macPrintInfo PMPrintSettings]; m_macPrintSession = (PMPrintSession) [m_macPrintInfo PMPrintSession] ; @@ -47,14 +46,12 @@ wxOSXCocoaPrintData::~wxOSXCocoaPrintData() void wxOSXCocoaPrintData::UpdateFromPMState() { - // TODO add 10.4 code [m_macPrintInfo updateFromPMPageFormat]; [m_macPrintInfo updateFromPMPrintSettings]; } void wxOSXCocoaPrintData::UpdateToPMState() { - // TODO add 10.4 code m_macPageFormat = (PMPageFormat) [m_macPrintInfo PMPageFormat]; m_macPrintSettings = (PMPrintSettings) [m_macPrintInfo PMPrintSettings]; m_macPrintSession = (PMPrintSession) [m_macPrintInfo PMPrintSession] ; @@ -62,12 +59,19 @@ void wxOSXCocoaPrintData::UpdateToPMState() int wxMacPrintDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + m_printDialogData.GetPrintData().ConvertToNative(); int result = wxID_CANCEL; NSPrintPanel* panel = [NSPrintPanel printPanel]; NSPrintInfo* printInfo = ((wxOSXCocoaPrintData*)m_printDialogData.GetPrintData().GetNativeData())->GetNSPrintInfo(); + + NSMutableDictionary* dict = [printInfo printSettings]; + [dict setValue:[NSNumber numberWithInt:m_printDialogData.GetMinPage()] forKey:@"com_apple_print_PrintSettings_PMFirstPage"]; + [dict setValue:[NSNumber numberWithInt:m_printDialogData.GetMaxPage()] forKey:@"com_apple_print_PrintSettings_PMLastPage"]; + if ( (NSInteger)[panel runModalWithPrintInfo:printInfo] == NSOKButton ) { result = wxID_OK; @@ -80,6 +84,8 @@ int wxMacPrintDialog::ShowModal() int wxMacPageSetupDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + m_pageSetupData.GetPrintData().ConvertToNative(); ((wxOSXCocoaPrintData*)m_pageSetupData.GetPrintData().GetNativeData())->TransferFrom( &m_pageSetupData );