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
This commit is contained in:
@@ -28,16 +28,15 @@ this class stores various settings in it.
|
|||||||
|
|
||||||
\membersection{wxHtmlEasyPrinting::wxHtmlEasyPrinting}\label{wxhtmleasyprintingwxhtmleasyprinting}
|
\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.
|
Constructor.
|
||||||
|
|
||||||
\wxheading{Parameters}
|
\wxheading{Parameters}
|
||||||
|
|
||||||
\docparam{name}{Name of the printing. Used by preview frames and setup dialogs.}
|
\docparam{name}{Name of the printing object. 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{parentWindow}{pointer to the window that will own the preview frame and setup dialogs. May be NULL.}
|
||||||
|
|
||||||
\membersection{wxHtmlEasyPrinting::PreviewFile}\label{wxhtmleasyprintingpreviewfile}
|
\membersection{wxHtmlEasyPrinting::PreviewFile}\label{wxhtmleasyprintingpreviewfile}
|
||||||
|
|
||||||
|
@@ -141,7 +141,7 @@ class may be used without derivation.
|
|||||||
|
|
||||||
\membersection{wxPreviewFrame::wxPreviewFrame}
|
\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{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& size }{size = wxDefaultSize},
|
||||||
\param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = ``frame"}}
|
\param{long}{ style = wxDEFAULT\_FRAME\_STYLE}, \param{const wxString\& }{name = ``frame"}}
|
||||||
|
|
||||||
|
@@ -166,13 +166,6 @@ Checking in include/wx/textbuf.h;
|
|||||||
/pack/cvsroots/wxwindows/wxWindows/include/wx/textbuf.h,v <-- textbuf.h
|
/pack/cvsroots/wxwindows/wxWindows/include/wx/textbuf.h,v <-- textbuf.h
|
||||||
new revision: 1.8; previous revision: 1.7
|
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 <JACS>...</JACS> in Parse().
|
19. Add wxFileConfig bug fix, marked by <JACS>...</JACS> in Parse().
|
||||||
This prevents mungeing of the config file after reading in
|
This prevents mungeing of the config file after reading in
|
||||||
entries (say, just one entry in one group), then adding entries
|
entries (say, just one entry in one group), then adding entries
|
||||||
|
@@ -196,7 +196,7 @@ private:
|
|||||||
class WXDLLEXPORT wxHtmlEasyPrinting : public wxObject
|
class WXDLLEXPORT wxHtmlEasyPrinting : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxFrame *parent_frame = NULL);
|
wxHtmlEasyPrinting(const wxString& name = wxT("Printing"), wxWindow *parentWindow = NULL);
|
||||||
~wxHtmlEasyPrinting();
|
~wxHtmlEasyPrinting();
|
||||||
|
|
||||||
bool PreviewFile(const wxString &htmlfile);
|
bool PreviewFile(const wxString &htmlfile);
|
||||||
@@ -244,7 +244,7 @@ private:
|
|||||||
int *m_FontsSizes;
|
int *m_FontsSizes;
|
||||||
wxString m_FontFaceFixed, m_FontFaceNormal;
|
wxString m_FontFaceFixed, m_FontFaceNormal;
|
||||||
wxString m_Headers[2], m_Footers[2];
|
wxString m_Headers[2], m_Footers[2];
|
||||||
wxFrame *m_Frame;
|
wxWindow *m_ParentWindow;
|
||||||
|
|
||||||
DECLARE_NO_COPY_CLASS(wxHtmlEasyPrinting)
|
DECLARE_NO_COPY_CLASS(wxHtmlEasyPrinting)
|
||||||
};
|
};
|
||||||
|
@@ -192,7 +192,7 @@ class WXDLLEXPORT wxPreviewFrame: public wxFrame
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxPreviewFrame(wxPrintPreviewBase *preview,
|
wxPreviewFrame(wxPrintPreviewBase *preview,
|
||||||
wxFrame *parent,
|
wxWindow *parent,
|
||||||
const wxString& title = wxT("Print Preview"),
|
const wxString& title = wxT("Print Preview"),
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
|
@@ -503,7 +503,7 @@ BEGIN_EVENT_TABLE(wxPreviewFrame, wxFrame)
|
|||||||
EVT_CLOSE(wxPreviewFrame::OnCloseWindow)
|
EVT_CLOSE(wxPreviewFrame::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
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):
|
const wxPoint& pos, const wxSize& size, long style, const wxString& name):
|
||||||
wxFrame(parent, -1, title, pos, size, style, 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_controlBar = NULL;
|
||||||
m_previewCanvas = NULL;
|
m_previewCanvas = NULL;
|
||||||
|
|
||||||
// Looks silly on Windows with a standard Windows icon
|
// Give the application icon
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
wxFrame* topFrame = wxDynamicCast(wxTheApp->GetTopWindow(), wxFrame);
|
wxFrame* topFrame = wxDynamicCast(wxTheApp->GetTopWindow(), wxFrame);
|
||||||
if (topFrame)
|
if (topFrame)
|
||||||
|
@@ -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_Name = name;
|
||||||
m_PrintData = new wxPrintData;
|
m_PrintData = new wxPrintData;
|
||||||
m_PageSetupData = new wxPageSetupDialogData;
|
m_PageSetupData = new wxPageSetupDialogData;
|
||||||
@@ -510,7 +510,7 @@ bool wxHtmlEasyPrinting::DoPreview(wxHtmlPrintout *printout1, wxHtmlPrintout *pr
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPreviewFrame *frame = new wxPreviewFrame(preview, m_Frame,
|
wxPreviewFrame *frame = new wxPreviewFrame(preview, m_ParentWindow,
|
||||||
m_Name + _(" Preview"),
|
m_Name + _(" Preview"),
|
||||||
wxPoint(100, 100), wxSize(650, 500));
|
wxPoint(100, 100), wxSize(650, 500));
|
||||||
frame->Centre(wxBOTH);
|
frame->Centre(wxBOTH);
|
||||||
@@ -526,7 +526,7 @@ bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout)
|
|||||||
wxPrintDialogData printDialogData(*m_PrintData);
|
wxPrintDialogData printDialogData(*m_PrintData);
|
||||||
wxPrinter printer(&printDialogData);
|
wxPrinter printer(&printDialogData);
|
||||||
|
|
||||||
if (!printer.Print(m_Frame, printout, TRUE))
|
if (!printer.Print(m_ParentWindow, printout, TRUE))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -540,7 +540,7 @@ bool wxHtmlEasyPrinting::DoPrint(wxHtmlPrintout *printout)
|
|||||||
void wxHtmlEasyPrinting::PrinterSetup()
|
void wxHtmlEasyPrinting::PrinterSetup()
|
||||||
{
|
{
|
||||||
wxPrintDialogData printDialogData(*m_PrintData);
|
wxPrintDialogData printDialogData(*m_PrintData);
|
||||||
wxPrintDialog printerDialog(m_Frame, &printDialogData);
|
wxPrintDialog printerDialog(m_ParentWindow, &printDialogData);
|
||||||
|
|
||||||
printerDialog.GetPrintDialogData().SetSetupDialog(TRUE);
|
printerDialog.GetPrintDialogData().SetSetupDialog(TRUE);
|
||||||
|
|
||||||
@@ -559,7 +559,7 @@ void wxHtmlEasyPrinting::PageSetup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_PageSetupData->SetPrintData(*m_PrintData);
|
m_PageSetupData->SetPrintData(*m_PrintData);
|
||||||
wxPageSetupDialog pageSetupDialog(m_Frame, m_PageSetupData);
|
wxPageSetupDialog pageSetupDialog(m_ParentWindow, m_PageSetupData);
|
||||||
|
|
||||||
if (pageSetupDialog.ShowModal() == wxID_OK)
|
if (pageSetupDialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user