]>
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 wxXLPHelpController, for controlling wxHelp (from wxWindows 1). | |
27 | \end{itemize} | |
28 | ||
29 | \wxheading{Derived from} | |
30 | ||
31 | wxHelpControllerBase\\ | |
32 | \helpref{wxObject}{wxobject} | |
33 | ||
34 | \wxheading{Include files} | |
35 | ||
36 | <wx/help.h> (wxWindows chooses the appropriate help controller class)\\ | |
37 | <wx/helpbase.h> (wxHelpControllerBase class)\\ | |
38 | <wx/helpwin.h> (Windows Help controller)\\ | |
39 | <wx/generic/helpext.h> (external HTML browser controller) | |
40 | <wx/generic/helpxlp.h> (wxHelp controller) | |
41 | ||
42 | \latexignore{\rtfignore{\wxheading{Members}}} | |
43 | ||
44 | \membersection{wxHelpController::wxHelpController} | |
45 | ||
46 | \func{}{wxHelpController}{\void} | |
47 | ||
48 | Constructs a help instance object, but does not invoke the help viewer. | |
49 | ||
50 | \membersection{wxHelpController::\destruct{wxHelpController}} | |
51 | ||
52 | \func{}{\destruct{wxHelpController}}{\void} | |
53 | ||
54 | Destroys the help instance, closing down the viewer if it is running. | |
55 | ||
56 | \membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize} | |
57 | ||
58 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}} | |
59 | ||
60 | \func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}} | |
61 | ||
62 | Initializes the help instance with a help filename, and optionally a server (socket) | |
63 | number if using wxHelp. Does not invoke the help viewer. | |
64 | This must be called directly after the help instance object is created and before | |
65 | any attempts to communicate with the viewer. | |
66 | ||
67 | You may omit the file extension and a suitable one will be chosen. | |
68 | ||
69 | \membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock} | |
70 | ||
71 | \func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}} | |
72 | ||
73 | If the help viewer is not running, runs it and displays the file at the given block number. | |
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}. | |
80 | ||
81 | \membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents} | |
82 | ||
83 | \func{virtual bool}{DisplayContents}{\void} | |
84 | ||
85 | If the help viewer is not running, runs it and displays the | |
86 | contents. | |
87 | ||
88 | \membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection} | |
89 | ||
90 | \func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}} | |
91 | ||
92 | If the help viewer is not running, runs it and displays the given section. | |
93 | ||
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. | |
97 | ||
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} | |
105 | ||
106 | \membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch} | |
107 | ||
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 | |
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. | |
121 | ||
122 | \membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile} | |
123 | ||
124 | \func{virtual bool}{LoadFile}{\param{const wxString\& }{file = ""}} | |
125 | ||
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 | |
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 | ||
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 | ||
146 | \membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit} | |
147 | ||
148 | \func{virtual bool}{OnQuit}{\void} | |
149 | ||
150 | Overridable member called when this application's viewer is quit by the user. | |
151 | ||
152 | This does not work for all help controllers. | |
153 | ||
154 | \membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit} | |
155 | ||
156 | \func{virtual bool}{Quit}{\void} | |
157 | ||
158 | If the viewer is running, quits it by disconnecting. | |
159 | ||
160 | For Windows Help, the viewer will only close if no other application is using it. | |
161 |