]> git.saurik.com Git - wxWidgets.git/blob - src/os2/print.cpp
More OS/2 stuff
[wxWidgets.git] / src / os2 / 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 #include "wx/wxprec.h"
13
14 #ifndef WX_PRECOMP
15 #include <stdio.h>
16 #include "wx/setup.h"
17 #include "wx/list.h"
18 #include "wx/utils.h"
19 #include "wx/app.h"
20 #endif
21
22
23 #include "wx/os2/print.h"
24 #include "wx/print.h"
25 #include "wx/generic/printdlg.h"
26
27 #if !USE_SHARED_LIBRARY
28 IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase)
29 IMPLEMENT_CLASS(wxPrintPreview, wxPrintPreviewBase)
30 #endif
31
32 /*
33 * Printer
34 */
35
36 wxPrinter::wxPrinter(wxPrintData *data):
37 wxPrinterBase(data)
38 {
39 }
40
41 wxPrinter::~wxPrinter()
42 {
43 }
44
45 bool wxPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt)
46 {
47 // TODO. See wxPostScriptPrinter::Print for hints.
48 return FALSE;
49 }
50
51 bool wxPrinter::PrintDialog(wxWindow *parent)
52 {
53 wxPrintDialog dialog(parent, & m_printData);
54 return (dialog.ShowModal() == wxID_OK);
55 }
56
57 bool wxPrinter::Setup(wxWindow *parent)
58 {
59 wxPrintDialog dialog(parent, & m_printData);
60 dialog.GetPrintData().SetSetupDialog(TRUE);
61 return (dialog.ShowModal() == wxID_OK);
62 }
63
64 /*
65 * Print preview
66 */
67
68 wxPrintPreview::wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
69 wxPrintPreviewBase(printout, printoutForPrinting, data)
70 {
71 DetermineScaling();
72 }
73
74 wxPrintPreview::~wxPrintPreview()
75 {
76 }
77
78 bool wxPrintPreview::Print(bool interactive)
79 {
80 if (!m_printPrintout)
81 return FALSE;
82 wxPrinter printer(&m_printData);
83 return printer.Print(m_previewFrame, m_printPrintout, interactive);
84 }
85
86 void wxPrintPreview::DetermineScaling()
87 {
88 // TODO
89 }
90