]> git.saurik.com Git - wxWidgets.git/blob - src/stubs/print.cpp
Copied/merged from the 2.2 branch.
[wxWidgets.git] / src / stubs / print.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: print.cpp
3 // Purpose: Print framework
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "print.h"
14 #endif
15
16 #include "wx/stubs/print.h"
17 #include "wx/stubs/printdlg.h"
18
19 IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase)
20 IMPLEMENT_CLASS(wxPrintPreview, wxPrintPreviewBase)
21
22 /*
23 * Printer
24 */
25
26 wxPrinter::wxPrinter(wxPrintData *data):
27 wxPrinterBase(data)
28 {
29 }
30
31 wxPrinter::~wxPrinter()
32 {
33 }
34
35 bool wxPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
36 {
37 // TODO. See wxPostScriptPrinter::Print for hints.
38 return FALSE;
39 }
40
41 bool wxPrinter::PrintDialog(wxWindow *parent)
42 {
43 wxPrintDialog dialog(parent, & m_printData);
44 return (dialog.ShowModal() == wxID_OK);
45 }
46
47 bool wxPrinter::Setup(wxWindow *parent)
48 {
49 wxPrintDialog dialog(parent, & m_printData);
50 dialog.GetPrintData().SetSetupDialog(TRUE);
51 return (dialog.ShowModal() == wxID_OK);
52 }
53
54 /*
55 * Print preview
56 */
57
58 wxPrintPreview::wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
59 wxPrintPreviewBase(printout, printoutForPrinting, data)
60 {
61 DetermineScaling();
62 }
63
64 wxPrintPreview::~wxPrintPreview()
65 {
66 }
67
68 bool wxPrintPreview::Print(bool interactive)
69 {
70 if (!m_printPrintout)
71 return FALSE;
72 wxPrinter printer(&m_printData);
73 return printer.Print(m_previewFrame, m_printPrintout, interactive);
74 }
75
76 void wxPrintPreview::DetermineScaling()
77 {
78 // TODO
79 }
80