1 \section{\class{wxHelpController
}}\label{wxhelpcontroller
}
3 This is a family of classes by which
4 applications may invoke a help viewer to provide on-line help.
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.
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.
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.
20 There are currently the following help controller classes defined:
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).
30 \wxheading{Derived from
}
32 wxHelpControllerBase\\
33 \helpref{wxObject
}{wxobject
}
35 \wxheading{Include files
}
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)
44 \latexignore{\rtfignore{\wxheading{Members
}}}
46 \membersection{wxHelpController::wxHelpController
}
48 \func{}{wxHelpController
}{\void}
50 Constructs a help instance object, but does not invoke the help viewer.
52 \membersection{wxHelpController::
\destruct{wxHelpController
}}
54 \func{}{\destruct{wxHelpController
}}{\void}
56 Destroys the help instance, closing down the viewer if it is running.
58 \membersection{wxHelpController::Initialize
}\label{wxhelpcontrollerinitialize
}
60 \func{virtual void
}{Initialize
}{\param{const wxString\&
}{file
}}
62 \func{virtual void
}{Initialize
}{\param{const wxString\&
}{file
},
\param{int
}{ server
}}
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.
69 You may omit the file extension and a suitable one will be chosen.
71 \membersection{wxHelpController::DisplayBlock
}\label{wxhelpcontrollerdisplayblock
}
73 \func{virtual bool
}{DisplayBlock
}{\param{long
}{ blockNo
}}
75 If the help viewer is not running, runs it and displays the file at the given block number.
77 {\it wxHelp:
} this is the wxHelp block number.
79 {\it WinHelp:
} Refers to the context number.
81 {\it External HTML help:
} the same as for
\helpref{wxHelpController::DisplaySection
}{wxhelpcontrollerdisplaysection
}.
83 \membersection{wxHelpController::DisplayContents
}\label{wxhelpcontrollerdisplaycontents
}
85 \func{virtual bool
}{DisplayContents
}{\void}
87 If the help viewer is not running, runs it and displays the
90 \membersection{wxHelpController::DisplaySection
}\label{wxhelpcontrollerdisplaysection
}
92 \func{virtual bool
}{DisplaySection
}{\param{int
}{ sectionNo
}}
94 If the help viewer is not running, runs it and displays the given section.
96 {\it wxHelp:
} Sections are numbered starting from
1. Section numbers may be viewed by running wxHelp in edit mode.
98 {\it WinHelp:
} {\it sectionNo
} is a context id.
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:
104 1 wx34.html#classref ; Class reference
105 2 wx204.html ; Function reference
108 \membersection{wxHelpController::KeywordSearch
}\label{wxhelpcontrollerkeywordsearch
}
110 \func{virtual bool
}{KeywordSearch
}{\param{const wxString\&
}{keyWord
}}
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.
115 {\it wxHelp:
} If more than one
116 match is found, the Search dialog is displayed with the matches.
118 {\it WinHelp:
} If more than one match is found,
119 the first topic is displayed.
121 {\it External HTML help:
} If more than one match is found,
122 a choice of topics is displayed.
124 \membersection{wxHelpController::LoadFile
}\label{wxhelpcontrollerloadfile
}
126 \func{virtual bool
}{LoadFile
}{\param{const wxString\&
}{file = ""
}}
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.
135 \membersection{wxHelpController::SetViewer
}\label{wxhelpcontrollersetviewer
}
137 \func{virtual void
}{SetViewer
}{\param{const wxString\&
}{viewer
},
\param{long
}{ flags
}}
139 Sets detailed viewer information. So far this is only relevant to wxExtHelpController.
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
}}
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.
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.
166 \wxheading{Parameters
}
168 \docparam{viewer
}{This defaults to "netscape" for wxExtHelpController.
}
170 \docparam{flags
}{This defaults to wxHELP
\_NETSCAPE for wxExtHelpController, indicating
171 that the viewer is a variant of Netscape Navigator.
}
173 \membersection{wxHelpController::OnQuit
}\label{wxhelpcontrolleronquit
}
175 \func{virtual bool
}{OnQuit
}{\void}
177 Overridable member called when this application's viewer is quit by the user.
179 This does not work for all help controllers.
181 \membersection{wxHelpController::Quit
}\label{wxhelpcontrollerquit
}
183 \func{virtual bool
}{Quit
}{\void}
185 If the viewer is running, quits it by disconnecting.
187 For Windows Help, the viewer will only close if no other application is using it.