]>
Commit | Line | Data |
---|---|---|
93cf77c0 JS |
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 | ||
34138703 JS |
16 | #include "wx/stubs/print.h" |
17 | #include "wx/stubs/printdlg.h" | |
93cf77c0 JS |
18 | |
19 | #if !USE_SHARED_LIBRARY | |
20 | IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase) | |
34138703 | 21 | IMPLEMENT_CLASS(wxPrintPreview, wxPrintPreviewBase) |
93cf77c0 JS |
22 | #endif |
23 | ||
24 | /* | |
25 | * Printer | |
26 | */ | |
27 | ||
28 | wxPrinter::wxPrinter(wxPrintData *data): | |
29 | wxPrinterBase(data) | |
30 | { | |
31 | } | |
32 | ||
33 | wxPrinter::~wxPrinter() | |
34 | { | |
35 | } | |
36 | ||
37 | bool wxPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt) | |
38 | { | |
39 | // TODO. See wxPostScriptPrinter::Print for hints. | |
40 | return FALSE; | |
41 | } | |
42 | ||
43 | bool wxPrinter::PrintDialog(wxWindow *parent) | |
44 | { | |
7f555861 | 45 | wxPrintDialog dialog(parent, & m_printData); |
93cf77c0 JS |
46 | return (dialog.ShowModal() == wxID_OK); |
47 | } | |
48 | ||
49 | bool wxPrinter::Setup(wxWindow *parent) | |
50 | { | |
7f555861 | 51 | wxPrintDialog dialog(parent, & m_printData); |
93cf77c0 JS |
52 | dialog.GetPrintData().SetSetupDialog(TRUE); |
53 | return (dialog.ShowModal() == wxID_OK); | |
54 | } | |
55 | ||
56 | /* | |
57 | * Print preview | |
58 | */ | |
59 | ||
34138703 | 60 | wxPrintPreview::wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): |
93cf77c0 JS |
61 | wxPrintPreviewBase(printout, printoutForPrinting, data) |
62 | { | |
63 | DetermineScaling(); | |
64 | } | |
65 | ||
34138703 | 66 | wxPrintPreview::~wxPrintPreview() |
93cf77c0 JS |
67 | { |
68 | } | |
69 | ||
34138703 | 70 | bool wxPrintPreview::Print(bool interactive) |
93cf77c0 | 71 | { |
7f555861 | 72 | if (!m_printPrintout) |
93cf77c0 | 73 | return FALSE; |
7f555861 JS |
74 | wxPrinter printer(&m_printData); |
75 | return printer.Print(m_previewFrame, m_printPrintout, interactive); | |
93cf77c0 JS |
76 | } |
77 | ||
34138703 | 78 | void wxPrintPreview::DetermineScaling() |
93cf77c0 JS |
79 | { |
80 | // TODO | |
81 | } | |
82 |