X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aad5220b823778a271e25ca74e4127034161e280..6f34921d9369a31de14e4b07e4824e2d701710f0:/src/common/prntbase.cpp diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index ed54807594..665d752f9d 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -20,10 +20,12 @@ #pragma hdrstop #endif -// #define __GOOD_COMPILER__ - #include "wx/defs.h" +#ifdef __WXMSW__ +#define __GOOD_COMPILER__ +#endif + #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/dc.h" @@ -45,7 +47,7 @@ #include #include -#ifdef __WINDOWS__ +#ifdef __WXMSW__ #include #include @@ -75,7 +77,7 @@ typedef signed short int SHORT ; LONG APIENTRY _EXPORT wxAbortProc(HDC hPr, int Code); #endif - // End __WINDOWS__ + // End __WXMSW__ #if !USE_SHARED_LIBRARY IMPLEMENT_CLASS(wxPrinterBase, wxObject) @@ -101,14 +103,14 @@ END_EVENT_TABLE() wxPrinterBase::wxPrinterBase(wxPrintData *data) { - currentPrintout = NULL; - abortWindow = NULL; + currentPrintout = (wxPrintout *) NULL; + abortWindow = (wxWindow *) NULL; abortIt = FALSE; if (data) printData = (*data); } -wxWindow *wxPrinterBase::abortWindow = NULL; +wxWindow *wxPrinterBase::abortWindow = (wxWindow *) NULL; bool wxPrinterBase::abortIt = FALSE; wxPrinterBase::~wxPrinterBase(void) @@ -120,7 +122,7 @@ void wxPrintAbortDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) wxPrinterBase::abortIt = TRUE; wxPrinterBase::abortWindow->Show(FALSE); wxPrinterBase::abortWindow->Close(TRUE); - wxPrinterBase::abortWindow = NULL; + wxPrinterBase::abortWindow = (wxWindow *) NULL; } wxWindow *wxPrinterBase::CreateAbortWindow(wxWindow *parent, wxPrintout *WXUNUSED(printout)) @@ -139,17 +141,17 @@ wxWindow *wxPrinterBase::CreateAbortWindow(wxWindow *parent, wxPrintout *WXUNUSE void wxPrinterBase::ReportError(wxWindow *parent, wxPrintout *WXUNUSED(printout), char *message) { - wxMessageBox(message, "Printing Error", wxOK, parent); + wxMessageBox(message, _("Printing Error"), wxOK, parent); } /* * Printout class */ -wxPrintout::wxPrintout(char *title) +wxPrintout::wxPrintout(const char *title) { - printoutTitle = title ? copystring(title) : (char*)NULL; - printoutDC = NULL; + printoutTitle = title ? copystring(title) : (char *) NULL; + printoutDC = (wxDC *) NULL; pageWidthMM = 0; pageHeightMM = 0; pageWidthPixels = 0; @@ -169,7 +171,7 @@ wxPrintout::~wxPrintout(void) bool wxPrintout::OnBeginDocument(int WXUNUSED(startPage), int WXUNUSED(endPage)) { - return GetDC()->StartDoc("Printing"); + return GetDC()->StartDoc(_("Printing")); } void wxPrintout::OnEndDocument(void) @@ -255,15 +257,15 @@ wxPreviewControlBar::wxPreviewControlBar(wxPrintPreviewBase *preview, long butto wxPanel(parent, -1, pos, size, style, name) { printPreview = preview; - closeButton = NULL; - nextPageButton = NULL; - previousPageButton = NULL; - printButton = NULL; - zoomControl = NULL; + closeButton = (wxButton *) NULL; + nextPageButton = (wxButton *) NULL; + previousPageButton = (wxButton *) NULL; + printButton = (wxButton *) NULL; + zoomControl = (wxChoice *) NULL; buttonFlags = buttons; } -wxFont *wxPreviewControlBar::buttonFont = NULL; +wxFont *wxPreviewControlBar::buttonFont = (wxFont *) NULL; wxPreviewControlBar::~wxPreviewControlBar(void) { @@ -335,7 +337,7 @@ void wxPreviewControlBar::CreateButtons(void) SetSize(0, 0, 400, 40); -#ifdef __WINDOWS__ +#ifdef __WXMSW__ int fontSize = 9; #else int fontSize = 10; @@ -352,14 +354,14 @@ void wxPreviewControlBar::CreateButtons(void) int y = 5; int gap = 5; - closeButton = new wxButton(this, wxID_PREVIEW_CLOSE, "Close", + closeButton = new wxButton(this, wxID_PREVIEW_CLOSE, _("Close"), wxPoint(x, y), wxSize(buttonWidth, buttonHeight)); x += gap + buttonWidth; if (buttonFlags & wxPREVIEW_PRINT) { - printButton = new wxButton(this, wxID_PREVIEW_PRINT, "Print...", wxPoint(x, y), + printButton = new wxButton(this, wxID_PREVIEW_PRINT, _("Print..."), wxPoint(x, y), wxSize(buttonWidth, buttonHeight)); x += gap + buttonWidth; } @@ -482,7 +484,7 @@ void wxPreviewFrame::Initialize(void) // int w, h; // controlBar->GetSize(&w, &h); int h; -#ifdef __WINDOWS__ +#ifdef __WXMSW__ h = 40; #else h = 60; @@ -658,8 +660,8 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) if (!previewCanvas) { - wxMessageBox("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!", - "Print Preview Failure", wxOK); + wxMessageBox(_("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!"), + _("Print Preview Failure"), wxOK); return FALSE; } previewCanvas->GetSize(&canvasWidth, &canvasHeight); @@ -681,7 +683,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) { if (previewBitmap) delete previewBitmap; - wxMessageBox("Sorry, not enough memory to create a preview.", "Print Preview Failure", wxOK); + wxMessageBox(_("Sorry, not enough memory to create a preview."), _("Print Preview Failure"), wxOK); return FALSE; } } @@ -699,7 +701,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) if (!previewPrintout->OnBeginDocument(printData.GetFromPage(), printData.GetToPage())) { - wxMessageBox("Could not start document preview.", "Print Preview Failure", wxOK); + wxMessageBox(_("Could not start document preview."), _("Print Preview Failure"), wxOK); memoryDC.SelectObject(wxNullBitmap); @@ -718,9 +720,9 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) char buf[200]; if (maxPage != 0) - sprintf(buf, "Page %d of %d", pageNum, maxPage); + sprintf(buf, _("Page %d of %d"), pageNum, maxPage); else - sprintf(buf, "Page %d", pageNum); + sprintf(buf, _("Page %d"), pageNum); if (previewFrame) previewFrame->SetStatusText(buf);