]>
git.saurik.com Git - wxWidgets.git/blob - samples/html/helpview/helpview.cpp
2 /////////////////////////////////////////////////////////////////////////////
4 // Purpose: wxHtml help browser
5 /////////////////////////////////////////////////////////////////////////////
8 #pragma implementation "help.cpp"
9 #pragma interface "help.cpp"
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include <wx/wxprec.h>
19 // for all others, include the necessary headers (this file is usually all you
20 // need because it includes almost all "standard" wxWindows headers
26 #include <wx/wxhtml.h>
27 #include <wx/fs_zip.h>
29 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
34 // Define a new application type, each program should derive a class from wxApp
35 class MyApp
: public wxApp
38 // override base class virtuals
39 // ----------------------------
41 // this one is called on application startup and is a good place for the app
42 // initialization (doing it here and not in the ctor allows to have an error
43 // return: if OnInit() returns false, the application terminates)
45 virtual bool OnInit();
49 wxHtmlHelpController
*help
;
59 wxInitAllImageHandlers();
60 wxFileSystem::AddHandler(new wxZipFSHandler
);
62 config
= new wxConfig("wxHTMLhelp");
63 help
= new wxHtmlHelpController
;
64 help
-> UseConfig(config
);
67 wxLogError("Usage : helpview <helpfile> [<more helpfiles>]");
68 wxLogError(" helpfile may be .hhp, .zip or .htb");
72 for (int i
= 1; i
< argc
; i
++)
73 help
-> AddBook(argv
[i
]);
75 help
-> DisplayContents();