Class XbpHelp() Foundation
Class function XbpHelp class.
The XbpHelp class provides objects that display online help files created by the help compiler. On modern Windows platforms, this is the Microsoft HTML Help Workshop (see the chapter Online Helpin the Xbase++ documentation).
An XbpHelp object manages the online help window and can activate a particular help window within the online help. This allows help text that applies only to a specific dialog element to be displayed. In conjunction with XbpHelpLabel objects context sensitive online help is created.
Windows RTF | Windows HTML | |
---|---|---|
Help compiler | HCW.EXE | HHW.EXE |
Source code extension | .RTF | .HTM |
Compiled help file extension | .HLP | .CHM |
// This example shows the basic process for calling
// online help from an Xbase++ program. The source code
// of the online help "EXAMPLE.HLP" is shown in the
// example "Source code for online help".
#include "Appevent.ch"
PROCEDURE Main
LOCAL nEvent, mp1, mp2, oXbp, oHelp, nRes
SetColor( "N/W" ) // Fill window with gray
CLS
? "Call online help with F1"
// Create XbpHelp object
oHelp := XbpHelp():New( , "Example.hlp", "Example")
oHelp:inform := {|n| nRes := n } // Specify inform code block
oHelp:Create() // Request system resources
nRes := 0
nEvent := 0
DO WHILE nEvent <> xbeP_Close // Event loop
nEvent := AppEvent (@mp1, @mp2, @oXbp, 0.1)
DO CASE
CASE nEvent == xbeK_F1 // Display table of contents
oHelp:showHelpContents() // of the online help (F1)
CASE nRes <> 0 // Process reference from
// online help
? "Received message from online help:", nRes
nRes := 0
CASE oXbp <> NIL // Send event to addressee
// (Xbase Part)
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDCASE
ENDDO
RETURN
.* The example shows the source code for the IPF file which
.* is used for the program example "Activate online help".
.* The file EXAMPLE.IPF must be compiled with IPFC.EXE
.* to a HLP file so that the program example "Activate online
.* help" can work.
.*
.* EXAMPLE.IPF
.*
:userdoc.
:h1 id=IPF_LINK.Cross reference within the online help
:p.Click on the word
:link refid=XPP_LINK reftype=hd.cross reference:elink.
to activate another help window.
:h1 id=XPP_LINK.Cross reference to the Xbase++ application
:p.Click on the word
:link res=100 reftype=inform.Xbase++:elink.
to access the application.
:euserdoc.
// A comprehensive example for a Windows online help project
// is found in the ..\SAMPLES\BASICS directory. It includes
// PRG source code, project file (HHP file), table of contents
// (HHC file), index (HHK file) and HTML sources.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.