]> git.saurik.com Git - wxWidgets.git/blame - src/stubs/printdlg.cpp
Compile fix for filefn.cpp
[wxWidgets.git] / src / stubs / printdlg.cpp
CommitLineData
93cf77c0
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: printdlg.cpp
3// Purpose: wxPrintDialog, wxPageSetupDialog
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 "printdlg.h"
14#endif
15
34138703
JS
16#include "wx/object.h"
17#include "wx/stubs/printdlg.h"
93cf77c0
JS
18#include "wx/dcprint.h"
19
20// Use generic page setup dialog: use your own native one if one exists.
21#include "wx/generic/prntdlgg.h"
22
23#if !USE_SHARED_LIBRARY
24IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
25IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog)
26#endif
27
28wxPrintDialog::wxPrintDialog():
29 wxDialog()
30{
34138703
JS
31 m_dialogParent = NULL;
32 m_printerDC = NULL;
93cf77c0
JS
33}
34
35wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data):
36 wxDialog()
37{
38 Create(p, data);
39}
40
41bool wxPrintDialog::Create(wxWindow *p, wxPrintData* data)
42{
34138703
JS
43 m_dialogParent = p;
44 m_printerDC = NULL;
93cf77c0
JS
45
46 if ( data )
34138703 47 m_printData = *data;
93cf77c0
JS
48
49 return TRUE;
50}
51
52wxPrintDialog::~wxPrintDialog()
53{
34138703
JS
54 if (m_printerDC)
55 delete m_printerDC;
93cf77c0
JS
56}
57
58int wxPrintDialog::ShowModal()
59{
60 // TODO
61 return wxID_CANCEL;
62}
63
64wxDC *wxPrintDialog::GetPrintDC()
65{
34138703 66 if (m_printerDC)
93cf77c0 67 {
34138703
JS
68 wxDC* dc = m_printerDC;
69 m_printerDC = NULL;
70 return dc;
93cf77c0
JS
71 }
72 else
73 return NULL;
74}
75
76/*
77 * wxPageSetupDialog
78 */
79
80wxPageSetupDialog::wxPageSetupDialog():
81 wxDialog()
82{
83 m_dialogParent = NULL;
84}
85
86wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data):
87 wxDialog()
88{
89 Create(p, data);
90}
91
92bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data)
93{
94 m_dialogParent = p;
95
96 if (data)
97 m_pageSetupData = (*data);
98
99 return TRUE;
100}
101
102wxPageSetupDialog::~wxPageSetupDialog()
103{
104}
105
106int wxPageSetupDialog::ShowModal()
107{
108 // Uses generic page setup dialog
109 wxGenericPageSetupDialog *genericPageSetupDialog = new wxGenericPageSetupDialog(GetParent(), & m_pageSetupData);
110 int ret = genericPageSetupDialog->ShowModal();
111 m_pageSetupData = genericPageSetupDialog->GetPageSetupData();
112 genericPageSetupDialog->Close(TRUE);
113 return ret;
114}
115