void OnForward(wxCommandEvent& event);
private:
+ wxHtmlWindow *m_Html;
// any class wishing to process wxWindows events must use this macro
DECLARE_EVENT_TABLE()
};
#if wxUSE_LIBJPEG
wxImage::AddHandler(new wxJPEGHandler);
#endif
+ #if wxUSE_GIF
+ wxImage::AddHandler(new wxGIFHandler);
+ #endif
// Create the main application window
MyFrame *frame = new MyFrame("wxHtmlWindow testing application",
wxPoint(50, 50), wxSize(640, 480));
+ MyFrame *frame2 = new MyFrame("wxHtmlWindow testing application, frame 2",
+ wxPoint(150, 50), wxSize(320, 240));
// Show it and tell the application that it's our main window
// @@@ what does it do exactly, in fact? is it necessary here?
frame->Show(TRUE);
+ frame2->Show(TRUE);
SetTopWindow(frame);
// main frame
// ----------------------------------------------------------------------------
-wxHtmlWindow *html;
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
- : wxFrame((wxFrame *)NULL, -1, title, pos, size)
+ : wxFrame((wxFrame *)NULL, -1, title, pos, size, wxDEFAULT_FRAME_STYLE, "html_test_app")
{
// create a menu bar
wxMenu *menuFile = new wxMenu;
menuFile->Append(Minimal_About, "&Load wxWindows manual page");
menuFile->AppendSeparator();
- menuFile->Append(Minimal_Quit, "E&xit");
+ menuFile->Append(Minimal_Quit, "&Close frame");
menuNav->Append(Minimal_Back, "Go &BACK");
menuNav->Append(Minimal_Forward, "Go &FORWARD");
{
wxConfig *cfg = new wxConfig("wxHtmlTest");
- html = new wxHtmlWindow(this);
- html -> SetRelatedFrame(this, "HTML : %s");
- html -> SetRelatedStatusBar(0);
- html -> ReadCustomization(cfg);
+ m_Html = new wxHtmlWindow(this);
+ m_Html -> SetRelatedFrame(this, "HTML : %s");
+ m_Html -> SetRelatedStatusBar(0);
+ m_Html -> ReadCustomization(cfg);
delete cfg;
- html -> LoadPage("test.htm");
+ m_Html -> LoadPage("test.htm");
}
}
// TRUE is to force the frame to close
wxLogDebug("about to save config...");
wxConfig *cfg = new wxConfig("wxHtmlTest");
- html -> WriteCustomization(cfg);
+ m_Html -> WriteCustomization(cfg);
delete cfg;
- Close(TRUE);
+ Close(TRUE);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- html -> LoadPage("fft.html");
+ m_Html -> LoadPage("fft.html");
}
void MyFrame::OnBack(wxCommandEvent& WXUNUSED(event))
{
- if (!html -> HistoryBack()) wxMessageBox("You reached prehistory era!");
+ if (!m_Html -> HistoryBack()) wxMessageBox("You reached prehistory era!");
}
void MyFrame::OnForward(wxCommandEvent& WXUNUSED(event))
{
- if (!html -> HistoryForward()) wxMessageBox("No more items in history!");
+ if (!m_Html -> HistoryForward()) wxMessageBox("No more items in history!");
}