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