]>
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. | |
33b64e6f | 26 | \item wxXLPHelpController, for controlling wxHelp (from wxWindows 1). |
6fb26ea3 | 27 | \end{itemize} |
a660d684 | 28 | |
954b8ae6 | 29 | \wxheading{Derived from} |
a660d684 | 30 | |
6fb26ea3 JS |
31 | wxHelpControllerBase\\ |
32 | \helpref{wxObject}{wxobject} | |
fe604ccd | 33 | |
954b8ae6 | 34 | \wxheading{Include files} |
a660d684 | 35 | |
dbdb39b2 JS |
36 | <wx/help.h> (wxWindows chooses the appropriate help controller class)\\ |
37 | <wx/helpbase.h> (wxHelpControllerBase class)\\ | |
38 | <wx/helpwin.h> (Windows Help controller)\\ | |
33b64e6f JS |
39 | <wx/generic/helpext.h> (external HTML browser controller) |
40 | <wx/generic/helpxlp.h> (wxHelp controller) | |
a660d684 KB |
41 | |
42 | \latexignore{\rtfignore{\wxheading{Members}}} | |
43 | ||
6fb26ea3 | 44 | \membersection{wxHelpController::wxHelpController} |
a660d684 | 45 | |
6fb26ea3 | 46 | \func{}{wxHelpController}{\void} |
a660d684 | 47 | |
fe604ccd | 48 | Constructs a help instance object, but does not invoke the help viewer. |
a660d684 | 49 | |
6fb26ea3 | 50 | \membersection{wxHelpController::\destruct{wxHelpController}} |
a660d684 | 51 | |
6fb26ea3 | 52 | \func{}{\destruct{wxHelpController}}{\void} |
a660d684 | 53 | |
fe604ccd | 54 | Destroys the help instance, closing down the viewer if it is running. |
a660d684 | 55 | |
6fb26ea3 | 56 | \membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize} |
a660d684 | 57 | |
fe604ccd JS |
58 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}} |
59 | ||
60 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}} | |
a660d684 KB |
61 | |
62 | Initializes the help instance with a help filename, and optionally a server (socket) | |
33b64e6f | 63 | number if using wxHelp. Does not invoke the help viewer. |
a660d684 | 64 | This must be called directly after the help instance object is created and before |
fe604ccd JS |
65 | any attempts to communicate with the viewer. |
66 | ||
67 | You may omit the file extension and a suitable one will be chosen. | |
a660d684 | 68 | |
6fb26ea3 | 69 | \membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock} |
a660d684 | 70 | |
fe604ccd | 71 | \func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}} |
a660d684 | 72 | |
fe604ccd | 73 | If the help viewer is not running, runs it and displays the file at the given block number. |
33b64e6f JS |
74 | |
75 | {\it wxHelp:} this is the wxHelp block number. | |
76 | ||
77 | {\it WinHelp:} Refers to the context number. | |
78 | ||
79 | {\it External HTML help:} the same as for \helpref{wxHelpController::DisplaySection}{wxhelpcontrollerdisplaysection}. | |
a660d684 | 80 | |
6fb26ea3 | 81 | \membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents} |
a660d684 | 82 | |
fe604ccd | 83 | \func{virtual bool}{DisplayContents}{\void} |
a660d684 | 84 | |
fe604ccd JS |
85 | If the help viewer is not running, runs it and displays the |
86 | contents. | |
a660d684 | 87 | |
6fb26ea3 | 88 | \membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection} |
a660d684 | 89 | |
fe604ccd | 90 | \func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}} |
a660d684 | 91 | |
fe604ccd | 92 | If the help viewer is not running, runs it and displays the given section. |
a660d684 | 93 | |
33b64e6f JS |
94 | {\it wxHelp:} Sections are numbered starting from 1. Section numbers may be viewed by running wxHelp in edit mode. |
95 | ||
96 | {\it WinHelp:} {\it sectionNo} is a context id. | |
a660d684 | 97 | |
33b64e6f JS |
98 | {\it External HTML help:} wxExtHelpController implements {\it sectionNo} as an id in a map file, which is of the form: |
99 | ||
100 | \begin{verbatim} | |
101 | 0 wx.html ; Index | |
102 | 1 wx34.html#classref ; Class reference | |
103 | 2 wx204.html ; Function reference | |
104 | \end{verbatim} | |
a660d684 | 105 | |
6fb26ea3 | 106 | \membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch} |
a660d684 | 107 | |
fe604ccd JS |
108 | \func{virtual bool}{KeywordSearch}{\param{const wxString\& }{keyWord}} |
109 | ||
110 | If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one | |
33b64e6f JS |
111 | match is found, the file is displayed at this section. |
112 | ||
113 | {\it wxHelp:} If more than one | |
114 | match is found, the Search dialog is displayed with the matches. | |
115 | ||
116 | {\it WinHelp:} If more than one match is found, | |
117 | the first topic is displayed. | |
118 | ||
119 | {\it External HTML help:} If more than one match is found, | |
120 | a choice of topics is displayed. | |
a660d684 | 121 | |
6fb26ea3 | 122 | \membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile} |
a660d684 | 123 | |
33b64e6f | 124 | \func{virtual bool}{LoadFile}{\param{const wxString\& }{file = ""}} |
a660d684 | 125 | |
fe604ccd JS |
126 | If the help viewer is not running, runs it and loads the given file. |
127 | If the filename is not supplied or is | |
128 | NULL, the file specified in {\bf Initialize} is used. If the viewer is | |
a660d684 KB |
129 | already displaying the specified file, it will not be reloaded. This |
130 | member function may be used before each display call in case the user | |
131 | has opened another file. | |
132 | ||
33b64e6f JS |
133 | \membersection{wxHelpController::SetViewer}\label{wxhelpcontrollersetviewer} |
134 | ||
135 | \func{virtual void}{SetViewer}{\param{const wxString\& }{viewer}, \param{long}{ flags}} | |
136 | ||
137 | Sets detailed viewer information. So far this is only relevant to wxExtHelpController. | |
138 | ||
139 | \wxheading{Parameters} | |
140 | ||
141 | \docparam{viewer}{This defaults to "netscape" for wxExtHelpController.} | |
142 | ||
143 | \docparam{flags}{This defaults to wxHELP\_NETSCAPE for wxExtHelpController, indicating | |
144 | that the viewer is a variant of Netscape Navigator.} | |
145 | ||
6fb26ea3 | 146 | \membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit} |
fe604ccd JS |
147 | |
148 | \func{virtual bool}{OnQuit}{\void} | |
a660d684 | 149 | |
fe604ccd | 150 | Overridable member called when this application's viewer is quit by the user. |
a660d684 | 151 | |
6fb26ea3 | 152 | This does not work for all help controllers. |
a660d684 | 153 | |
6fb26ea3 | 154 | \membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit} |
a660d684 | 155 | |
fe604ccd | 156 | \func{virtual bool}{Quit}{\void} |
a660d684 | 157 | |
fe604ccd | 158 | If the viewer is running, quits it by disconnecting. |
a660d684 | 159 | |
fe604ccd | 160 | For Windows Help, the viewer will only close if no other application is using it. |
a660d684 | 161 |