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:
Julian Smart
2000-04-18 11:13:16 +00:00
parent fa1b3a43cc
commit a94d44b9b7
11 changed files with 35 additions and 17 deletions

View File

@@ -257,6 +257,10 @@ samples/help/*.hlp
samples/help/*.cnt samples/help/*.cnt
samples/help/*.zip samples/help/*.zip
samples/help/*.htb samples/help/*.htb
samples/help/*.chm
samples/help/*.hhp
samples/help/*.hhk
samples/help/*.hhc
samples/help/*.hpj samples/help/*.hpj
samples/help/*.tex samples/help/*.tex
samples/help/*.ini samples/help/*.ini

View File

@@ -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 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 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}. {\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} \membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents}
\func{virtual bool}{DisplayContents}{\void} \func{virtual bool}{DisplayContents}{\void}
@@ -119,8 +123,9 @@ contents.
If the help viewer is not running, runs it and displays the given section. 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, 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 this call is equivalent to KeywordSearch. For MS HTML Help, external HTML help
or .html extension, that HTML file within the .chm file will be displayed; otherwise 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. a keyword search is done.
\func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}} \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 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} \begin{verbatim}
0 wx.html ; Index 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, {\it WinHelp, MS HTML Help:} If more than one match is found,
the first topic is displayed. 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. a choice of topics is displayed.
{\it wxHtmlHelpController:} see \helpref{wxHtmlHelpController::KeywordSearch}{wxhtmlhelpcontrollerkeywordsearch}. {\it wxHtmlHelpController:} see \helpref{wxHtmlHelpController::KeywordSearch}{wxhtmlhelpcontrollerkeywordsearch}.

View File

@@ -145,7 +145,7 @@ Displays help window and focuses index panel.
Displays help window, focuses search panel and starts searching. Displays help window, focuses search panel and starts searching.
Returns TRUE if the keyword was found. 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. You should list all pages in the contents file.
\membersection{wxHtmlHelpController::ReadCustomization}\label{wxhtmlhelpcontrollerreadcustomization} \membersection{wxHtmlHelpController::ReadCustomization}\label{wxhtmlhelpcontrollerreadcustomization}

View File

@@ -74,7 +74,7 @@ DECLARE_CLASS(wxExtHelpController)
/// Is the viewer a variant of netscape? /// Is the viewer a variant of netscape?
bool m_BrowserIsNetscape; bool m_BrowserIsNetscape;
/// Call the browser using a relative URL. /// Call the browser using a relative URL.
virtual bool DisplayHelp(wxString const &); virtual bool DisplayHelp(const wxString&);
}; };
#endif // wxUSE_HELP #endif // wxUSE_HELP

View File

@@ -103,6 +103,10 @@ DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase)
/** Display help for id sectionNo -- identical with DisplaySection(). /** Display help for id sectionNo -- identical with DisplaySection().
@return true on success @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); virtual bool DisplayBlock(long blockNo);
/** Search comment/documentation fields in map file and present a /** Search comment/documentation fields in map file and present a
list to chose from. list to chose from.
@@ -117,7 +121,7 @@ DECLARE_ABSTRACT_CLASS(wxHTMLHelpControllerBase)
virtual void OnQuit(void); virtual void OnQuit(void);
/// Call the browser using a relative URL. /// 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. /// Allows one to override the default settings for the help frame.
virtual void SetFrameParameters(const wxString& WXUNUSED(title), virtual void SetFrameParameters(const wxString& WXUNUSED(title),

View File

@@ -58,7 +58,7 @@ DECLARE_CLASS(wxHelpControllerHtml)
private: private:
/// Call the browser using a relative URL. /// Call the browser using a relative URL.
virtual bool DisplayHelp(wxString const &); virtual bool DisplayHelp(const wxString &);
protected: protected:
friend class wxHelpFrame; friend class wxHelpFrame;
class wxHelpFrame *m_Frame; class wxHelpFrame *m_Frame;

View File

@@ -12,7 +12,7 @@
WXDIR = $(WXWIN) WXDIR = $(WXWIN)
PROGRAM=demo PROGRAM=demo
#EXTRALIBS=htmlhelp.lib EXTRALIBS=htmlhelp.lib
OBJECTS = $(PROGRAM).obj OBJECTS = $(PROGRAM).obj
!include $(WXDIR)\src\makeprog.vc !include $(WXDIR)\src\makeprog.vc

View File

@@ -81,7 +81,7 @@ void wxExtHelpController::SetViewer(const wxString& viewer, long flags)
} }
bool bool
wxExtHelpController::DisplayHelp(wxString const &relativeURL) wxExtHelpController::DisplayHelp(const wxString &relativeURL)
{ {
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor

View File

@@ -251,6 +251,16 @@ wxHTMLHelpControllerBase::DisplaySection(int sectionNo)
return FALSE; 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 bool
wxHTMLHelpControllerBase::DisplayBlock(long blockNo) wxHTMLHelpControllerBase::DisplayBlock(long blockNo)
{ {

View File

@@ -266,7 +266,7 @@ wxHelpControllerHtml::~wxHelpControllerHtml(void)
#endif #endif
bool bool
wxHelpControllerHtml::DisplayHelp(wxString const &relativeURL) wxHelpControllerHtml::DisplayHelp(const wxString &relativeURL)
{ {
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor

View File

@@ -80,13 +80,8 @@ bool wxCHMHelpController::DisplaySection(const wxString& section)
wxString str = GetValidFilename(m_helpFile); wxString str = GetValidFilename(m_helpFile);
bool isFilename = TRUE;
// Is this an HTML file or a keyword? // Is this an HTML file or a keyword?
wxString path, filename, ext; bool isFilename = (section.Find(wxT(".htm")) != -1);
wxSplitPath(section, & path, & filename, & ext);
if (ext != wxT("htm") && ext != wxT("html"))
isFilename = FALSE;
if (isFilename) if (isFilename)
HtmlHelp(GetSuitableHWND(), (const wxChar*) str, HH_DISPLAY_TOPIC, (DWORD) (const wxChar*) section); HtmlHelp(GetSuitableHWND(), (const wxChar*) str, HH_DISPLAY_TOPIC, (DWORD) (const wxChar*) section);