+ case GTK_RESPONSE_OK:
+ case GTK_RESPONSE_APPLY:
+ {
+ // Store Selected Printer Name
+ gtk_print_settings_set_printer
+ (
+ nativeData,
+ gtk_print_settings_get(nativeData, "format-for-printer")
+ );
+
+ wxGtkObject<GtkPageSetup>
+ newPageSetup(gtk_page_setup_unix_dialog_get_page_setup(
+ GTK_PAGE_SETUP_UNIX_DIALOG(dlg)));
+ native->SetPageSetupToSettings(nativeData, newPageSetup);
+
+ m_pageDialogData.GetPrintData().ConvertFromNative();
+
+ // Store custom paper format if any.
+ if ( m_pageDialogData.GetPrintData().GetPaperId() == wxPAPER_NONE )
+ {
+ gdouble ml,mr,mt,mb,pw,ph;
+ ml = gtk_page_setup_get_left_margin (newPageSetup, GTK_UNIT_MM);
+ mr = gtk_page_setup_get_right_margin (newPageSetup, GTK_UNIT_MM);
+ mt = gtk_page_setup_get_top_margin (newPageSetup, GTK_UNIT_MM);
+ mb = gtk_page_setup_get_bottom_margin (newPageSetup, GTK_UNIT_MM);
+
+ pw = gtk_page_setup_get_paper_width (newPageSetup, GTK_UNIT_MM);
+ ph = gtk_page_setup_get_paper_height (newPageSetup, GTK_UNIT_MM);
+
+ m_pageDialogData.SetMarginTopLeft(wxPoint((int)(ml+0.5),
+ (int)(mt+0.5)));
+ m_pageDialogData.SetMarginBottomRight(wxPoint((int)(mr+0.5),
+ (int)(mb+0.5)));
+
+ m_pageDialogData.SetPaperSize(wxSize((int)(pw+0.5),
+ (int)(ph+0.5)));
+ }
+
+ result = wxID_OK;
+ }
+ break;
+
+ default:
+ case GTK_RESPONSE_CANCEL:
+ result = wxID_CANCEL;
+ break;