wxMaxima
Loading...
Searching...
No Matches
pdfgc.h
1
2// Name: samples/pdfgc/pdfgc.h
3// Purpose: wxPdfGraphicsContext sample
4// Author: Blake Madden
5// Created: 2026-05-09
6// Copyright: (c) 2026 Blake Madden
7// Licence: wxWindows licence
9
10#ifndef SAMPLES_PDFGC_PDFGC_H_
11#define SAMPLES_PDFGC_PDFGC_H_
12
13#include <wx/print.h>
14#include <wx/printdlg.h>
15#include <wx/scrolwin.h>
16
17class MyApp : public wxApp
18{
19public:
20 bool OnInit() wxOVERRIDE;
21 int OnExit() wxOVERRIDE;
22};
23
24DECLARE_APP(MyApp)
25
26class MyCanvas;
27
28class MyFrame : public wxFrame
29{
30public:
31 MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
32
33 void OnSavePdf(wxCommandEvent& event);
34 void OnSavePdfStandAlone(wxCommandEvent& event);
35 void OnPrint(wxCommandEvent& event);
36 void OnPageSetup(wxCommandEvent& event);
37 void OnExit(wxCommandEvent& event);
38 void OnAbout(wxCommandEvent& event);
39
40private:
41 MyCanvas* m_canvas;
42
43 wxDECLARE_EVENT_TABLE();
44};
45
46class MyCanvas : public wxScrolledWindow
47{
48public:
49 MyCanvas(wxWindow* parent);
50
51 void OnPaint(wxPaintEvent& event);
52
53private:
54 wxDECLARE_EVENT_TABLE();
55};
56
57class MyPrintout : public wxPrintout
58{
59public:
60 MyPrintout(const wxString& title) : wxPrintout(title) {}
61
62 bool OnPrintPage(int page) wxOVERRIDE;
63 bool HasPage(int page) wxOVERRIDE;
64 void GetPageInfo(int* minPage, int* maxPage,
65 int* selPageFrom, int* selPageTo) wxOVERRIDE;
66};
67
68enum
69{
70 PdfGc_SavePdf = wxID_HIGHEST + 1,
71 PdfGc_SavePdfStandAlone,
72 PdfGc_Print,
73 PdfGc_PageSetup
74};
75
76// Logical drawing surface size (in points: 1 pt = 1/72 inch).
77constexpr int PDFGC_SCENE_WIDTH = 580;
78constexpr int PDFGC_SCENE_HEIGHT = 820;
79
80// Renders the demo scene.
81void DrawScene(wxGraphicsContext& gc, const wxSize& size);
82
83#endif // SAMPLES_PDFGC_PDFGC_H_
Definition: test_ImgCell.cpp:354
bool OnInit() override
Definition: test_ImgCell.cpp:367
Definition: printing.h:96
Definition: gridctrlsample.h:17
Definition: printing.h:108