+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// IDs for the controls and the menu commands
+enum
+{
+ // menu items
+ Minimal_Quit = 1,
+ Minimal_Help
+};
+
+// ----------------------------------------------------------------------------
+// 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(Minimal_Help, MyFrame::OnHelp)
+ EVT_CLOSE(MyFrame::OnClose)
+END_EVENT_TABLE()
+
+// Create a new application object: this macro will allow wxWidgets to create
+// the application object during program execution (it's better than using a
+// static object for many reasons) and also declares the accessor function
+// wxGetApp() which will return the reference of the right type (i.e. MyApp and
+// not wxApp)
+IMPLEMENT_APP(MyApp)
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// the application class
+// ----------------------------------------------------------------------------
+// `Main program' equivalent: the program execution "starts" here
+bool MyApp::OnInit()
+{
+ if ( !wxApp::OnInit() )
+ return false;
+
+ wxInitAllImageHandlers();
+#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
+ wxFileSystem::AddHandler(new wxZipFSHandler);
+#endif
+ SetVendorName(wxT("wxWidgets"));
+ SetAppName(wxT("wxHTMLHelp"));
+
+ // Create the main application window
+ MyFrame *frame = new MyFrame(_("HTML Help Sample"),
+ wxDefaultPosition, wxDefaultSize);
+
+ // 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);
+ SetTopWindow(frame);
+
+
+ // success: wxApp::OnRun() will be called which will enter the main message
+ // loop and the application will run. If we returned false here, the
+ // application would exit immediately.
+ return true;
+}
+
+// ----------------------------------------------------------------------------
+// main frame
+// ----------------------------------------------------------------------------