Some updates; simple wxHTML/external HTML controllers now have DisplaySection(const wxString&).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -257,6 +257,10 @@ samples/help/*.hlp
|
||||
samples/help/*.cnt
|
||||
samples/help/*.zip
|
||||
samples/help/*.htb
|
||||
samples/help/*.chm
|
||||
samples/help/*.hhp
|
||||
samples/help/*.hhk
|
||||
samples/help/*.hhc
|
||||
samples/help/*.hpj
|
||||
samples/help/*.tex
|
||||
samples/help/*.ini
|
||||
|
@@ -101,10 +101,14 @@ If the help viewer is not running, runs it and displays the file at the given bl
|
||||
|
||||
{\it WinHelp:} Refers to the context number.
|
||||
|
||||
{\it MS HTML Help:} Refers to the context number.
|
||||
|
||||
{\it External HTML help:} the same as for \helpref{wxHelpController::DisplaySection}{wxhelpcontrollerdisplaysection}.
|
||||
|
||||
{\it wxHtmlHelpController:} {\it sectionNo} is an identifier as specified in the {\tt .hhc} file. See \helpref{Help files format}{helpformat}.
|
||||
|
||||
This function is for backward compatibility only, and applications should use \helpref{wxHelpController}{wxhelpcontrollerwxdisplaysection} instead.
|
||||
|
||||
\membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents}
|
||||
|
||||
\func{virtual bool}{DisplayContents}{\void}
|
||||
@@ -119,8 +123,9 @@ contents.
|
||||
If the help viewer is not running, runs it and displays the given section.
|
||||
|
||||
The interpretation of {\it section} differs between help viewers. For most viewers,
|
||||
this call is equivalent to KeywordSearch. For MS HTML Help, if {\it section} has a .htm
|
||||
or .html extension, that HTML file within the .chm file will be displayed; otherwise
|
||||
this call is equivalent to KeywordSearch. For MS HTML Help, external HTML help
|
||||
and simple wxHTML help, if {\it section} has a .htm
|
||||
or .html extension, that HTML file will be displayed; otherwise
|
||||
a keyword search is done.
|
||||
|
||||
\func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}}
|
||||
@@ -129,7 +134,7 @@ If the help viewer is not running, runs it and displays the given section.
|
||||
|
||||
{\it WinHelp, MS HTML Help:} {\it sectionNo} is a context id.
|
||||
|
||||
{\it External HTML help/wxHTML based help:} wxExtHelpController and wxHelpControllerHtml implement {\it sectionNo} as an id in a map file, which is of the form:
|
||||
{\it External HTML help/simple wxHTML help:} wxExtHelpController and wxHelpControllerHtml implement {\it sectionNo} as an id in a map file, which is of the form:
|
||||
|
||||
\begin{verbatim}
|
||||
0 wx.html ; Index
|
||||
@@ -176,7 +181,7 @@ match is found, the file is displayed at this section.
|
||||
{\it WinHelp, MS HTML Help:} If more than one match is found,
|
||||
the first topic is displayed.
|
||||
|
||||
{\it External HTML help:} If more than one match is found,
|
||||
{\it External HTML help, simple wxHTML help:} If more than one match is found,
|
||||
a choice of topics is displayed.
|
||||
|
||||
{\it wxHtmlHelpController:} see \helpref{wxHtmlHelpController::KeywordSearch}{wxhtmlhelpcontrollerkeywordsearch}.
|
||||
|
@@ -145,7 +145,7 @@ Displays help window and focuses index panel.
|
||||
Displays help window, focuses search panel and starts searching.
|
||||
Returns TRUE if the keyword was found.
|
||||
|
||||
{\bf Important:} KeywordSearch searches only pages listed in .htc file(s).
|
||||
{\bf Important:} KeywordSearch searches only pages listed in .hhc file(s).
|
||||
You should list all pages in the contents file.
|
||||
|
||||
\membersection{wxHtmlHelpController::ReadCustomization}\label{wxhtmlhelpcontrollerreadcustomization}
|
||||
|
@@ -74,7 +74,7 @@ DECLARE_CLASS(wxExtHelpController)
|
||||
/// Is the viewer a variant of netscape?
|
||||
bool m_BrowserIsNetscape;
|
||||
/// Call the browser using a relative URL.
|
||||
virtual bool DisplayHelp(wxString const &);
|
||||
virtual bool DisplayHelp(const wxString&);
|
||||
};
|
||||
|
||||
#endif // wxUSE_HELP
|
||||
|
@@ -103,6 +103,10 @@ DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase)
|
||||
/** Display help for id sectionNo -- identical with DisplaySection().
|
||||
@return true on success
|
||||
*/
|
||||
virtual bool DisplaySection(const wxString& section);
|
||||
/** Display help for URL (using DisplayHelp) or keyword (using KeywordSearch)
|
||||
@return true on success
|
||||
*/
|
||||
virtual bool DisplayBlock(long blockNo);
|
||||
/** Search comment/documentation fields in map file and present a
|
||||
list to chose from.
|
||||
@@ -117,7 +121,7 @@ DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase)
|
||||
virtual void OnQuit(void);
|
||||
|
||||
/// Call the browser using a relative URL.
|
||||
virtual bool DisplayHelp(wxString const &) = 0;
|
||||
virtual bool DisplayHelp(const wxString &) = 0;
|
||||
|
||||
/// Allows one to override the default settings for the help frame.
|
||||
virtual void SetFrameParameters(const wxString& WXUNUSED(title),
|
||||
|
@@ -58,7 +58,7 @@ DECLARE_CLASS(wxHelpControllerHtml)
|
||||
|
||||
private:
|
||||
/// Call the browser using a relative URL.
|
||||
virtual bool DisplayHelp(wxString const &);
|
||||
virtual bool DisplayHelp(const wxString &);
|
||||
protected:
|
||||
friend class wxHelpFrame;
|
||||
class wxHelpFrame *m_Frame;
|
||||
|
@@ -12,7 +12,7 @@
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
PROGRAM=demo
|
||||
#EXTRALIBS=htmlhelp.lib
|
||||
EXTRALIBS=htmlhelp.lib
|
||||
OBJECTS = $(PROGRAM).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.vc
|
||||
|
@@ -81,7 +81,7 @@ void wxExtHelpController::SetViewer(const wxString& viewer, long flags)
|
||||
}
|
||||
|
||||
bool
|
||||
wxExtHelpController::DisplayHelp(wxString const &relativeURL)
|
||||
wxExtHelpController::DisplayHelp(const wxString &relativeURL)
|
||||
{
|
||||
wxBusyCursor b; // display a busy cursor
|
||||
|
||||
|
@@ -251,6 +251,16 @@ wxHTMLHelpControllerBase::DisplaySection(int sectionNo)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxHTMLHelpControllerBase::DisplaySection(const wxString& section)
|
||||
{
|
||||
bool isFilename = (section.Find(wxT(".htm")) != -1);
|
||||
|
||||
if (isFilename)
|
||||
return DisplayHelp(section);
|
||||
else
|
||||
return KeywordSearch(section);
|
||||
}
|
||||
|
||||
bool
|
||||
wxHTMLHelpControllerBase::DisplayBlock(long blockNo)
|
||||
{
|
||||
|
@@ -266,7 +266,7 @@ wxHelpControllerHtml::~wxHelpControllerHtml(void)
|
||||
#endif
|
||||
|
||||
bool
|
||||
wxHelpControllerHtml::DisplayHelp(wxString const &relativeURL)
|
||||
wxHelpControllerHtml::DisplayHelp(const wxString &relativeURL)
|
||||
{
|
||||
wxBusyCursor b; // display a busy cursor
|
||||
|
||||
|
@@ -80,13 +80,8 @@ bool wxCHMHelpController::DisplaySection(const wxString& section)
|
||||
|
||||
wxString str = GetValidFilename(m_helpFile);
|
||||
|
||||
bool isFilename = TRUE;
|
||||
|
||||
// Is this an HTML file or a keyword?
|
||||
wxString path, filename, ext;
|
||||
wxSplitPath(section, & path, & filename, & ext);
|
||||
if (ext != wxT("htm") && ext != wxT("html"))
|
||||
isFilename = FALSE;
|
||||
bool isFilename = (section.Find(wxT(".htm")) != -1);
|
||||
|
||||
if (isFilename)
|
||||
HtmlHelp(GetSuitableHWND(), (const wxChar*) str, HH_DISPLAY_TOPIC, (DWORD) (const wxChar*) section);
|
||||
|
Reference in New Issue
Block a user