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 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
HelpController, HtmlHelpController, HTML Overview
__init__ | Constructs a help instance object, but does not invoke the help viewer. |
DisplayBlock | If the help viewer is not running, runs it and displays the file at the given block number. |
DisplayContents | If the help viewer is not running, runs it and displays the contents. |
DisplayContextPopup | Displays the section as a popup window using a context id. |
DisplaySection | If the help viewer is not running, runs it and displays the given section. |
DisplayTextPopup | Displays the text in a popup window, if possible. |
GetFrameParameters | For HtmlHelpController, returns the latest frame size and position settings and whether a new frame is drawn with each invocation. |
GetParentWindow | Returns the window to be used as the parent for the help window. |
Initialize | Initializes the help instance with a help filename, and optionally a server socket number if using Help (now obsolete). |
KeywordSearch | If the help viewer is not running, runs it, and searches for sections matching the given keyword. |
LoadFile | If the help viewer is not running, runs it and loads the given file. |
OnQuit | Overridable member called when this application’s viewer is quit by the user. |
Quit | If the viewer is running, quits it by disconnecting. |
SetFrameParameters | For HtmlHelpController, the title is set (with s indicating the page title) and also the size and position of the frame if the frame is already open. |
SetParentWindow | Sets the window to be used as the parent for the help window. |
SetViewer | Sets detailed viewer information. |
FrameParameters | See GetFrameParameters and SetFrameParameters |
ParentWindow | See GetParentWindow and SetParentWindow |
This is the abstract base class a family of classes by which applications may invoke a help viewer to provide on-line help.
Possible constructors:
HelpControllerBase(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 HtmlHelpController, as the parent for the help window instead of the value of App.GetTopWindow .
You can also change the parent window later with SetParentWindow .
Parameters: | parentWindow (Window) – |
---|
If the help viewer is not running, runs it and displays the file at the given block number.
Parameters: | blockNo (long) – |
---|---|
Return type: | bool |
Deprecated since version 2.9.4: This function is for backward compatibility only, and applications should use DisplaySection instead.
If the help viewer is not running, runs it and displays the contents.
Return type: | bool |
---|
Displays the section as a popup window using a context id.
Returns False if unsuccessful or not implemented.
Parameters: | contextId (int) – |
---|---|
Return type: | bool |
Overloaded Implementations:
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.
Parameters: | section (string) – |
---|---|
Return type: | bool |
DisplaySection (self, sectionNo)
If the help viewer is not running, runs it and displays the given section.
Parameters: | sectionNo (int) – |
---|---|
Return type: | bool |
Displays the text in a popup window, if possible.
Returns False if unsuccessful or not implemented.
Parameters: |
|
---|---|
Return type: | bool |
For 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.
The most recent frame size.
The most recent frame position.
True if a new frame is drawn with each invocation.
Return type: | tuple |
---|---|
Returns: | ( Frame, size, pos, newFrameEachTime ) |
Returns the window to be used as the parent for the help window.
This window is used by CHMHelpController, WinHelpController and HtmlHelpController.
Return type: | Window |
---|
Initializes the help instance with a help filename, and optionally a server socket number if using Help (now obsolete).
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 HtmlHelpController, the extensions zip, htb and hhp will be appended while searching for a suitable file. For WinHelp, the hlp extension is appended.
Overloaded Implementations:
Initialize (self, file)
Parameters: | file (string) – |
---|---|
Return type: | bool |
Initialize (self, file, server)
Parameters: |
|
---|---|
Return type: | bool |
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 to search the index (HELP_SEARCH_INDEX) but this currently is only supported by the HtmlHelpController.
Parameters: |
|
---|---|
Return type: | bool |
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 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.
HtmlHelpController ignores this call.
Parameters: | file (string) – |
---|---|
Return type: | bool |
Overridable member called when this application’s viewer is quit by the user.
This does not work for all help controllers.
If the viewer is running, quits it by disconnecting.
For Windows Help, the viewer will only close if no other application is using it.
Return type: | bool |
---|
For HtmlHelpController, the title is set (with s indicating the page title) and also the size and position of the frame if the frame is already open.
newFrameEachTime is ignored.
For all other help controllers this function has no effect.
Parameters: |
---|
Sets the window to be used as the parent for the help window.
This is used by CHMHelpController, WinHelpController and HtmlHelpController.
Parameters: | parentWindow (Window) – |
---|
Sets detailed viewer information.
So far this is only relevant to ExtHelpController. Some examples of usage:
self.help.SetViewer("kdehelp")
self.help.SetViewer("gnome-help-browser")
self.help.SetViewer("netscape", wx.HELP_NETSCAPE)
Parameters: |
|
---|
Todo
modernize this function with LaunchDefaultBrowser
See GetFrameParameters and SetFrameParameters
See GetParentWindow and SetParentWindow