Create context-sensitive help for a component in Lazarus

660 Views Asked by At

We want to make documentation for some new components in Lazarus. Chm documentation files are already available, and we just need to somehow integrate them with Lazarus.

This help system should be context-sensitive, that is after F1 key was pressed on an element (function, property, etc) of the defined components, the respective help in the chm file is appeared in Lhelp (Lazarus help program).

So, what should we do to provide such a context-sensitive help please?

Thanks in advance

2

There are 2 best solutions below

0
On

You can use fpdoc top create the documentation, and compile it to chm, and lazarus/lhelp should open all CHMs in the document/ directory according to http://bugs.freepascal.org/view.php?id=15334

The index part of the CHM is iirc used for the lookup.

1
On

There's a similar question posted here: How do I add a .chm help file to my application built in Lazarus?

There's a wiki page about it in the Lazarus/FreePascal wiki: http://wiki.lazarus.freepascal.org/Add_Help_to_Your_Application

As far as my knowledge Lazarus provides help files as HTML files by default, anyway CHM files are supported too.

There's a sample program in your Lazarus installation:

${lazarusdir}/components/chmhelp/democontrol/.

This demo shows how to set up a context- sensitive help button (F1 usually).

Be sure to check the documentation about lhelp, the default Lazarus CHM viewer too, described here:

http://wiki.lazarus.freepascal.org/lhelp