Adding InLine Help to your program


Download program
Download complete Delphi-7 project

Introduction

Programs require HELP information, which should be available at runtime.
This HELP information may reside:
    1. as part of the program
    2. in a separate file of the users system
    3. as an external web page
This article describes method 1, where the information is stored in a LISTBOX component
which was preloaded from a text file in design time.

To produce the HELP stringlist, a special editor program is required.
Editing and layout have been kept very simple.
To use the HELP information in a program, a subset of the editor program is needed.
In the last case, only code to write the information is needed, the editor functions may be skipped.
This project shows the editor as well as a more simple form/unit for display purposes only.

The HELP editor

Below is a true size image of the editor in action
Each line is a textstring, which includes data as well as layout code.
Codes for layout have the form \? where \ is the control character, ? is a character causing specific action.
Below is the list of control codes
       \n      select normal (default) conditions
       \l      select large text
       \f      select fat text
       \i      select italic text
       \h      select header text
       \m      select background color
       \p      select superscript
       \s      select subscript
       \t      select tab (next multiple of 100 pixels)
       \[      select, deselect rectangle around text
       \c      select courier font
       \@name; insert arrow (reference to next line)
       \#name; insert dot   (mark as reference line)
     
The \@name; command paints an arrow and enters the name in the LINKLIST.
The \#name; command paints a dot and links the line to the name.
The " ; " character terminates the name string.
Clicking on the arrow in runtime will place the #name line at the top of the screen.
Clicking on a dot will place line 0 at the top.
Purpose is a fast jump to a chapter and back to the contents page.

Below is a page with links
Many more control codes may be easily added.

During text editing
     control X  erases a line
             Y  shifts lines up   (deleting the current line)
             Z  shifts lines down (creating an empty line)
     
And of course, the CURSOR keys, HOME, END, BACKSPACE and DELETE may be used.

Characters like ë , ö, ï , è, ò, ì .... are typed by:
altkey e, hold alt key and keep pressing for the proper e.
Same for o,i.

Menu buttons allow for storage and retrieval of the HELP data.
These files have no extension, but are text files.

The LINKLIST is created by a click on the "LINK" menu button.
Only after creation a mouseclick on an arrow or dot shows effect.
Also checks are performed to ensure a valid LINKLIST.

The "CLEAR" menu button clears all help information.

The "LOAD" menu button loads the edited data into the HELPFORM LISTBOX.

The "HELP" menu button calls the HELP unit with the preloaded data in a LISTBOX.
At that time, a LINKTABLE for the HELPUNIT is generated.

The "SOURCECODE" static text may be clicked to switch control code visability on/off.

Note:
The HELPFORM/HELPUNIT contains all procedures to display data, but has no edit capabilities.
A copy of the HELPFORM/HELPUNIT may be added to an application to provide InLine help.

For details, please refer to the source code.