]>
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
26 // Define a new canvas and frame
27 class MyFrame
: public wxFrame
31 MyFrame(wxFrame
*frame
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
37 void OnSize(wxSizeEvent
& event
);
38 void OnPrint(wxCommandEvent
& event
);
39 void OnPrintPreview(wxCommandEvent
& event
);
40 void OnPrintSetup(wxCommandEvent
& event
);
41 void OnPageSetup(wxCommandEvent
& event
);
42 void OnPrintPS(wxCommandEvent
& event
);
43 void OnPrintPreviewPS(wxCommandEvent
& event
);
44 void OnPrintSetupPS(wxCommandEvent
& event
);
45 void OnPageSetupPS(wxCommandEvent
& event
);
46 void OnExit(wxCommandEvent
& event
);
47 void OnPrintAbout(wxCommandEvent
& event
);
51 // Define a new canvas which can receive some events
52 class MyCanvas
: public wxScrolledWindow
55 MyCanvas(wxFrame
*frame
, const wxPoint
& pos
, const wxSize
& size
, long style
= wxRETAINED
);
58 virtual void OnDraw(wxDC
& dc
);
59 void OnEvent(wxMouseEvent
& event
);
64 class MyPrintout
: public wxPrintout
67 MyPrintout(char *title
= "My printout"):wxPrintout(title
) {}
68 bool OnPrintPage(int page
);
69 bool HasPage(int page
);
70 bool OnBeginDocument(int startPage
, int endPage
);
71 void GetPageInfo(int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
73 void DrawPageOne(wxDC
*dc
);
74 void DrawPageTwo(wxDC
*dc
);
77 #define WXPRINT_QUIT 100
78 #define WXPRINT_PRINT 101
79 #define WXPRINT_PRINT_SETUP 102
80 #define WXPRINT_PAGE_SETUP 103
81 #define WXPRINT_PREVIEW 104
83 #define WXPRINT_PRINT_PS 105
84 #define WXPRINT_PRINT_SETUP_PS 106
85 #define WXPRINT_PAGE_SETUP_PS 107
86 #define WXPRINT_PREVIEW_PS 108
88 #define WXPRINT_ABOUT 109