+// Define a new frame type: this is going to be our main frame
+class MyFrame : public wxFrame
+{
+ public:
+ // ctor and dtor
+
+ MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
+ virtual ~MyFrame();
+
+ // event handlers (these functions should _not_ be virtual)
+ void OnQuit(wxCommandEvent& event);
+ void OnAbout(wxCommandEvent& event);
+
+ void OnPageSetup(wxCommandEvent& event);
+ void OnPrint(wxCommandEvent& event);
+ void OnPreview(wxCommandEvent& event);
+ void OnOpen(wxCommandEvent& event);
+
+ void OnPrintSmall(wxCommandEvent& event);
+ void OnPrintNormal(wxCommandEvent& event);
+ void OnPrintHuge(wxCommandEvent& event);
+
+
+ private:
+ wxHtmlWindow *m_Html;
+ wxHtmlEasyPrinting *m_Prn;
+ wxString m_Name;
+ // any class wishing to process wxWidgets events must use this macro
+ DECLARE_EVENT_TABLE()
+};
+
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// IDs for the controls and the menu commands
+enum
+{
+ // menu items
+ Minimal_Quit = 1,
+ Minimal_Print,
+ Minimal_Preview,
+ Minimal_PageSetup,
+ Minimal_Open,
+ Minimal_PrintSmall,
+ Minimal_PrintNormal,
+ Minimal_PrintHuge
+
+};
+
+// ----------------------------------------------------------------------------
+// event tables and other macros for wxWidgets
+// ----------------------------------------------------------------------------
+
+// the event tables connect the wxWidgets events with the functions (event
+// handlers) which process them. It can be also done at run-time, but for the
+// simple menu events like this the static method is much simpler.
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+ EVT_MENU(Minimal_Quit, MyFrame::OnQuit)
+ EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
+ EVT_MENU(Minimal_Print, MyFrame::OnPrint)
+ EVT_MENU(Minimal_Preview, MyFrame::OnPreview)
+ EVT_MENU(Minimal_PageSetup, MyFrame::OnPageSetup)
+ EVT_MENU(Minimal_Open, MyFrame::OnOpen)
+ EVT_MENU(Minimal_PrintSmall, MyFrame::OnPrintSmall)
+ EVT_MENU(Minimal_PrintNormal, MyFrame::OnPrintNormal)
+ EVT_MENU(Minimal_PrintHuge, MyFrame::OnPrintHuge)
+END_EVENT_TABLE()