]>
Commit | Line | Data |
---|---|---|
1 | \section{\class{wxHelpController}}\label{wxhelpcontroller} | |
2 | ||
3 | This is a family of classes by which | |
4 | applications may invoke a help viewer to provide on-line help. | |
5 | ||
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. | |
10 | ||
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. | |
15 | ||
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. | |
19 | ||
20 | There are currently the following help controller classes defined: | |
21 | ||
22 | \begin{itemize}\itemsep=0pt | |
23 | \item wxWinHelpController, for controlling Windows Help. | |
24 | \item wxExtHelpController, for controlling external browsers under Unix. | |
25 | The default browser is Netscape Navigator. | |
26 | \item wxHelpControllerHtml, using wxHTML to display help | |
27 | \item wxXLPHelpController, for controlling wxHelp (from wxWindows 1). | |
28 | \end{itemize} | |
29 | ||
30 | \wxheading{Derived from} | |
31 | ||
32 | wxHelpControllerBase\\ | |
33 | \helpref{wxObject}{wxobject} | |
34 | ||
35 | \wxheading{Include files} | |
36 | ||
37 | <wx/help.h> (wxWindows chooses the appropriate help controller class)\\ | |
38 | <wx/helpbase.h> (wxHelpControllerBase class)\\ | |
39 | <wx/helpwin.h> (Windows Help controller)\\ | |
40 | <wx/generic/helpext.h> (external HTML browser controller) | |
41 | <wx/generic/helpwxht.h> (wxHTML based help controller) | |
42 | <wx/generic/helpxlp.h> (wxHelp controller) | |
43 | ||
44 | \latexignore{\rtfignore{\wxheading{Members}}} | |
45 | ||
46 | \membersection{wxHelpController::wxHelpController} | |
47 | ||
48 | \func{}{wxHelpController}{\void} | |
49 | ||
50 | Constructs a help instance object, but does not invoke the help viewer. | |
51 | ||
52 | \membersection{wxHelpController::\destruct{wxHelpController}} | |
53 | ||
54 | \func{}{\destruct{wxHelpController}}{\void} | |
55 | ||
56 | Destroys the help instance, closing down the viewer if it is running. | |
57 | ||
58 | \membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize} | |
59 | ||
60 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}} | |
61 | ||
62 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}} | |
63 | ||
64 | Initializes the help instance with a help filename, and optionally a server (socket) | |
65 | number if using wxHelp. Does not invoke the help viewer. | |
66 | This must be called directly after the help instance object is created and before | |
67 | any attempts to communicate with the viewer. | |
68 | ||
69 | You may omit the file extension and a suitable one will be chosen. | |
70 | ||
71 | \membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock} | |
72 | ||
73 | \func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}} | |
74 | ||
75 | If the help viewer is not running, runs it and displays the file at the given block number. | |
76 | ||
77 | {\it wxHelp:} this is the wxHelp block number. | |
78 | ||
79 | {\it WinHelp:} Refers to the context number. | |
80 | ||
81 | {\it External HTML help:} the same as for \helpref{wxHelpController::DisplaySection}{wxhelpcontrollerdisplaysection}. | |
82 | ||
83 | \membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents} | |
84 | ||
85 | \func{virtual bool}{DisplayContents}{\void} | |
86 | ||
87 | If the help viewer is not running, runs it and displays the | |
88 | contents. | |
89 | ||
90 | \membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection} | |
91 | ||
92 | \func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}} | |
93 | ||
94 | If the help viewer is not running, runs it and displays the given section. | |
95 | ||
96 | {\it wxHelp:} Sections are numbered starting from 1. Section numbers may be viewed by running wxHelp in edit mode. | |
97 | ||
98 | {\it WinHelp:} {\it sectionNo} is a context id. | |
99 | ||
100 | {\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: | |
101 | ||
102 | \begin{verbatim} | |
103 | 0 wx.html ; Index | |
104 | 1 wx34.html#classref ; Class reference | |
105 | 2 wx204.html ; Function reference | |
106 | \end{verbatim} | |
107 | ||
108 | \membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch} | |
109 | ||
110 | \func{virtual bool}{KeywordSearch}{\param{const wxString\& }{keyWord}} | |
111 | ||
112 | If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one | |
113 | match is found, the file is displayed at this section. | |
114 | ||
115 | {\it wxHelp:} If more than one | |
116 | match is found, the Search dialog is displayed with the matches. | |
117 | ||
118 | {\it WinHelp:} If more than one match is found, | |
119 | the first topic is displayed. | |
120 | ||
121 | {\it External HTML help:} If more than one match is found, | |
122 | a choice of topics is displayed. | |
123 | ||
124 | \membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile} | |
125 | ||
126 | \func{virtual bool}{LoadFile}{\param{const wxString\& }{file = ""}} | |
127 | ||
128 | If the help viewer is not running, runs it and loads the given file. | |
129 | If the filename is not supplied or is | |
130 | NULL, the file specified in {\bf Initialize} is used. If the viewer is | |
131 | already displaying the specified file, it will not be reloaded. This | |
132 | member function may be used before each display call in case the user | |
133 | has opened another file. | |
134 | ||
135 | \membersection{wxHelpController::SetViewer}\label{wxhelpcontrollersetviewer} | |
136 | ||
137 | \func{virtual void}{SetViewer}{\param{const wxString\& }{viewer}, \param{long}{ flags}} | |
138 | ||
139 | Sets detailed viewer information. So far this is only relevant to wxExtHelpController. | |
140 | ||
141 | \membersection{wxHelpController::SetFrameParameters}\label{wxhelpcontrollersetframeparameters} | |
142 | \func{virtual void}{SetFrameParameters} | |
143 | {\param{const wxString \& }{title}, | |
144 | \param{const wxSize \& }{size}, \param{const wxPoint \& }{pos = wxDefaultPosition}, | |
145 | \param{bool }{newFrameEachTime = FALSE}} | |
146 | ||
147 | For the wxHelpControllerHtml, this allows the application to set the | |
148 | default frame title, size and position for the frame. If the title | |
149 | contains \%s, this will be replaced with the page title. If the | |
150 | parammeter newFrameEachTime is set, the controller will open a new | |
151 | help frame each time it is called. For all other help controllers this | |
152 | function has no effect. | |
153 | ||
154 | \membersection{wxHelpController::GetFrameParameters}\label{wxhelpcontrollergetframeparameters} | |
155 | \func{virtual wxFrame *}{GetFrameParameters} | |
156 | {\param{const wxSize * }{size = NULL}, \param{const wxPoint * }{pos = NULL}, | |
157 | \param{bool *}{newFrameEachTime = NULL}} | |
158 | This reads the current settings for the help frame in the case of the | |
159 | wxHelpControllerHtml, setting the frame size, position and | |
160 | the newFrameEachTime parameters to the last values used. It also | |
161 | returns the pointer to the last opened help frame. This can be used | |
162 | for example, to automatically close the help frame on program | |
163 | shutdown. For all other help controllers, this function does nothing | |
164 | and just returns NULL. | |
165 | ||
166 | \wxheading{Parameters} | |
167 | ||
168 | \docparam{viewer}{This defaults to "netscape" for wxExtHelpController.} | |
169 | ||
170 | \docparam{flags}{This defaults to wxHELP\_NETSCAPE for wxExtHelpController, indicating | |
171 | that the viewer is a variant of Netscape Navigator.} | |
172 | ||
173 | \membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit} | |
174 | ||
175 | \func{virtual bool}{OnQuit}{\void} | |
176 | ||
177 | Overridable member called when this application's viewer is quit by the user. | |
178 | ||
179 | This does not work for all help controllers. | |
180 | ||
181 | \membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit} | |
182 | ||
183 | \func{virtual bool}{Quit}{\void} | |
184 | ||
185 | If the viewer is running, quits it by disconnecting. | |
186 | ||
187 | For Windows Help, the viewer will only close if no other application is using it. | |
188 |