]>
git.saurik.com Git - wxWidgets.git/blob - samples/printing/printing.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: samples/printing.h
4 // Purpose: Printing demo for wxWidgets
5 // Author: Julian Smart
9 // Copyright: (c) Julian Smart
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 // Define a new application
14 class MyApp
: public wxApp
28 // Define a new canvas and frame
29 class MyFrame
: public wxFrame
35 MyFrame(wxFrame
*frame
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
);
38 void OnAngleUp(wxCommandEvent
& event
);
39 void OnAngleDown(wxCommandEvent
& event
);
41 void OnSize(wxSizeEvent
& event
);
42 void OnPrint(wxCommandEvent
& event
);
43 void OnPrintPreview(wxCommandEvent
& event
);
44 void OnPageSetup(wxCommandEvent
& event
);
45 #if defined(__WXMSW__) && wxTEST_POSTSCRIPT_IN_MSW
46 void OnPrintPS(wxCommandEvent
& event
);
47 void OnPrintPreviewPS(wxCommandEvent
& event
);
48 void OnPageSetupPS(wxCommandEvent
& event
);
51 void OnPageMargins(wxCommandEvent
& event
);
54 void OnExit(wxCommandEvent
& event
);
55 void OnPrintAbout(wxCommandEvent
& event
);
59 // Define a new canvas which can receive some events
60 class MyCanvas
: public wxScrolledWindow
63 MyCanvas(wxFrame
*frame
, const wxPoint
& pos
, const wxSize
& size
, long style
= wxRETAINED
);
66 virtual void OnDraw(wxDC
& dc
);
67 void OnEvent(wxMouseEvent
& event
);
72 class MyPrintout
: public wxPrintout
75 MyPrintout(const wxChar
*title
= _T("My printout")):wxPrintout(title
) {}
76 bool OnPrintPage(int page
);
77 bool HasPage(int page
);
78 bool OnBeginDocument(int startPage
, int endPage
);
79 void GetPageInfo(int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
87 #define WXPRINT_QUIT 100
88 #define WXPRINT_PRINT 101
89 #define WXPRINT_PAGE_SETUP 103
90 #define WXPRINT_PREVIEW 104
92 #define WXPRINT_PRINT_PS 105
93 #define WXPRINT_PAGE_SETUP_PS 107
94 #define WXPRINT_PREVIEW_PS 108
96 #define WXPRINT_ABOUT 109
98 #define WXPRINT_ANGLEUP 110
99 #define WXPRINT_ANGLEDOWN 111
102 #define WXPRINT_PAGE_MARGINS 112