Application Developer Guide > Building VDA Tools > Adding Online Help
  

Adding Online Help
This section discusses how online help for VDA Tools is implemented and how you can incorporate online help into your own VDA Tools applications.
If you wish to add context sensitive help to your VDA Tool you can do so by authoring your online help information in ASCII files. There is no way to add new help files to the WebWorks HTML Online Help system distributed with PV-WAVE.
Online Help Implementation Overview
A user can access online help from a VDA Tool in two ways: from the Help menu or by clicking the Help button in a dialog box. In each case, menu and dialog box button callbacks are used to display the appropriate topic.
The Help Menu
Standard VDA Tools menu callbacks are defined in wographicsbuttonscb.pro.
The standard VDA Tool Help menu contains four buttons:
*On Window—When this button is selected, the help system starts and a help topic is displayed for the tool being used. The specific WebWorks help filename and topic name are specified in the menu callback. This callback calls the PV‑WAVE HELP procedure with the Filename and Keyword parameters.
*Index—When this button is selected, the help system starts and displays the help index. The callback routine calls the PV‑WAVE HELP procedure with the Index keyword.
*On Help—When this button is selected, the help system starts and displays information on how to use the online help system. The callback routine calls the PV‑WAVE HELP procedure with the Help keyword.
*On Version—When this button is selected, the help system starts and a specific help topic is displayed. This help topic contains information on the current software version. You must supply the specific help filename and topic name in the menu callback. This callback calls the PV‑WAVE HELP procedure with the Filename and Keyword parameters.
Two menu callbacks that you must change for your VDA Tool program are callbacks for On Window and On Version. These are the help topics that can vary for each VDA Tool and application. In general, there is no reason to change the other two menu buttons, Index and On Help, as these display topics that do not vary from application to application
If you are using the standard VDA Tool menu, as provided by the routine WoMenuBar, you will need to do three things:
1. Create an ASCII file containing your help information.
2. Create a new callback that uses WwText or WgTextTool to display the ASCII file you created in Step 1. Because the callbacks used by the standard VDATools defined in wographicsbuttonscb.pro are tailored specifically for WebWorks Help, the following help callback example uses the PV‑WAVE Widgets function WgTextTool to read the text file you have written and display it in a window.
; This example opens the text file 'Tips' located in
; $WAVE_DIR.
PRO MyHelpCB, wid, index
filename = GETENV('WAVE_DIR')+'/data/air_qual.dat'
WgTextTool, File=filename
END
3. Modify the CALLBACK field in the menu structure for your menu item named with the resource 'HelpOnWindow'. The menu structures for VDA Tools are in wz*menus.pro (for example, WzPlot's menus are defined in wzplotmenus.pro). You need to add the name of the callback routine you wrote in Step 2 to this field. For example, if you were modifying WzPlot, then in the file $WAVE_DIR/lib/vdatools/wzplotmenus.pro, you would replace the callback 'WoGMBHelpOnWindowCB' that is called when a user selects Help->On Window, with 'MyHelpCB'.
Dialog Box Help
Use the WAVE Widgets WwGenericDialog, instead of WoGenericDialog, to create the dialog boxes in your VDA Tools. WoGenericDialog is set up specifically to access WebWorks Help. It would be difficult to modify this convenience routine to work with an alternative help system.
With WwGenericDialog, you can use the optional labels parameter to specify the buttons that will appear in a dialog box. The callback routine, then, can be a simple CASE statement that takes appropriate action depending on which button was selected. For the Help button, this case statement can call WwText or WgTextTool directly to display the appropriate help information.

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.