]>
Commit | Line | Data |
---|---|---|
6fb26ea3 | 1 | \section{\class{wxHelpController}}\label{wxhelpcontroller} |
a660d684 | 2 | |
6fb26ea3 | 3 | This is a family of classes by which |
fe604ccd | 4 | applications may invoke a help viewer to provide on-line help. |
a660d684 | 5 | |
fe604ccd JS |
6 | A help controller allows an application to display help, at the contents |
7 | or at a particular topic, and shut the help program down on termination. | |
8 | This avoids proliferation of many instances of the help viewer whenever the | |
9 | user requests a different topic via the application's menus or buttons. | |
a660d684 | 10 | |
fe604ccd JS |
11 | Typically, an application will create a help controller instance |
12 | when it starts, and immediately call {\bf Initialize}\rtfsp | |
13 | to associate a filename with it. The help viewer will only get run, however, | |
14 | just before the first call to display something. | |
a660d684 | 15 | |
6b037754 JS |
16 | Although all help controller classes actually derive from wxHelpControllerBase and have |
17 | names of the form wxXXXHelpController, the | |
18 | appropriate class is aliased to the name wxHelpController for each platform. | |
a660d684 | 19 | |
6fb26ea3 | 20 | There are currently the following help controller classes defined: |
a660d684 | 21 | |
2432b92d | 22 | \begin{itemize}\itemsep=0pt |
6fb26ea3 JS |
23 | \item wxWinHelpController, for controlling Windows Help. |
24 | \item wxExtHelpController, for controlling external browsers under Unix. | |
25 | The default browser is Netscape Navigator. | |
26 | \end{itemize} | |
a660d684 | 27 | |
954b8ae6 | 28 | \wxheading{Derived from} |
a660d684 | 29 | |
6fb26ea3 JS |
30 | wxHelpControllerBase\\ |
31 | \helpref{wxObject}{wxobject} | |
fe604ccd | 32 | |
954b8ae6 | 33 | \wxheading{Include files} |
a660d684 | 34 | |
dbdb39b2 JS |
35 | <wx/help.h> (wxWindows chooses the appropriate help controller class)\\ |
36 | <wx/helpbase.h> (wxHelpControllerBase class)\\ | |
37 | <wx/helpwin.h> (Windows Help controller)\\ | |
38 | <wx/generic/helpext.h> (external browser controller) | |
a660d684 KB |
39 | |
40 | \latexignore{\rtfignore{\wxheading{Members}}} | |
41 | ||
6fb26ea3 | 42 | \membersection{wxHelpController::wxHelpController} |
a660d684 | 43 | |
6fb26ea3 | 44 | \func{}{wxHelpController}{\void} |
a660d684 | 45 | |
fe604ccd | 46 | Constructs a help instance object, but does not invoke the help viewer. |
a660d684 | 47 | |
6fb26ea3 | 48 | \membersection{wxHelpController::\destruct{wxHelpController}} |
a660d684 | 49 | |
6fb26ea3 | 50 | \func{}{\destruct{wxHelpController}}{\void} |
a660d684 | 51 | |
fe604ccd | 52 | Destroys the help instance, closing down the viewer if it is running. |
a660d684 | 53 | |
6fb26ea3 | 54 | \membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize} |
a660d684 | 55 | |
fe604ccd JS |
56 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}} |
57 | ||
58 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}} | |
a660d684 KB |
59 | |
60 | Initializes the help instance with a help filename, and optionally a server (socket) | |
fe604ccd | 61 | number. Does not invoke the help viewer. |
a660d684 | 62 | This must be called directly after the help instance object is created and before |
fe604ccd JS |
63 | any attempts to communicate with the viewer. |
64 | ||
65 | You may omit the file extension and a suitable one will be chosen. | |
a660d684 | 66 | |
6fb26ea3 | 67 | \membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock} |
a660d684 | 68 | |
fe604ccd | 69 | \func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}} |
a660d684 | 70 | |
fe604ccd JS |
71 | If the help viewer is not running, runs it and displays the file at the given block number. |
72 | The interpretation of {\it blockNo} differs between help viewers. If using Windows Help, this | |
73 | refers to the context number. If wxHelp, this is the wxHelp block number. | |
a660d684 | 74 | |
6fb26ea3 | 75 | \membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents} |
a660d684 | 76 | |
fe604ccd | 77 | \func{virtual bool}{DisplayContents}{\void} |
a660d684 | 78 | |
fe604ccd JS |
79 | If the help viewer is not running, runs it and displays the |
80 | contents. | |
a660d684 | 81 | |
6fb26ea3 | 82 | \membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection} |
a660d684 | 83 | |
fe604ccd | 84 | \func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}} |
a660d684 | 85 | |
fe604ccd JS |
86 | If the help viewer is not running, runs it and displays the given section. |
87 | Sections are numbered starting from 1. | |
a660d684 | 88 | |
fe604ccd | 89 | For wxHelp, section numbers may be viewed by running wxHelp in edit mode. |
a660d684 | 90 | |
fe604ccd | 91 | DisplaySection does not apply to WinHelp. |
a660d684 | 92 | |
6fb26ea3 | 93 | \membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch} |
a660d684 | 94 | |
fe604ccd JS |
95 | \func{virtual bool}{KeywordSearch}{\param{const wxString\& }{keyWord}} |
96 | ||
97 | If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one | |
a660d684 KB |
98 | match is found, the file is displayed at this section. If more than one |
99 | match is found, the Search dialog is displayed with the matches (wxHelp) | |
100 | or the first topic is displayed (Windows Help). | |
101 | ||
6fb26ea3 | 102 | \membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile} |
a660d684 | 103 | |
fe604ccd | 104 | \func{virtual bool}{LoadFile}{\param{const wxString\& }{file = NULL}} |
a660d684 | 105 | |
fe604ccd JS |
106 | If the help viewer is not running, runs it and loads the given file. |
107 | If the filename is not supplied or is | |
108 | NULL, the file specified in {\bf Initialize} is used. If the viewer is | |
a660d684 KB |
109 | already displaying the specified file, it will not be reloaded. This |
110 | member function may be used before each display call in case the user | |
111 | has opened another file. | |
112 | ||
6fb26ea3 | 113 | \membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit} |
fe604ccd JS |
114 | |
115 | \func{virtual bool}{OnQuit}{\void} | |
a660d684 | 116 | |
fe604ccd | 117 | Overridable member called when this application's viewer is quit by the user. |
a660d684 | 118 | |
6fb26ea3 | 119 | This does not work for all help controllers. |
a660d684 | 120 | |
6fb26ea3 | 121 | \membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit} |
a660d684 | 122 | |
fe604ccd | 123 | \func{virtual bool}{Quit}{\void} |
a660d684 | 124 | |
fe604ccd | 125 | If the viewer is running, quits it by disconnecting. |
a660d684 | 126 | |
fe604ccd | 127 | For Windows Help, the viewer will only close if no other application is using it. |
a660d684 | 128 |