]>
Commit | Line | Data |
---|---|---|
fe604ccd | 1 | \section{\class{wxHelpControllerBase}}\label{wxhelpcontrollerbase} |
a660d684 | 2 | |
fe604ccd JS |
3 | This class defines the interface by which |
4 | applications may invoke a help viewer to provide on-line help. | |
a660d684 | 5 | |
fe604ccd JS |
6 | Other classes derive from this class to provide actual implementations |
7 | of help controllers. | |
a660d684 | 8 | |
fe604ccd JS |
9 | A help controller allows an application to display help, at the contents |
10 | or at a particular topic, and shut the help program down on termination. | |
11 | This avoids proliferation of many instances of the help viewer whenever the | |
12 | user requests a different topic via the application's menus or buttons. | |
a660d684 | 13 | |
fe604ccd JS |
14 | Typically, an application will create a help controller instance |
15 | when it starts, and immediately call {\bf Initialize}\rtfsp | |
16 | to associate a filename with it. The help viewer will only get run, however, | |
17 | just before the first call to display something. | |
a660d684 | 18 | |
fe604ccd | 19 | \wxheading{Derivation} |
a660d684 | 20 | |
fe604ccd | 21 | \helpref{wxObject}{wxobject} |
a660d684 | 22 | |
fe604ccd | 23 | \wxheading{See also} |
a660d684 | 24 | |
fe604ccd | 25 | \helpref{wxWinHelpController}{wxwinhelpcontroller} |
a660d684 | 26 | |
fe604ccd | 27 | \wxheading{Include file} |
a660d684 | 28 | |
fe604ccd JS |
29 | {\tt <wx/helpbase.h>} (for just wxHelpControllerBase) |
30 | ||
31 | {\tt <wx/help.h>} (to include the platform-specific controller, e.g. wxWinHelpController) | |
a660d684 | 32 | |
a660d684 KB |
33 | |
34 | \latexignore{\rtfignore{\wxheading{Members}}} | |
35 | ||
fe604ccd | 36 | \membersection{wxHelpControllerBase::wxHelpControllerBase} |
a660d684 | 37 | |
fe604ccd | 38 | \func{}{wxHelpControllerBase}{\void} |
a660d684 | 39 | |
fe604ccd | 40 | Constructs a help instance object, but does not invoke the help viewer. |
a660d684 | 41 | |
fe604ccd | 42 | \membersection{wxHelpControllerBase::\destruct{wxHelpControllerBase}} |
a660d684 | 43 | |
fe604ccd | 44 | \func{}{\destruct{wxHelpControllerBase}}{\void} |
a660d684 | 45 | |
fe604ccd | 46 | Destroys the help instance, closing down the viewer if it is running. |
a660d684 | 47 | |
fe604ccd | 48 | \membersection{wxHelpControllerBase::Initialize}\label{wxhelpcontrollerbaseinitialize} |
a660d684 | 49 | |
fe604ccd JS |
50 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}} |
51 | ||
52 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}} | |
a660d684 KB |
53 | |
54 | Initializes the help instance with a help filename, and optionally a server (socket) | |
fe604ccd | 55 | number. Does not invoke the help viewer. |
a660d684 | 56 | This must be called directly after the help instance object is created and before |
fe604ccd JS |
57 | any attempts to communicate with the viewer. |
58 | ||
59 | You may omit the file extension and a suitable one will be chosen. | |
a660d684 | 60 | |
fe604ccd | 61 | \membersection{wxHelpControllerBase::DisplayBlock}\label{wxhelpcontrollerbasedisplayblock} |
a660d684 | 62 | |
fe604ccd | 63 | \func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}} |
a660d684 | 64 | |
fe604ccd JS |
65 | If the help viewer is not running, runs it and displays the file at the given block number. |
66 | The interpretation of {\it blockNo} differs between help viewers. If using Windows Help, this | |
67 | refers to the context number. If wxHelp, this is the wxHelp block number. | |
a660d684 | 68 | |
fe604ccd | 69 | \membersection{wxHelpControllerBase::DisplayContents}\label{wxhelpcontrollerbasedisplaycontents} |
a660d684 | 70 | |
fe604ccd | 71 | \func{virtual bool}{DisplayContents}{\void} |
a660d684 | 72 | |
fe604ccd JS |
73 | If the help viewer is not running, runs it and displays the |
74 | contents. | |
a660d684 | 75 | |
fe604ccd | 76 | \membersection{wxHelpControllerBase::DisplaySection}\label{wxhelpcontrollerbasedisplaysection} |
a660d684 | 77 | |
fe604ccd | 78 | \func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}} |
a660d684 | 79 | |
fe604ccd JS |
80 | If the help viewer is not running, runs it and displays the given section. |
81 | Sections are numbered starting from 1. | |
a660d684 | 82 | |
fe604ccd | 83 | For wxHelp, section numbers may be viewed by running wxHelp in edit mode. |
a660d684 | 84 | |
fe604ccd | 85 | DisplaySection does not apply to WinHelp. |
a660d684 | 86 | |
fe604ccd | 87 | \membersection{wxHelpControllerBase::KeywordSearch}\label{wxhelpcontrollerbasekeywordsearch} |
a660d684 | 88 | |
fe604ccd JS |
89 | \func{virtual bool}{KeywordSearch}{\param{const wxString\& }{keyWord}} |
90 | ||
91 | If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one | |
a660d684 KB |
92 | match is found, the file is displayed at this section. If more than one |
93 | match is found, the Search dialog is displayed with the matches (wxHelp) | |
94 | or the first topic is displayed (Windows Help). | |
95 | ||
fe604ccd | 96 | \membersection{wxHelpControllerBase::LoadFile}\label{wxhelpcontrollerbaseloadfile} |
a660d684 | 97 | |
fe604ccd | 98 | \func{virtual bool}{LoadFile}{\param{const wxString\& }{file = NULL}} |
a660d684 | 99 | |
fe604ccd JS |
100 | If the help viewer is not running, runs it and loads the given file. |
101 | If the filename is not supplied or is | |
102 | NULL, the file specified in {\bf Initialize} is used. If the viewer is | |
a660d684 KB |
103 | already displaying the specified file, it will not be reloaded. This |
104 | member function may be used before each display call in case the user | |
105 | has opened another file. | |
106 | ||
fe604ccd JS |
107 | \membersection{wxHelpControllerBase::OnQuit}\label{wxhelpcontrollerbaseonquit} |
108 | ||
109 | \func{virtual bool}{OnQuit}{\void} | |
a660d684 | 110 | |
fe604ccd | 111 | Overridable member called when this application's viewer is quit by the user. |
a660d684 | 112 | |
fe604ccd | 113 | This only works for wxXLPHelpController. |
a660d684 | 114 | |
fe604ccd | 115 | \membersection{wxHelpControllerBase::Quit}\label{wxhelpcontrollerbasequit} |
a660d684 | 116 | |
fe604ccd | 117 | \func{virtual bool}{Quit}{\void} |
a660d684 | 118 | |
fe604ccd | 119 | If the viewer is running, quits it by disconnecting. |
a660d684 | 120 | |
fe604ccd | 121 | For Windows Help, the viewer will only close if no other application is using it. |
a660d684 | 122 |