]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/helpinst.tex
c51a4017aeabd6fc02f4b26ef181157c88e5a39b
[wxWidgets.git] / docs / latex / wx / helpinst.tex
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 classes actually derive from wxHelpControllerBase, the
17 appropriate class is aliased to wxHelpController for each platform.
18
19 There are currently the following help controller classes defined:
20
21 \begin{itemize}\itemsep=0
22 \item wxWinHelpController, for controlling Windows Help.
23 \item wxExtHelpController, for controlling external browsers under Unix.
24 The default browser is Netscape Navigator.
25 \end{itemize}
26
27 \wxheading{Derivation}
28
29 wxHelpControllerBase\\
30 \helpref{wxObject}{wxobject}
31
32 \wxheading{Include file}
33
34 {\tt <wx/help.h>}
35
36 \latexignore{\rtfignore{\wxheading{Members}}}
37
38 \membersection{wxHelpController::wxHelpController}
39
40 \func{}{wxHelpController}{\void}
41
42 Constructs a help instance object, but does not invoke the help viewer.
43
44 \membersection{wxHelpController::\destruct{wxHelpController}}
45
46 \func{}{\destruct{wxHelpController}}{\void}
47
48 Destroys the help instance, closing down the viewer if it is running.
49
50 \membersection{wxHelpController::Initialize}\label{wxhelpcontrollerinitialize}
51
52 \func{virtual void}{Initialize}{\param{const wxString\& }{file}}
53
54 \func{virtual void}{Initialize}{\param{const wxString\& }{file}, \param{int}{ server}}
55
56 Initializes the help instance with a help filename, and optionally a server (socket)
57 number. Does not invoke the help viewer.
58 This must be called directly after the help instance object is created and before
59 any attempts to communicate with the viewer.
60
61 You may omit the file extension and a suitable one will be chosen.
62
63 \membersection{wxHelpController::DisplayBlock}\label{wxhelpcontrollerdisplayblock}
64
65 \func{virtual bool}{DisplayBlock}{\param{long}{ blockNo}}
66
67 If the help viewer is not running, runs it and displays the file at the given block number.
68 The interpretation of {\it blockNo} differs between help viewers. If using Windows Help, this
69 refers to the context number. If wxHelp, this is the wxHelp block number.
70
71 \membersection{wxHelpController::DisplayContents}\label{wxhelpcontrollerdisplaycontents}
72
73 \func{virtual bool}{DisplayContents}{\void}
74
75 If the help viewer is not running, runs it and displays the
76 contents.
77
78 \membersection{wxHelpController::DisplaySection}\label{wxhelpcontrollerdisplaysection}
79
80 \func{virtual bool}{DisplaySection}{\param{int}{ sectionNo}}
81
82 If the help viewer is not running, runs it and displays the given section.
83 Sections are numbered starting from 1.
84
85 For wxHelp, section numbers may be viewed by running wxHelp in edit mode.
86
87 DisplaySection does not apply to WinHelp.
88
89 \membersection{wxHelpController::KeywordSearch}\label{wxhelpcontrollerkeywordsearch}
90
91 \func{virtual bool}{KeywordSearch}{\param{const wxString\& }{keyWord}}
92
93 If the help viewer is not running, runs it, and searches for sections matching the given keyword. If one
94 match is found, the file is displayed at this section. If more than one
95 match is found, the Search dialog is displayed with the matches (wxHelp)
96 or the first topic is displayed (Windows Help).
97
98 \membersection{wxHelpController::LoadFile}\label{wxhelpcontrollerloadfile}
99
100 \func{virtual bool}{LoadFile}{\param{const wxString\& }{file = NULL}}
101
102 If the help viewer is not running, runs it and loads the given file.
103 If the filename is not supplied or is
104 NULL, the file specified in {\bf Initialize} is used. If the viewer is
105 already displaying the specified file, it will not be reloaded. This
106 member function may be used before each display call in case the user
107 has opened another file.
108
109 \membersection{wxHelpController::OnQuit}\label{wxhelpcontrolleronquit}
110
111 \func{virtual bool}{OnQuit}{\void}
112
113 Overridable member called when this application's viewer is quit by the user.
114
115 This does not work for all help controllers.
116
117 \membersection{wxHelpController::Quit}\label{wxhelpcontrollerquit}
118
119 \func{virtual bool}{Quit}{\void}
120
121 If the viewer is running, quits it by disconnecting.
122
123 For Windows Help, the viewer will only close if no other application is using it.
124