Classes

Class XbpHelp() Foundation

Class function XbpHelp class.

Superclass
Description

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.

Differences in online help systems
Windows RTF Windows HTML
Help compiler HCW.EXE HHW.EXE
Source code extension .RTF .HTM
Compiled help file extension .HLP .CHM

Class methods
:new()
Creates an instance of the XbpHelp class.
Instance variables
:debugMode
Displays the online help in debug mode.
:resGeneralHelp
Contains the numeric ID for the help text that is displayed when the "General help F2" option of the online help menu is selected.
:resKeysHelp
Contains the numeric ID for the text that is displayed when the "Keys help F9" option of the online help menu is selected.
Life cycle
:create()
Requests system resources for the XbpHelp object.
:configure()
Reconfigures the XbpHelp object.
:destroy()
Releases the system resources of the XbpHelp object.
Methods
:hide()
Closes the online help window.
:showGeneralHelp()
OS/2 - Displays the help window containing the General help text.
:showHelp()
Displays the specified help window of the online help.
:showHelpContents()
Displays the table of contents of the online help.
:showHelpIndex()
Displays the index of the online help.
:showKeysHelp()
OS/2 - Displays the help window containing help text for common key assignments used in the application.
Messages
xbeHelp_Inform
OS/2 - The code block for cross referencing back to the Xbase++ application from the online help.
Examples
Activate online help under OS/2
// 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 
IPF source code for online help
.* 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. 

Activate online help under Windows
// 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. 
Feedback

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.