]>
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 #if defined(__GNUG__) && !defined(__APPLE__)
9 #pragma implementation "help.cpp"
10 #pragma interface "help.cpp"
13 // For compilers that support precompilation, includes "wx/wx.h".
14 #include "wx/wxprec.h"
20 // for all others, include the necessary headers (this file is usually all you
21 // need because it includes almost all "standard" wxWidgets headers
27 #include "wx/wxhtml.h"
28 #include "wx/fs_zip.h"
30 #include "wx/filedlg.h"
32 // ----------------------------------------------------------------------------
34 // ----------------------------------------------------------------------------
37 // Define a new application type, each program should derive a class from wxApp
38 class MyApp
: public wxApp
41 // override base class virtuals
42 // ----------------------------
44 // this one is called on application startup and is a good place for the app
45 // initialization (doing it here and not in the ctor allows to have an error
46 // return: if OnInit() returns false, the application terminates)
48 virtual bool OnInit();
52 wxHtmlHelpController
*help
;
62 delete wxLog::SetActiveTarget(new wxLogStderr
); // So dialog boxes aren't used
65 wxInitAllImageHandlers();
66 wxFileSystem::AddHandler(new wxZipFSHandler
);
68 SetVendorName(wxT("wxWidgets"));
69 SetAppName(wxT("wxHTMLHelp"));
70 wxConfig::Get(); // create an instance
72 help
= new wxHtmlHelpController
;
75 wxLogError(wxT("Usage : helpview <helpfile> [<more helpfiles>]"));
76 wxLogError(wxT(" helpfile may be .hhp, .zip or .htb"));
80 for (int i
= 1; i
< argc
; i
++)
81 help
->AddBook(wxFileName(argv
[i
]));
84 delete wxLog::SetActiveTarget(new wxLogGui
);
87 help
-> DisplayContents();
96 delete wxConfig::Set(NULL
);