applied Otto Wyss' patch to extend wxHelpController::KeywordSearch with mode argument (modified to the point of reimplementation)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-09-09 17:29:11 +00:00
parent 69efd83d47
commit 69b5cec2b0
18 changed files with 126 additions and 57 deletions

View File

@@ -28,6 +28,13 @@
// Flags for SetViewer
#define wxHELP_NETSCAPE 1
// Search modes:
enum wxHelpSearchMode
{
wxHELP_SEARCH_INDEX,
wxHELP_SEARCH_ALL
};
// Defines the API for help controllers
class WXDLLEXPORT wxHelpControllerBase: public wxObject
{
@@ -63,7 +70,8 @@ public:
// may override this for more specific behaviour.
virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }
virtual bool DisplayBlock(long blockNo) = 0;
virtual bool KeywordSearch(const wxString& k) = 0;
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL) = 0;
/// Allows one to override the default settings for the help frame.
virtual void SetFrameParameters(const wxString& WXUNUSED(title),
const wxSize& WXUNUSED(size),

View File

@@ -20,8 +20,8 @@
#if wxUSE_WXHTML_HELP
#include "wx/html/helpfrm.h"
#include "wx/helpbase.h"
#include "wx/html/helpfrm.h"
#define wxID_HTML_HELPFRAME (wxID_HIGHEST + 1)
@@ -42,7 +42,8 @@ public:
bool Display(int id);
bool DisplayContents();
bool DisplayIndex();
bool KeywordSearch(const wxString& keyword);
bool KeywordSearch(const wxString& keyword,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
wxHtmlHelpFrame* GetFrame() { return m_helpFrame; }
void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString);

View File

@@ -20,6 +20,7 @@
#if wxUSE_WXHTML_HELP
#include "wx/helpbase.h"
#include "wx/html/helpdata.h"
#include "wx/window.h"
#include "wx/frame.h"
@@ -120,7 +121,8 @@ public:
// * word may be pretended by + or -
// (+ : page must contain the word ; - : page can't contain the word)
// * if there is no + or - before the word, + is default
bool KeywordSearch(const wxString& keyword);
bool KeywordSearch(const wxString& keyword,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
void UseConfig(wxConfigBase *config, const wxString& rootpath = wxEmptyString)
{

View File

@@ -37,7 +37,8 @@ class WXDLLEXPORT wxXXXXHelpController: public wxHelpControllerBase
virtual bool DisplayContents();
virtual bool DisplaySection(int sectionNo);
virtual bool DisplayBlock(long blockNo);
virtual bool KeywordSearch(const wxString& k);
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
virtual bool Quit();
virtual void OnQuit();

View File

@@ -70,9 +70,10 @@ public:
return m_helpController->DisplayTextPopup( text, pos );
}
virtual bool KeywordSearch(const wxString& k)
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
{
return m_helpController->KeywordSearch( k );
return m_helpController->KeywordSearch( k, mode );
}
virtual bool Quit()

View File

@@ -37,7 +37,8 @@ public:
virtual bool DisplayBlock(long blockNo);
virtual bool DisplayContextPopup(int contextId);
virtual bool DisplayTextPopup(const wxString& text, const wxPoint& pos);
virtual bool KeywordSearch(const wxString& k);
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
virtual bool Quit();
wxString GetHelpFile() const { return m_helpFile; }

View File

@@ -39,7 +39,8 @@ public:
virtual bool DisplaySection(int sectionNo);
virtual bool DisplayBlock(long blockNo);
virtual bool DisplayContextPopup(int contextId);
virtual bool KeywordSearch(const wxString& k);
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
virtual bool Quit();
inline wxString GetHelpFile() const { return m_helpFile; }

View File

@@ -34,7 +34,8 @@ class WXDLLEXPORT wxWinHelpController: public wxHelpControllerBase
virtual bool DisplayContents();
virtual bool DisplaySection(int sectionNo);
virtual bool DisplayBlock(long blockNo);
virtual bool KeywordSearch(const wxString& k);
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
virtual bool Quit();
virtual void OnQuit();