]>
git.saurik.com Git - wxWidgets.git/blob - samples/printing/printing.h
3 * Purpose: Printing demo for wxWindows class library
7 * Copyright: (c) 1995, AIAI, University of Edinburgh
10 /* sccsid[] = "%W% %G%" */
16 // Define a new application
17 class MyApp
: public wxApp
30 // Define a new canvas and frame
31 class MyFrame
: public wxFrame
35 MyFrame(wxFrame
*frame
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
41 void OnSize(wxSizeEvent
& event
);
42 void OnPrint(wxCommandEvent
& event
);
43 void OnPrintPreview(wxCommandEvent
& event
);
44 void OnPrintSetup(wxCommandEvent
& event
);
45 void OnPageSetup(wxCommandEvent
& event
);
46 #if defined(__WXMSW__) && wxTEST_POSTSCRIPT_IN_MSW
47 void OnPrintPS(wxCommandEvent
& event
);
48 void OnPrintPreviewPS(wxCommandEvent
& event
);
49 void OnPrintSetupPS(wxCommandEvent
& event
);
50 void OnPageSetupPS(wxCommandEvent
& event
);
53 void OnExit(wxCommandEvent
& event
);
54 void OnPrintAbout(wxCommandEvent
& event
);
58 // Define a new canvas which can receive some events
59 class MyCanvas
: public wxScrolledWindow
62 MyCanvas(wxFrame
*frame
, const wxPoint
& pos
, const wxSize
& size
, long style
= wxRETAINED
);
65 virtual void OnDraw(wxDC
& dc
);
66 void OnEvent(wxMouseEvent
& event
);
71 class MyPrintout
: public wxPrintout
74 MyPrintout(char *title
= "My printout"):wxPrintout(title
) {}
75 bool OnPrintPage(int page
);
76 bool HasPage(int page
);
77 bool OnBeginDocument(int startPage
, int endPage
);
78 void GetPageInfo(int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
80 void DrawPageOne(wxDC
*dc
);
81 void DrawPageTwo(wxDC
*dc
);
84 #define WXPRINT_QUIT 100
85 #define WXPRINT_PRINT 101
86 #define WXPRINT_PRINT_SETUP 102
87 #define WXPRINT_PAGE_SETUP 103
88 #define WXPRINT_PREVIEW 104
90 #define WXPRINT_PRINT_PS 105
91 #define WXPRINT_PRINT_SETUP_PS 106
92 #define WXPRINT_PAGE_SETUP_PS 107
93 #define WXPRINT_PREVIEW_PS 108
95 #define WXPRINT_ABOUT 109