]>
git.saurik.com Git - wxWidgets.git/blob - samples/html/helpview/helpview.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtml help browser
4 // Please note: see utils/helpview for a more fully-featured
5 // standalone help browser.
6 /////////////////////////////////////////////////////////////////////////////
8 // For compilers that support precompilation, includes "wx/wx.h".
15 // for all others, include the necessary headers (this file is usually all you
16 // need because it includes almost all "standard" wxWidgets headers
22 #include "wx/wxhtml.h"
23 #include "wx/fs_zip.h"
25 #include "wx/filedlg.h"
27 // ----------------------------------------------------------------------------
29 // ----------------------------------------------------------------------------
32 // Define a new application type, each program should derive a class from wxApp
33 class MyApp
: public wxApp
36 // override base class virtuals
37 // ----------------------------
39 // this one is called on application startup and is a good place for the app
40 // initialization (doing it here and not in the ctor allows to have an error
41 // return: if OnInit() returns false, the application terminates)
43 virtual bool OnInit();
47 wxHtmlHelpController
*help
;
57 delete wxLog::SetActiveTarget(new wxLogStderr
); // So dialog boxes aren't used
60 wxInitAllImageHandlers();
61 wxFileSystem::AddHandler(new wxZipFSHandler
);
63 SetVendorName(wxT("wxWidgets"));
64 SetAppName(wxT("wxHTMLHelp"));
65 wxConfig::Get(); // create an instance
67 help
= new wxHtmlHelpController
;
70 wxLogError(wxT("Usage : helpview <helpfile> [<more helpfiles>]"));
71 wxLogError(wxT(" helpfile may be .hhp, .zip or .htb"));
75 for (int i
= 1; i
< argc
; i
++)
76 help
->AddBook(wxFileName(argv
[i
]));
79 delete wxLog::SetActiveTarget(new wxLogGui
);
82 help
-> DisplayContents();
91 delete wxConfig::Set(NULL
);