]> git.saurik.com Git - wxWidgets.git/blame - samples/html/printing/printing.h
fixed terminology (widget vs. binded window)
[wxWidgets.git] / samples / html / printing / printing.h
CommitLineData
5526e819
VS
1/*
2 * File: printing.h
3 * Purpose: Printing demo for wxWindows class library
4 * Author: Julian Smart
5 * Created: 1995
6 * Updated:
7 * Copyright: (c) 1995, AIAI, University of Edinburgh
8 */
9
10/* sccsid[] = "%W% %G%" */
11
12#ifdef __GNUG__
13#pragma interface
14#endif
15
16// Define a new application
17class MyApp: public wxApp
18{
19 public:
20 MyApp() ;
21 bool OnInit();
22 int OnExit();
23};
24
25DECLARE_APP(MyApp)
26
27class MyCanvas;
28
29// Define a new canvas and frame
30class MyFrame: public wxFrame
31{
32 public:
33 MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size);
34
35 void OnPrint(wxCommandEvent& event);
36 void OnPrintPreview(wxCommandEvent& event);
37 void OnPrintSetup(wxCommandEvent& event);
38 void OnPageSetup(wxCommandEvent& event);
39#if defined(__WXMSW__) && wxTEST_POSTSCRIPT_IN_MSW
40 void OnPrintPS(wxCommandEvent& event);
41 void OnPrintPreviewPS(wxCommandEvent& event);
42 void OnPrintSetupPS(wxCommandEvent& event);
43 void OnPageSetupPS(wxCommandEvent& event);
44#endif
45
46 void OnExit(wxCommandEvent& event);
47 void OnPrintAbout(wxCommandEvent& event);
48DECLARE_EVENT_TABLE()
49};
50
51
52class MyPrintout: public wxPrintout
53{
54 public:
55 MyPrintout(char *title = "My printout"):wxPrintout(title) {}
56 bool OnPrintPage(int page);
57 bool HasPage(int page);
58 bool OnBeginDocument(int startPage, int endPage);
59 void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo);
60
61 void DrawPageOne(wxDC *dc);
62};
63
64#define WXPRINT_QUIT 100
65#define WXPRINT_PRINT 101
66#define WXPRINT_PRINT_SETUP 102
67#define WXPRINT_PAGE_SETUP 103
68#define WXPRINT_PREVIEW 104
69
70#define WXPRINT_PRINT_PS 105
71#define WXPRINT_PRINT_SETUP_PS 106
72#define WXPRINT_PAGE_SETUP_PS 107
73#define WXPRINT_PREVIEW_PS 108
74
75#define WXPRINT_ABOUT 109
76