From a5ae8241de5d07fc10d8fa6ba9c0faa1457521b8 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 26 May 2003 09:55:28 +0000 Subject: [PATCH] Allow printing objects to be passed a wxWindow, not a wxFrame (vestigial remains of older wxWin version) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/hteasypr.tex | 7 +++---- docs/latex/wx/prevwin.tex | 2 +- docs/toback24.txt | 7 ------- include/wx/html/htmprint.h | 4 ++-- include/wx/prntbase.h | 2 +- src/common/prntbase.cpp | 4 ++-- src/html/htmprint.cpp | 12 ++++++------ 7 files changed, 15 insertions(+), 23 deletions(-) diff --git a/docs/latex/wx/hteasypr.tex b/docs/latex/wx/hteasypr.tex index 3f7b7e5949..418454f349 100644 --- a/docs/latex/wx/hteasypr.tex +++ b/docs/latex/wx/hteasypr.tex @@ -28,16 +28,15 @@ this class stores various settings in it. \membersection{wxHtmlEasyPrinting::wxHtmlEasyPrinting}\label{wxhtmleasyprintingwxhtmleasyprinting} -\func{}{wxHtmlEasyPrinting}{\param{const wxString\& }{name = "Printing"}, \param{wxFrame* }{parent\_frame = NULL}} +\func{}{wxHtmlEasyPrinting}{\param{const wxString\& }{name = "Printing"}, \param{wxWindow* }{parentWindow = NULL}} Constructor. \wxheading{Parameters} -\docparam{name}{Name of the printing. Used by preview frames and setup dialogs.} - -\docparam{parent\_frame}{pointer to the frame that will own preview frame and setup dialogs. May be NULL.} +\docparam{name}{Name of the printing object. Used by preview frames and setup dialogs.} +\docparam{parentWindow}{pointer to the window that will own the preview frame and setup dialogs. May be NULL.} \membersection{wxHtmlEasyPrinting::PreviewFile}\label{wxhtmleasyprintingpreviewfile} diff --git a/docs/latex/wx/prevwin.tex b/docs/latex/wx/prevwin.tex index 7963f7c5ff..36d65927a1 100644 --- a/docs/latex/wx/prevwin.tex +++ b/docs/latex/wx/prevwin.tex @@ -141,7 +141,7 @@ class may be used without derivation. \membersection{wxPreviewFrame::wxPreviewFrame} -\func{}{wxPreviewFrame}{\param{wxPrintPreview* }{preview}, \param{wxFrame* }{parent}, \param{const wxString\& }{title}, +\func{}{wxPreviewFrame}{\param{wxPrintPreview* }{preview}, \param{wxWindow* }{parent}, \param{const wxString\& }{title}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& size }{size = wxDefaultSize}, \param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = ``frame"}} diff --git a/docs/toback24.txt b/docs/toback24.txt index c4bc8320c0..b3d323e441 100644 --- a/docs/toback24.txt +++ b/docs/toback24.txt @@ -166,13 +166,6 @@ Checking in include/wx/textbuf.h; /pack/cvsroots/wxwindows/wxWindows/include/wx/textbuf.h,v <-- textbuf.h new revision: 1.8; previous revision: 1.7 -18. Better notebook page sizing - -nbbase.cpp, CalcSizeFromPage, plus #includes at top of file. -This gets the tab size and adds a bit for borders. -We should do the same for other platforms, only rationalise -it so that wxNotebook returns the tab rect info. - 19. Add wxFileConfig bug fix, marked by ... in Parse(). This prevents mungeing of the config file after reading in entries (say, just one entry in one group), then adding entries diff --git a/include/wx/html/htmprint.h b/include/wx/html/htmprint.h index 71448016c7..8ee2742637 100644 --- a/include/wx/html/htmprint.h +++ b/include/wx/html/htmprint.h @@ -196,7 +196,7 @@ private: class WXDLLEXPORT wxHtmlEasyPrinting : public wxObject { public: - wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxFrame *parent_frame = NULL); + wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxWindow *parentWindow = NULL); ~wxHtmlEasyPrinting(); bool PreviewFile(const wxString &htmlfile); @@ -244,7 +244,7 @@ private: int *m_FontsSizes; wxString m_FontFaceFixed, m_FontFaceNormal; wxString m_Headers[2], m_Footers[2]; - wxFrame *m_Frame; + wxWindow *m_ParentWindow; DECLARE_NO_COPY_CLASS(wxHtmlEasyPrinting) }; diff --git a/include/wx/prntbase.h b/include/wx/prntbase.h index 8525fb4689..51430ffa1b 100644 --- a/include/wx/prntbase.h +++ b/include/wx/prntbase.h @@ -192,7 +192,7 @@ class WXDLLEXPORT wxPreviewFrame: public wxFrame { public: wxPreviewFrame(wxPrintPreviewBase *preview, - wxFrame *parent, + wxWindow *parent, const wxString& title = wxT("Print Preview"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index 0b3899fdc4..fc2df6a705 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -503,7 +503,7 @@ BEGIN_EVENT_TABLE(wxPreviewFrame, wxFrame) EVT_CLOSE(wxPreviewFrame::OnCloseWindow) END_EVENT_TABLE() -wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxFrame *parent, const wxString& title, +wxPreviewFrame::wxPreviewFrame(wxPrintPreviewBase *preview, wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name): wxFrame(parent, -1, title, pos, size, style, name) { @@ -511,7 +511,7 @@ wxFrame(parent, -1, title, pos, size, style, name) m_controlBar = NULL; m_previewCanvas = NULL; - // Looks silly on Windows with a standard Windows icon + // Give the application icon #ifdef __WXMSW__ wxFrame* topFrame = wxDynamicCast(wxTheApp->GetTopWindow(), wxFrame); if (topFrame) diff --git a/src/html/htmprint.cpp b/src/html/htmprint.cpp index 89f5e3c83c..099cf3bbd5 100644 --- a/src/html/htmprint.cpp +++ b/src/html/htmprint.cpp @@ -430,9 +430,9 @@ void wxHtmlPrintout::SetFonts(wxString normal_face, wxString fixed_face, //---------------------------------------------------------------------------- -wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxFrame *parent_frame) +wxHtmlEasyPrinting::wxHtmlEasyPrinting(const wxString& name, wxWindow *parentWindow) { - m_Frame = parent_frame; + m_ParentWindow = parentWindow; m_Name = name; m_PrintData = new wxPrintData; m_PageSetupData = new wxPageSetupDialogData; @@ -510,7 +510,7 @@ bool wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr return FALSE; } - wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame, + wxPreviewFrame *frame = new wxPreviewFrame(preview, m_ParentWindow, m_Name + _(" Preview"), wxPoint(100, 100), wxSize(650, 500)); frame->Centre(wxBOTH); @@ -526,7 +526,7 @@ bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout) wxPrintDialogData printDialogData(*m_PrintData); wxPrinter printer(&printDialogData); - if (!printer.Print(m_Frame, printout, TRUE)) + if (!printer.Print(m_ParentWindow, printout, TRUE)) { return FALSE; } @@ -540,7 +540,7 @@ bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout) void wxHtmlEasyPrinting::PrinterSetup() { wxPrintDialogData printDialogData(*m_PrintData); - wxPrintDialog printerDialog(m_Frame, &printDialogData); + wxPrintDialog printerDialog(m_ParentWindow, &printDialogData); printerDialog.GetPrintDialogData().SetSetupDialog(TRUE); @@ -559,7 +559,7 @@ void wxHtmlEasyPrinting::PageSetup() } m_PageSetupData->SetPrintData(*m_PrintData); - wxPageSetupDialog pageSetupDialog(m_Frame, m_PageSetupData); + wxPageSetupDialog pageSetupDialog(m_ParentWindow, m_PageSetupData); if (pageSetupDialog.ShowModal() == wxID_OK) { -- 2.45.2