]> git.saurik.com Git - wxWidgets.git/blame - src/motif/printdlg.cpp
Doc/distribution script mods
[wxWidgets.git] / src / motif / printdlg.cpp
CommitLineData
4bb6408c
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: printdlg.cpp
3// Purpose: wxPrintDialog, wxPageSetupDialog
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "printdlg.h"
14#endif
15
16#include "wx/object.h"
5dcf05ae 17#include "wx/motif/printdlg.h"
4bb6408c
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
4bb6408c
JS
23IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
24IMPLEMENT_CLASS(wxPageSetupDialog, wxDialog)
4bb6408c
JS
25
26wxPrintDialog::wxPrintDialog():
27 wxDialog()
28{
29 m_dialogParent = NULL;
30 m_printerDC = NULL;
31}
32
33wxPrintDialog::wxPrintDialog(wxWindow *p, wxPrintData* data):
34 wxDialog()
35{
36 Create(p, data);
37}
38
39bool wxPrintDialog::Create(wxWindow *p, wxPrintData* data)
40{
41 m_dialogParent = p;
42 m_printerDC = NULL;
43
44 if ( data )
45 m_printData = *data;
46
47 return TRUE;
48}
49
50wxPrintDialog::~wxPrintDialog()
51{
52 if (m_printerDC)
53 delete m_printerDC;
54}
55
56int wxPrintDialog::ShowModal()
57{
58 // TODO
59 return wxID_CANCEL;
60}
61
62wxDC *wxPrintDialog::GetPrintDC()
63{
64 if (m_printerDC)
65 {
66 wxDC* dc = m_printerDC;
67 m_printerDC = NULL;
68 return dc;
69 }
70 else
71 return NULL;
72}
73
74/*
75 * wxPageSetupDialog
76 */
77
78wxPageSetupDialog::wxPageSetupDialog():
79 wxDialog()
80{
81 m_dialogParent = NULL;
82}
83
84wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data):
85 wxDialog()
86{
87 Create(p, data);
88}
89
90bool wxPageSetupDialog::Create(wxWindow *p, wxPageSetupData *data)
91{
92 m_dialogParent = p;
93
94 if (data)
95 m_pageSetupData = (*data);
96
97 return TRUE;
98}
99
100wxPageSetupDialog::~wxPageSetupDialog()
101{
102}
103
104int wxPageSetupDialog::ShowModal()
105{
106 // Uses generic page setup dialog
107 wxGenericPageSetupDialog *genericPageSetupDialog = new wxGenericPageSetupDialog(GetParent(), & m_pageSetupData);
108 int ret = genericPageSetupDialog->ShowModal();
109 m_pageSetupData = genericPageSetupDialog->GetPageSetupData();
110 genericPageSetupDialog->Close(TRUE);
111 return ret;
112}
113