wxHelpInstance: wxClient

The wxHelpInstance class implements the interface by which applications may invoke wxHelp to provide on-line help. Each instance of the class maintains one connection to an instance of wxHelp which belongs to the application, and which is shut down when the Quit member of wxHelpInstance is called (for example in the OnClose member of an application's main frame). Under Windows 3, there is currently only one instance of wxHelp which is used by all applications.

Since there is a DDE link between the two programs, each subsequent request to display a file or section uses the existing instance of wxHelp, rather than starting a new instance each time. wxHelp thus appears to the user to be an extension of the current application. wxHelp may also be invoked independently of a client application.

Normally an application will create an instance of wxHelpInstance when it starts, and immediately call Initialize to associate a filename with it. wxHelp will only get run, however, just before the first call to display something. See the test program supplied with the wxHelp source.

Include the file wx_help.h to use this API, even if you have included wx.h.

wxHelpInstance::wxHelpInstance

voidwxHelpInstance

Constructs a help instance object, but does not invoke wxHelp.

wxHelpInstance::wxHelpInstance

Destroys the help instance, closing down wxHelp for this application if it is running.

wxHelpInstance::Initialize

voidInitializechar *file, int server = -1

Initializes the help instance with a help filename, and optionally a server (socket) number (one is chosen at random if this parameter is omitted). Does not invoke wxHelp. This must be called directly after the help instance object is created and before any attempts to communicate with wxHelp.

wxHelpInstance::DisplayBlock

BoolDisplayBlocklong blockNo

If wxHelp is not running, runs wxHelp and displays the file at the given block number.

wxHelpInstance::DisplayContents

BoolDisplayContents

If wxHelp is not running, runs wxHelp and displays the contents (the first section of the file).

wxHelpInstance::DisplaySection

BoolDisplaySectionint sectionNo

If wxHelp is not running, runs wxHelp and displays the given section. Sections are numbered starting from 1, and section numbers may be viewed by running wxHelp in edit mode.

wxHelpInstance::KeywordSearch

BoolKeywordSearchchar *keyWord

If wxHelp is not running, runs wxHelp, and searches for sections matching the given keyword. If one match is found, the file is displayed at this section. If more than one match is found, the Search dialog is displayed with the matches.

wxHelpInstance::LoadFile

BoolLoadFilechar *file = NULL

If wxHelp is not running, runs wxHelp, and loads the given file. If the filename is not supplied or is NULL, the file specified in Initialize is used. If wxHelp 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.

wxHelpInstance::OnQuit

BoolOnQuit

Overridable member called when this application's wxHelp is quit.

wxHelpInstance::Quit

BoolQuit

If wxHelp is running, quits wxHelp by disconnecting.