/////////////////////////////////////////////////////////////////////////////
-// Name: src/osx/carbon/printdlg.cpp
+// Name: src/osx/cocoa/printdlg.mm
// Purpose: wxPrintDialog, wxPageSetupDialog
// Author: Stefan Csomor
// Modified by:
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/printdlg.h"
+#include "wx/testing.h"
#ifndef WX_PRECOMP
#include "wx/object.h"
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] ;
+ PMGetPageFormatPaper(m_macPageFormat, &m_macPaper);
}
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] ;
int wxMacPrintDialog::ShowModal()
{
+ WX_TESTING_SHOW_MODAL_HOOK();
+
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;
int wxMacPageSetupDialog::ShowModal()
{
+ WX_TESTING_SHOW_MODAL_HOOK();
+
m_pageSetupData.GetPrintData().ConvertToNative();
((wxOSXCocoaPrintData*)m_pageSetupData.GetPrintData().GetNativeData())->TransferFrom( &m_pageSetupData );