1998-11-10 16:17:35 -05:00
|
|
|
|
/*-*- c++ -*-********************************************************
|
1999-06-01 11:32:12 -04:00
|
|
|
|
* helpext.h - an external help controller for wxWindows *
|
1998-11-10 16:17:35 -05:00
|
|
|
|
* *
|
|
|
|
|
* (C) 1998 by Karsten Ball<EFBFBD>der (Ballueder@usa.net) *
|
|
|
|
|
* *
|
|
|
|
|
* $Id$
|
|
|
|
|
*******************************************************************/
|
1999-06-01 11:32:12 -04:00
|
|
|
|
|
|
|
|
|
#ifndef __WX_HELPEXT_H_
|
|
|
|
|
#define __WX_HELPEXT_H_
|
1998-11-10 16:17:35 -05:00
|
|
|
|
|
|
|
|
|
#if wxUSE_HELP
|
|
|
|
|
|
2002-08-31 07:29:13 -04:00
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
1998-11-10 16:17:35 -05:00
|
|
|
|
# pragma interface "wxexthlp.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-01-14 08:11:36 -05:00
|
|
|
|
#include "wx/generic/helphtml.h"
|
1998-11-12 17:47:51 -05:00
|
|
|
|
|
1998-11-10 16:17:35 -05:00
|
|
|
|
#ifndef WXEXTHELP_DEFAULTBROWSER
|
|
|
|
|
/// Default browser name.
|
2002-01-28 11:03:50 -05:00
|
|
|
|
# define WXEXTHELP_DEFAULTBROWSER _T("netscape")
|
1998-11-10 16:17:35 -05:00
|
|
|
|
/// Is default browse a variant of netscape?
|
1998-11-15 12:01:25 -05:00
|
|
|
|
# define WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE TRUE
|
1998-11-10 16:17:35 -05:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
This class implements help via an external browser.
|
|
|
|
|
It requires the name of a directory containing the documentation
|
|
|
|
|
and a file mapping numerical Section numbers to relative URLS.
|
|
|
|
|
|
|
|
|
|
The map file contains two or three fields per line:
|
|
|
|
|
numeric_id relative_URL [; comment/documentation]
|
|
|
|
|
|
|
|
|
|
The numeric_id is the id used to look up the entry in
|
|
|
|
|
DisplaySection()/DisplayBlock(). The relative_URL is a filename of
|
|
|
|
|
an html file, relative to the help directory. The optional
|
|
|
|
|
comment/documentation field (after a ';') is used for keyword
|
|
|
|
|
searches, so some meaningful text here does not hurt.
|
|
|
|
|
If the documentation itself contains a ';', only the part before
|
|
|
|
|
that will be displayed in the listbox, but all of it used for search.
|
|
|
|
|
|
|
|
|
|
Lines starting with ';' will be ignored.
|
|
|
|
|
*/
|
|
|
|
|
|
1999-06-01 11:32:12 -04:00
|
|
|
|
class WXDLLEXPORT wxExtHelpController : public wxHTMLHelpControllerBase
|
1998-11-10 16:17:35 -05:00
|
|
|
|
{
|
|
|
|
|
DECLARE_CLASS(wxExtHelpController)
|
|
|
|
|
public:
|
|
|
|
|
wxExtHelpController(void);
|
|
|
|
|
|
|
|
|
|
/** Tell it which browser to use.
|
|
|
|
|
The Netscape support will check whether Netscape is already
|
|
|
|
|
running (by looking at the .netscape/lock file in the user's
|
|
|
|
|
home directory) and tell it to load the page into the existing
|
|
|
|
|
window.
|
|
|
|
|
@param browsername The command to call a browser/html viewer.
|
|
|
|
|
@param isNetscape Set this to TRUE if the browser is some variant of Netscape.
|
|
|
|
|
*/
|
1999-02-18 09:55:34 -05:00
|
|
|
|
// Obsolete form
|
1998-11-10 16:17:35 -05:00
|
|
|
|
void SetBrowser(wxString const & browsername = WXEXTHELP_DEFAULTBROWSER,
|
|
|
|
|
bool isNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE);
|
1999-02-18 09:55:34 -05:00
|
|
|
|
|
|
|
|
|
// Set viewer: new name for SetBrowser
|
|
|
|
|
virtual void SetViewer(const wxString& viewer = WXEXTHELP_DEFAULTBROWSER, long flags = wxHELP_NETSCAPE);
|
|
|
|
|
|
1998-11-10 16:17:35 -05:00
|
|
|
|
private:
|
|
|
|
|
/// How to call the html viewer.
|
|
|
|
|
wxString m_BrowserName;
|
|
|
|
|
/// Is the viewer a variant of netscape?
|
|
|
|
|
bool m_BrowserIsNetscape;
|
|
|
|
|
/// Call the browser using a relative URL.
|
2000-07-15 15:51:35 -04:00
|
|
|
|
virtual bool DisplayHelp(const wxString&);
|
1998-11-10 16:17:35 -05:00
|
|
|
|
};
|
|
|
|
|
|
1999-06-01 11:32:12 -04:00
|
|
|
|
#endif // wxUSE_HELP
|
|
|
|
|
|
|
|
|
|
#endif // __WX_HELPEXT_H_
|