]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/helpext.h
Added wxMenu::UpdateUI to wxMSW, wxGTK, wxMotif, wxStubs; rearranged/debugged
[wxWidgets.git] / include / wx / generic / helpext.h
1 /*-*- c++ -*-********************************************************
2 * exthlp.h - an external help controller for wxWindows *
3 * *
4 * (C) 1998 by Karsten Ballüder (Ballueder@usa.net) *
5 * *
6 * $Id$
7 *******************************************************************/
8 #ifndef WXXHELP_H
9 #define WXXHELP_H
10
11 #if wxUSE_HELP
12
13 #ifdef __GNUG__
14 # pragma interface "wxexthlp.h"
15 #endif
16
17 #include "wx/generic/helphtml.h"
18
19 #ifndef WXEXTHELP_DEFAULTBROWSER
20 /// Default browser name.
21 # define WXEXTHELP_DEFAULTBROWSER "netscape"
22 /// Is default browse a variant of netscape?
23 # define WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE TRUE
24 #endif
25 /// Name of environment variable to set help browser.
26 #define WXEXTHELP_ENVVAR_BROWSER "WX_HELPBROWSER"
27 /// Is browser a netscape browser?
28 #define WXEXTHELP_ENVVAR_BROWSERISNETSCAPE "WX_HELPBROWSER_NS"
29
30
31 /**
32 This class implements help via an external browser.
33 It requires the name of a directory containing the documentation
34 and a file mapping numerical Section numbers to relative URLS.
35
36 The map file contains two or three fields per line:
37 numeric_id relative_URL [; comment/documentation]
38
39 The numeric_id is the id used to look up the entry in
40 DisplaySection()/DisplayBlock(). The relative_URL is a filename of
41 an html file, relative to the help directory. The optional
42 comment/documentation field (after a ';') is used for keyword
43 searches, so some meaningful text here does not hurt.
44 If the documentation itself contains a ';', only the part before
45 that will be displayed in the listbox, but all of it used for search.
46
47 Lines starting with ';' will be ignored.
48 */
49
50 class wxExtHelpController : public wxHTMLHelpControllerBase
51 {
52 DECLARE_CLASS(wxExtHelpController)
53 public:
54 wxExtHelpController(void);
55
56 /** Tell it which browser to use.
57 The Netscape support will check whether Netscape is already
58 running (by looking at the .netscape/lock file in the user's
59 home directory) and tell it to load the page into the existing
60 window.
61 @param browsername The command to call a browser/html viewer.
62 @param isNetscape Set this to TRUE if the browser is some variant of Netscape.
63 */
64 void SetBrowser(wxString const & browsername = WXEXTHELP_DEFAULTBROWSER,
65 bool isNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE);
66 private:
67 /// How to call the html viewer.
68 wxString m_BrowserName;
69 /// Is the viewer a variant of netscape?
70 bool m_BrowserIsNetscape;
71 /// Call the browser using a relative URL.
72 bool DisplayHelp(wxString const &);
73 };
74
75 #endif
76 #endif