]>
git.saurik.com Git - wxWidgets.git/blob - samples/html/helpview/helpview.cpp
2 /////////////////////////////////////////////////////////////////////////////
4 // Purpose: wxHtml help browser
5 // Please note: see utils/helpview for a more fully-featured
6 // standalone help browser.
7 /////////////////////////////////////////////////////////////////////////////
10 #pragma implementation "help.cpp"
11 #pragma interface "help.cpp"
14 // For compilers that support precompilation, includes "wx/wx.h".
15 #include "wx/wxprec.h"
21 // for all others, include the necessary headers (this file is usually all you
22 // need because it includes almost all "standard" wxWindows headers
28 #include "wx/wxhtml.h"
29 #include "wx/fs_zip.h"
31 #include "wx/filedlg.h"
33 // ----------------------------------------------------------------------------
35 // ----------------------------------------------------------------------------
38 // Define a new application type, each program should derive a class from wxApp
39 class MyApp
: public wxApp
42 // override base class virtuals
43 // ----------------------------
45 // this one is called on application startup and is a good place for the app
46 // initialization (doing it here and not in the ctor allows to have an error
47 // return: if OnInit() returns false, the application terminates)
49 virtual bool OnInit();
53 wxHtmlHelpController
*help
;
63 delete wxLog::SetActiveTarget(new wxLogStderr
); // So dialog boxes aren't used
66 wxInitAllImageHandlers();
67 wxFileSystem::AddHandler(new wxZipFSHandler
);
69 SetVendorName("wxWindows");
70 SetAppName("wxHTMLHelp");
71 wxConfig::Get(); // create an instance
73 help
= new wxHtmlHelpController
;
76 wxLogError(wxT("Usage : helpview <helpfile> [<more helpfiles>]"));
77 wxLogError(wxT(" helpfile may be .hhp, .zip or .htb"));
81 for (int i
= 1; i
< argc
; i
++)
82 help
-> AddBook(argv
[i
]);
85 delete wxLog::SetActiveTarget(new wxLogGui
);
88 help
-> DisplayContents();
97 delete wxConfig::Set(NULL
);