// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWindows headers
#ifndef WX_PRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
#endif
-#include <wx/image.h>
-#include <wx/html/htmlwin.h>
-
-#include <wx/html/htmprint.h>
+#include "wx/image.h"
+#include "wx/html/htmlwin.h"
+#include "wx/html/htmprint.h"
// ----------------------------------------------------------------------------
class MyFrame : public wxFrame
{
public:
- // ctor(s)
+ // 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);
m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
}
+// frame destructor
+MyFrame::~MyFrame()
+{
+ delete m_Prn;
+ m_Prn = (wxHtmlEasyPrinting *) NULL;
+}
+
// event handlers
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- delete m_Prn;
// TRUE is to force the frame to close
Close(TRUE);
}
{
m_Name = dialog.GetPath();
m_Html -> LoadPage(m_Name);
- m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
+ m_Prn -> SetHeader(m_Name + "(@PAGENUM@/@PAGESCNT@)<hr>", wxPAGE_ALL);
}
}