This is the abstract base class a family of classes by which applications may invoke a help viewer to provide on-line help.
A help controller allows an application to display help, at the contents or at a particular topic, and shut the help program down on termination. This avoids proliferation of many instances of the help viewer whenever the user requests a different topic via the application’s menus or buttons.
Typically, an application will create a help controller instance when it starts, and immediately call wx.HelpController.Initialize
to associate a filename with it. The help viewer will only get run, however, just before the first call to display something.
See also
wx.HelpController
, wx.html.HtmlHelpController, HTML Overview
wx.adv.ExtHelpController, wx.HelpController
, wx.html.HtmlHelpController
Constructs a help instance object, but does not invoke the help viewer. |
|
If the help viewer is not running, runs it and displays the file at the given block number. |
|
If the help viewer is not running, runs it and displays the contents. |
|
Displays the section as a popup window using a context id. |
|
If the help viewer is not running, runs it and displays the given section. |
|
Displays the text in a popup window, if possible. |
|
For wx.html.HtmlHelpController, returns the latest frame size and position settings and whether a new frame is drawn with each invocation. |
|
Returns the window to be used as the parent for the help window. |
|
Initializes the help instance with a help filename. |
|
If the help viewer is not running, runs it, and searches for sections matching the given keyword. |
|
If the help viewer is not running, runs it and loads the given file. |
|
Overridable member called when this application’s viewer is quit by the user. |
|
If the viewer is running, quits it by disconnecting. |
|
Set the parameters of the frame window. |
|
Sets the window to be used as the parent for the help window. |
|
Sets detailed viewer information. |
See |
|
See |
wx.
HelpControllerBase
(Object)¶Possible constructors:
HelpControllerBase(parentWindow=None)
This is the abstract base class a family of classes by which applications may invoke a help viewer to provide on-line help.
__init__
(self, parentWindow=None)¶Constructs a help instance object, but does not invoke the help viewer.
If you provide a window, it will be used by some help controller classes, such as CHMHelpController, WinHelpController and wx.html.HtmlHelpController, as the parent for the help window instead of the value of wx.App.GetTopWindow
.
You can also change the parent window later with SetParentWindow
.
parentWindow (wx.Window) –
DisplayBlock
(self, blockNo)¶If the help viewer is not running, runs it and displays the file at the given block number.
WinHelp: Refers to the context number.
MS HTML Help: Refers to the context number.
External HTML help: the same as for DisplaySection
.
` wx.html.HtmlHelpController: ` sectionNo is an identifier as specified in the Help Files Format.
blockNo (long) –
bool
Deprecated
This function is for backward compatibility only, and applications should use DisplaySection
instead.
DisplayContents
(self)¶If the help viewer is not running, runs it and displays the contents.
bool
DisplayContextPopup
(self, contextId)¶Displays the section as a popup window using a context id.
Returns False
if unsuccessful or not implemented.
contextId (int) –
bool
DisplaySection
(self, *args, **kw)¶DisplaySection (self, section)
If the help viewer is not running, runs it and displays the given section.
The interpretation of section differs between help viewers. For most viewers, this call is equivalent to KeywordSearch. For MS HTML Help, HTML help and external HTML help, if section has a .htm or .html extension, that HTML file will be displayed; otherwise a keyword search is done.
section (string) –
bool
DisplaySection (self, sectionNo)
If the help viewer is not running, runs it and displays the given section.
WinHelp, MS HTML Help sectionNo is a context id.
MS HTML Help: Pass -1 in sectionNo to display the index.
External HTML help: wx.adv.ExtHelpController implements sectionNo as an id in a map file, which is of the form:
` wx.html.HtmlHelpController: ` sectionNo is an identifier as specified in the Help Files Format. See also the help sample for notes on how to specify section numbers for various help file formats.
sectionNo (int) –
bool
DisplayTextPopup
(self, text, pos)¶Displays the text in a popup window, if possible.
Returns False
if unsuccessful or not implemented.
text (string) –
pos (wx.Point) –
bool
GetFrameParameters
(self)¶For wx.html.HtmlHelpController, returns the latest frame size and position settings and whether a new frame is drawn with each invocation.
For all other help controllers, this function does nothing and just returns None
.
tuple
( wx.Frame, size, pos, newFrameEachTime )
GetParentWindow
(self)¶Returns the window to be used as the parent for the help window.
This window is used by CHMHelpController, WinHelpController and wx.html.HtmlHelpController.
Initialize
(self, file)¶Initializes the help instance with a help filename.
Does not invoke the help viewer. This must be called directly after the help instance object is created and before any attempts to communicate with the viewer.
You may omit the file extension and a suitable one will be chosen. For wx.html.HtmlHelpController, the extensions zip, htb and hhp will be appended while searching for a suitable file. For WinHelp, the hlp extension is appended.
file (string) –
bool
KeywordSearch
(self, keyWord, mode=HELP_SEARCH_ALL)¶If the help viewer is not running, runs it, and searches for sections matching the given keyword.
If one match is found, the file is displayed at this section. The optional parameter allows searching the index (wx``wx.HELP_SEARCH_INDEX``) but this currently is only supported by the wx.html.HtmlHelpController.
WinHelp, MS HTML Help: If more than one match is found, the first topic is displayed.
MS HTML Help: Pass an empty string to display the search page.
External HTML help, simple HTML help: If more than one match is found, a choice of topics is displayed.
` wx.html.HtmlHelpController: ` see wx.html.HtmlHelpController.KeywordSearch
.
keyWord (string) –
mode (HelpSearchMode) –
bool
LoadFile
(self, file="")¶If the help viewer is not running, runs it and loads the given file.
If the filename is not supplied or is empty, the file specified in wx.Initialize is used.
If the viewer is already displaying the specified file, it will not be reloaded. This member function may be used before each display call in case the user has opened another file.
wx.html.HtmlHelpController ignores this call.
file (string) –
bool
OnQuit
(self)¶Overridable member called when this application’s viewer is quit by the user.
This does not work for all help controllers.
Quit
(self)¶If the viewer is running, quits it by disconnecting.
For Windows Help, the viewer will only close if no other application is using it.
bool
SetFrameParameters
(self, titleFormat, size, pos=DefaultPosition, newFrameEachTime=False)¶Set the parameters of the frame window.
For wx.html.HtmlHelpController, titleFormat specifies the title string format (with s
being replaced by the actual page title) and size and position specify the geometry of the frame.
For all other help controllers this function has no effect.
Finally, newFrameEachTime is always ignored currently.
SetParentWindow
(self, parentWindow)¶Sets the window to be used as the parent for the help window.
This is used by CHMHelpController, WinHelpController and wx.html.HtmlHelpController.
parentWindow (wx.Window) –
SetViewer
(self, viewer, flags=HELP_NETSCAPE)¶Sets detailed viewer information.
So far this is only relevant to wx.adv.ExtHelpController. Some examples of usage:
self.help.SetViewer("kdehelp")
self.help.SetViewer("gnome-help-browser")
self.help.SetViewer("netscape", wx.HELP_NETSCAPE)
viewer (string) – This defaults to “netscape” for wx.adv.ExtHelpController.
flags (long) – This defaults to wx.HELP_NETSCAPE
for wx.adv.ExtHelpController, indicating that the viewer is a variant of Netscape Navigator.
Todo
modernize this function with wx.LaunchDefaultBrowser
FrameParameters
¶See GetFrameParameters
and SetFrameParameters
ParentWindow
¶See GetParentWindow
and SetParentWindow