X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9eee81a4cf3aa063d4089074073c8a76fb56653b..15d5a9470be940a5bac66181a9e4c27d47d56558:/src/common/prntbase.cpp?ds=sidebyside diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index 8e7e80b769..2c878ff2dd 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -46,6 +46,8 @@ #include #include +#include + #ifdef __WXMSW__ #include "wx/msw/private.h" #include @@ -101,17 +103,20 @@ void wxPrintAbortDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) wxPrinterBase::sm_abortWindow = (wxWindow *) NULL; } -wxWindow *wxPrinterBase::CreateAbortWindow(wxWindow *parent, wxPrintout *WXUNUSED(printout)) +wxWindow *wxPrinterBase::CreateAbortWindow(wxWindow *parent, wxPrintout * printout) { - wxPrintAbortDialog *dialog = new wxPrintAbortDialog(parent, _("Printing"), wxPoint(0, 0), wxSize(400, 400), wxDEFAULT_DIALOG_STYLE); - (void) new wxStaticText(dialog, -1, _("Please wait..."), wxPoint(5, 5)); + wxPrintAbortDialog *dialog = new wxPrintAbortDialog(parent, _("Printing ") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE); - wxButton *button = new wxButton(dialog, wxID_CANCEL, _("Cancel"), wxPoint(5, 30)); + wxBoxSizer *button_sizer = new wxBoxSizer( wxVERTICAL ); + button_sizer->Add( new wxStaticText(dialog, -1, _("Please wait while printing\n") + printout->GetTitle() ), 0, wxALL, 10 ); + button_sizer->Add( new wxButton( dialog, wxID_CANCEL, wxT("Cancel") ), 0, wxALL | wxALIGN_CENTER, 10 ); - dialog->Fit(); - button->Centre(wxHORIZONTAL); + dialog->SetAutoLayout( TRUE ); + dialog->SetSizer( button_sizer ); + + button_sizer->Fit(dialog); + button_sizer->SetSizeHints (dialog) ; - dialog->Centre(); return dialog; } @@ -145,7 +150,7 @@ wxPrintout::~wxPrintout() bool wxPrintout::OnBeginDocument(int WXUNUSED(startPage), int WXUNUSED(endPage)) { - return GetDC()->StartDoc(_("Printing")); + return GetDC()->StartDoc(_("Printing ") + m_printoutTitle); } void wxPrintout::OnEndDocument() @@ -183,7 +188,7 @@ wxPreviewCanvas::wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent, wxScrolledWindow(parent, -1, pos, size, style, name) { m_printPreview = preview; - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); SetScrollbars(15, 18, 100, 100); } @@ -213,7 +218,7 @@ void wxPreviewCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) // Responds to colour changes, and passes event on to children. void wxPreviewCanvas::OnSysColourChanged(wxSysColourChangedEvent& event) { - SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE)); + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); Refresh(); // Propagate the event to the non-top-level children